/* ==========================================================================
   Поліграфсервіс — «книга в тканинній палітурці»
   Кольори взято з власної продукції: чорнильно-синя палітурна тканина,
   золото фольги, бордо шкірзаміну. Золото — лише там, де на справжній
   обкладинці лежала б фольга: на синьому чи бордо. На папері — --gold-ink.
   Шрифти: Literata (заголовки, цифри) + Source Sans 3 (текст, інтерфейс),
   обидва з повною кирилицею, самостійно розміщені (Google Fonts, OFL).
   ========================================================================== */

/* --- Шрифти ------------------------------------------------------------- */

@font-face { font-family: 'Literata'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/literata-500-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/literata-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/literata-500-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/literata-500-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; }

/* Source Sans 3 — варіативний: один файл на набір символів покриває 400–600 */
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('../fonts/source-sans-3-var-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('../fonts/source-sans-3-var-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('../fonts/source-sans-3-var-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('../fonts/source-sans-3-var-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; }

/* Резервні шрифти з підігнаними метриками (пораховано з woff2 через CoreText,
   _tools/font_metrics.swift) — щоб текст не «стрибав», поки вантажиться веб-шрифт */
@font-face { font-family: 'Literata Fallback'; src: local('Georgia');
  size-adjust: 114.57%; ascent-override: 102.73%; descent-override: 26.88%; line-gap-override: 0%;
  unicode-range: U+0301, U+0400-045F, U+0460-052F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Literata Fallback'; src: local('Georgia');
  size-adjust: 113.11%; ascent-override: 104.06%; descent-override: 27.23%; line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0100-02FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Source Sans Fallback'; src: local('Arial');
  size-adjust: 95.23%; ascent-override: 107.52%; descent-override: 42.00%; line-gap-override: 0%;
  unicode-range: U+0301, U+0400-045F, U+0460-052F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Source Sans Fallback'; src: local('Arial');
  size-adjust: 91.92%; ascent-override: 111.40%; descent-override: 43.51%; line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0100-02FF, U+2000-206F, U+20AC, U+2122; }

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

:root {
  /* палітурна тканина */
  --ink:        #131e33;
  --ink-deep:   #0b1220;
  --ink-soft:   #1c2b46;
  /* фольга — лише на синьому чи бордо */
  --gold:       #c9a227;
  --gold-lt:    #dcb84a;
  /* той самий відтінок, затемнений для паперу (5.6:1) */
  --gold-ink:   #7f6410;
  /* шкірзамінник */
  --bordo:      #7d2436;
  /* папір, узгоджений з холодним студійним тлом фото */
  --paper:      #fcfcfd;
  --paper-alt:  #f2f4f7;
  --well:       #e4e6e9;
  --studio:     #f5f6f7;
  --line:       #dde1e7;
  --field:      #8a93a3;
  --text:       #151b26;
  --muted:      #5b6475;
  --on-dark:       #d5dbe6;
  --on-dark-muted: #aeb8ca;
  --error:      #b3261e;

  --font-display: 'Literata', 'Literata Fallback', Georgia, serif;
  --font-text:    'Source Sans 3', 'Source Sans Fallback', -apple-system, 'Segoe UI', Arial, sans-serif;

  --wrap: 1240px;
  --pad: 24px;
  --r: 2px;                              /* одна система кутів на весь сайт */
  --header-h: 72px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* шари */
  --z-header: 50;
  --z-mobilebar: 60;
  --z-lightbox: 100;
  --z-skip: 200;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--font-text);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* height:auto — інакше атрибут height="900" перебиває aspect-ratio */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: var(--r); }
.topbar :focus-visible, .hero :focus-visible, .hero-strip :focus-visible, .on-dark :focus-visible,
.page-head :focus-visible, .cta-band :focus-visible, .mobile-cta :focus-visible,
.lb :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

/* --- Типографіка -------------------------------------------------------- */

h1, h2, h3, h4 { margin: 0 0 .5em; text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 500; }
h1 { font-size: clamp(2.25rem, 1rem + 2.5vw, 3.25rem); line-height: 1.08; letter-spacing: -.015em; }
h2 { font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.5rem); line-height: 1.14; letter-spacing: -.01em; }
h3 { font-weight: 600; font-size: 1.125rem; line-height: 1.3; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

.lead { font-size: 1.1875rem; line-height: 1.55; color: var(--muted); max-width: 60ch; }
.on-dark .lead { color: var(--on-dark); }

/* Єдиний надзаголовок на сторінці — у смузі історії */
.eyebrow {
  display: inline-block; margin-bottom: 14px;
  font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold);
}

.hero-strip b, .case .num, .step::before, .runs td:nth-child(2) {
  font-variant-numeric: lining-nums tabular-nums;
}

/* --- Кнопки й посилання ------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .875em 1.5em;
  font: 600 .9375rem/1.2 var(--font-text); letter-spacing: .01em;
  text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; border-radius: var(--r);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 240ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }

/* .btn-gold: на папері — чорнильна; на тканині (синій, бордо) — фольга */
.btn-gold { background: var(--ink); color: #fff; }
.btn-gold:hover { background: var(--ink-soft); }
.hero .btn-gold, .on-dark .btn-gold, .cta-band .btn-gold, .mobile-cta .btn-gold {
  background: var(--gold); color: var(--ink-deep);
}
.hero .btn-gold:hover, .on-dark .btn-gold:hover, .cta-band .btn-gold:hover, .mobile-cta .btn-gold:hover {
  background: var(--gold-lt);
}
/* стрілку малює CSS, щоб читач екрана її не озвучував */
.btn-gold::after { content: "→"; content: "→" / ""; transition: transform 240ms var(--ease-out); }
.btn-gold:hover::after { transform: translateX(3px); }
.mobile-cta .btn-gold::after { content: none; }

.btn-ghost { background: transparent; color: var(--ink); border-color: currentColor; }
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Другорядна дія — посилання, а не ще одна кнопка */
.text-link {
  display: inline-flex; align-items: center; min-height: 48px;
  font-weight: 600; font-size: .9375rem;
  color: inherit;
  text-decoration: underline; text-decoration-color: var(--gold);
  text-decoration-thickness: 2px; text-underline-offset: .32em;
  transition: text-decoration-thickness 180ms ease, color 180ms ease;
}
.text-link:hover { text-decoration-thickness: 3px; color: #fff; }

/* --- Секції ------------------------------------------------------------- */

.section { padding: clamp(64px, 8vw, 112px) 0 clamp(72px, 9vw, 128px); }
.section-alt { background: var(--paper-alt); }
.on-dark { background: var(--ink); color: var(--on-dark); }
.on-dark h1, .on-dark h2, .on-dark h3 { color: #fff; }
.section-head { margin-bottom: clamp(28px, 3.5vw, 48px); }
.section-head h2 { max-width: 26ch; margin-bottom: 16px; }

/* --- Поява при прокрутці ------------------------------------------------ */

.js .reveal { opacity: 0; }
.reveal.in { opacity: 1; transition: opacity .6s var(--ease-out); }
.reveal.in > * { animation: riseIn .6s var(--ease-out) both; }
.reveal.in > *:nth-child(2) { animation-delay: 60ms; }
.reveal.in > *:nth-child(3) { animation-delay: 120ms; }
.reveal.in > *:nth-child(4) { animation-delay: 180ms; }
.reveal.in > *:nth-child(5) { animation-delay: 240ms; }
.reveal.in > *:nth-child(n+6) { animation-delay: 300ms; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* --- Верхня смуга ------------------------------------------------------- */

.topbar { background: var(--ink-deep); color: var(--on-dark-muted); font-size: .8125rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: center; min-height: 40px; }
.topbar a { color: var(--on-dark); font-weight: 500; text-decoration: none; }
.topbar a:hover { color: var(--gold-lt); }
.topbar .spacer { margin-left: auto; }

/* --- Шапка -------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(252, 252, 253, .96);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 240ms ease;
}
.site-header.scrolled { box-shadow: 0 8px 24px rgba(19, 30, 51, .08); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: var(--header-h); }

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: var(--gold); border-radius: var(--r);
  font: 600 1.1rem/1 var(--font-text); letter-spacing: -.03em;
}
.logo-text { line-height: 1.15; }
.logo-text b {
  display: block; font-weight: 600; font-size: 1.0625rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.logo-text span { font-weight: 500; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  position: relative; padding: 10px 12px;
  font-weight: 500; font-size: .9375rem;
  color: var(--ink); text-decoration: none;
}
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px;
  background: var(--gold-ink); transform: scaleX(0); transform-origin: left;
  transition: transform 240ms var(--ease-out);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

.lang { display: flex; align-items: center; gap: 2px; margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.lang b, .lang a { font-size: .75rem; font-weight: 600; letter-spacing: .08em; padding: 5px 7px; border-radius: var(--r); }
.lang b { background: var(--ink); color: #fff; }
.nav .lang a { color: var(--muted); padding: 5px 7px; font-size: .75rem; border-bottom: 0; transition: color 180ms ease, background-color 180ms ease; }
.nav .lang a::after { display: none; }
.nav .lang a:hover { color: var(--ink); background: var(--paper-alt); }

.nav-toggle {
  display: none; margin-left: auto; position: relative;
  width: 46px; height: 46px; padding: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
}
.nav-toggle i { position: absolute; left: 13px; right: 13px; height: 2px; background: var(--ink); transition: transform 240ms var(--ease-out), opacity 180ms; }
.nav-toggle i:nth-child(1) { top: 16px; }
.nav-toggle i:nth-child(2) { top: 22px; }
.nav-toggle i:nth-child(3) { top: 28px; }
.nav-toggle[aria-expanded="true"] i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --- Герой: передня кришка книги ---------------------------------------- */

.hero { background: var(--ink); color: #fff; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; min-height: min(78svh, 660px); }

.hero-copy {
  display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 720px; margin-left: auto;
  padding: clamp(48px, 6vw, 88px) clamp(24px, 4vw, 72px);
}
.hero-copy > * { animation: heroIn .7s var(--ease-out) both; }
.hero-copy > *:nth-child(2) { animation-delay: 80ms; }
.hero-copy > *:nth-child(3) { animation-delay: 160ms; }
@keyframes heroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero-copy h1 { margin-bottom: .45em; color: #fff; }
.hero-copy h1 em { font-style: normal; color: var(--gold); white-space: nowrap; }
.hero-sub { font-size: 1.1875rem; line-height: 1.55; color: var(--on-dark); max-width: 44ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }

.hero-media { position: relative; min-width: 0; background: var(--studio); }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* Корінець: чотири факти під героєм */
.hero-strip { background: var(--ink-deep); }
.hero-strip .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.hero-strip .wrap > div { padding: 24px 24px 24px 0; }
.hero-strip .wrap > div + div { padding-left: 24px; border-left: 1px solid rgba(255, 255, 255, .1); }
.hero-strip b { display: block; font: 500 1.75rem/1.1 var(--font-display); color: var(--gold); }
.hero-strip span { display: block; margin-top: 6px; font-size: .875rem; color: var(--on-dark-muted); }
.hero-strip + .section { padding-block: clamp(48px, 6vw, 80px); }

/* --- Тези: одне твердження + дві примітки ------------------------------- */

.claims {
  display: grid; grid-template-columns: 7fr 5fr; grid-template-rows: auto auto;
  column-gap: clamp(32px, 6vw, 96px); row-gap: 24px; align-items: start;
}
.claim:first-child { grid-row: 1 / span 2; }
.claim:first-child p {
  font: 500 clamp(1.375rem, 1.1rem + .9vw, 1.75rem)/1.35 var(--font-display);
  color: var(--ink); max-width: 30ch;
}
.claim:not(:first-child) { border-top: 1px solid var(--line); padding-top: 16px; }
.claim:not(:first-child) p { font-size: 1rem; color: var(--muted); }

/* --- Напрямки: головний + два другорядні -------------------------------- */

.cards {
  display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto auto;
  gap: clamp(20px, 2.4vw, 32px) clamp(24px, 3vw, 48px);
}
.card { display: block; text-decoration: none; color: inherit; }
.card-img { overflow: hidden; border-radius: var(--r); background: var(--studio); }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card:first-child { grid-row: 1 / span 2; }
.card:first-child .card-img { aspect-ratio: 7 / 6; }
.card:first-child .card-body { padding-top: 20px; }
.card:first-child h3 { font: 500 1.75rem/1.2 var(--font-display); color: var(--ink); }
.card:not(:first-child) { display: grid; grid-template-columns: 5fr 7fr; column-gap: 24px; align-items: start; }
.card:not(:first-child) .card-img { aspect-ratio: 3 / 4; }
.card h3 { margin-bottom: .4em; color: var(--ink); }
.card p { font-size: .9375rem; color: var(--muted); }
.card-more { display: inline-block; margin-top: 14px; font-weight: 600; font-size: .9375rem; color: var(--ink); }
.card-more::after { content: " →"; content: " →" / ""; color: var(--gold-ink); display: inline-block; transition: transform 240ms var(--ease-out); }
.card:hover .card-more { text-decoration: underline; text-underline-offset: .25em; }
.card:hover .card-more::after { transform: translateX(4px); }

/* --- Наклади: таблиця в стилі booktabs ---------------------------------- */

.runs-wrap { max-width: 60rem; }
.runs { width: 100%; border-collapse: collapse; font-size: 1rem; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.runs th, .runs td { text-align: left; vertical-align: top; padding: 14px 20px 14px 0; }
.runs th { padding-block: 12px; font-weight: 600; font-size: .875rem; color: var(--muted); border-bottom: 1px solid var(--ink); }
.runs td:first-child { font-weight: 600; }
.runs td:nth-child(2) { font: 500 1.0625rem/1.4 var(--font-display); color: var(--ink); white-space: nowrap; }
.runs td:nth-child(3) { color: var(--muted); }
.runs-note { margin-top: 16px; font-size: .9375rem; color: var(--muted); }

/* --- Оздоблення: пластини з підписом ------------------------------------ */

.finish-grid {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: 1.5fr .85fr 1fr; align-items: end;
  gap: clamp(16px, 2vw, 28px);
}
.finish { margin: 0; }
.finish img { width: 100%; object-fit: cover; border-radius: var(--r); background: var(--well); }
.finish:nth-child(1) img { aspect-ratio: 4 / 3; }
.finish:nth-child(2) img { aspect-ratio: 3 / 4; }
.finish:nth-child(3) img { aspect-ratio: 1 / 1; object-position: center 78%; }
.finish figcaption { margin-top: 14px; font-weight: 600; font-size: 1rem; color: var(--ink); }

/* --- Переваги: 2 × 2 ---------------------------------------------------- */

.feats {
  display: grid; grid-template-columns: repeat(2, 1fr); max-width: 62rem;
  gap: clamp(32px, 4vw, 56px) clamp(32px, 5vw, 80px);
}
.feat h3 { font: 500 1.375rem/1.25 var(--font-display); color: var(--ink); }
.feat p { font-size: 1rem; color: var(--muted); max-width: 42ch; }

/* --- Історія (головна): єдиний колірний блок ---------------------------- */

.milestones { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255, 255, 255, .14); }
.milestone { position: relative; padding: 28px 28px 6px 0; }
.milestone::before { content: ""; position: absolute; top: -6px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); }
.milestone b { display: block; margin-bottom: 8px; font-weight: 600; font-size: .875rem; color: var(--gold-lt); }
.milestone h3 { font-size: 1.0625rem; color: #fff; }
.milestone p { font-size: .9375rem; color: var(--on-dark-muted); }
.history-more { margin-top: 36px; color: var(--on-dark); }

/* --- Галерея ------------------------------------------------------------ */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters button {
  padding: 9px 14px; font: 500 .875rem/1.2 var(--font-text);
  background: #fff; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery button {
  padding: 0; border: 0; border-radius: var(--r); overflow: hidden; cursor: zoom-in;
  aspect-ratio: 4 / 5; background: var(--studio);
}
.gallery img { width: 100%; height: 100%; object-fit: contain; transition: transform 400ms var(--ease-out); }
.gallery img[width="900"] { object-fit: contain; }         /* горизонтальні кадри — цілком */
.gallery button:hover img { transform: scale(1.03); }
.gallery button.hide { display: none; }
.gallery button.pop { animation: pop .4s var(--ease-out) both; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.gallery-count { margin-top: 20px; font-size: .9375rem; color: var(--muted); }

/* Лайтбокс */
.lb { position: fixed; inset: 0; z-index: var(--z-lightbox); display: none; place-items: center; padding: 24px; background: rgba(8, 12, 20, .95); }
.lb[open] { display: grid; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lb figure { margin: 0; display: grid; place-items: center; }
.lb img { max-width: min(1200px, 92vw); max-height: 84vh; object-fit: contain; border-radius: var(--r); transition: opacity .2s; }
.lb.loading img { opacity: .35; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; width: 48px; height: 48px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); color: #fff; border: 0; border-radius: var(--r);
  font-size: 1.4rem; cursor: pointer; transition: background-color 180ms ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .16); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; margin-top: -24px; }
.lb-next { right: 20px; top: 50%; margin-top: -24px; }
.lb-cap { position: absolute; bottom: 22px; left: 24px; right: 24px; text-align: center; color: var(--on-dark); font-size: .9375rem; }

/* --- Кейси: рядки реєстру ----------------------------------------------- */

.cases { display: grid; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case {
  display: grid; grid-template-columns: minmax(12rem, 3fr) 3fr 5fr;
  grid-template-areas: "num title body" "unit title body";
  column-gap: clamp(20px, 3vw, 48px); padding: 28px 0; align-items: start;
}
.case + .case { border-top: 1px solid var(--line); }
.case .num { grid-area: num; font: 500 clamp(2rem, 1.5rem + 1.6vw, 2.75rem)/1 var(--font-display); color: var(--ink); }
.case .unit { grid-area: unit; margin-top: 8px; font-size: .875rem; color: var(--muted); }
.case h3 { grid-area: title; margin: 6px 0 0; color: var(--ink); }
.case p { grid-area: body; margin-top: 4px; font-size: .9375rem; color: var(--muted); }

/* --- Клієнти: типографський список -------------------------------------- */

.clients { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(24px, 3vw, 48px); }
.client { padding: 20px 0 24px; border-top: 1px solid var(--line); }
.client b { display: block; font-weight: 600; font-size: 1rem; line-height: 1.35; color: var(--ink); }
.client span { display: block; margin-top: 4px; font-size: .875rem; color: var(--muted); }

/* --- Кроки -------------------------------------------------------------- */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 40px); counter-reset: s; }
.step { counter-increment: s; }
.step::before {
  content: counter(s, decimal-leading-zero);
  display: block; margin-bottom: 12px;
  font: 500 2rem/1 var(--font-display); color: var(--gold-ink);
}
.step p { font-size: .9375rem; color: var(--muted); }

/* --- Смуга заклику (внутрішні сторінки): форзац зі шкірзаміну ----------- */

.cta-band { background: var(--bordo); color: #fff; }
.cta-band .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px;
  padding-top: clamp(44px, 5vw, 64px); padding-bottom: clamp(44px, 5vw, 64px);
}
.cta-band h2 { flex: 1 1 420px; margin: 0; color: #fff; }
.cta-band p { flex-basis: 100%; margin: -6px 0 0; color: #f3dde2; }

/* --- Форма -------------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: start; }
.policy { max-width: 780px; }
.policy h2 { margin: 2rem 0 .6rem; }
.policy p { line-height: 1.7; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: .9375rem; color: var(--text); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font: 400 1rem/1.4 var(--font-text); color: var(--text);
  background: #fff; border: 1px solid var(--field); border-radius: var(--r);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.field textarea { min-height: 128px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6b7385; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink);
}
.field.invalid input, .field.invalid textarea { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.field .err { display: none; font-size: .875rem; font-weight: 600; color: var(--error); }
.field.invalid .err { display: block; }
.form-note { margin-top: 12px; font-size: .875rem; color: var(--muted); }
.cf-turnstile { margin: 16px 0; }
[data-form-error]:not([hidden]) { margin: 12px 0; color: #9a2c26; font-weight: 600; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

/* «Форму ще не підключено» — інформаційне повідомлення, не «успіх» */
.form-ok { display: none; margin-bottom: 20px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--ink); border-radius: var(--r); }
.form-ok.show { display: block; animation: riseIn .4s var(--ease-out) both; }

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list li:first-child { padding-top: 0; }
.contact-list b { display: block; margin-bottom: 2px; font-weight: 600; font-size: .875rem; color: var(--muted); }
.contact-list a { font-weight: 600; font-size: 1.0625rem; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; text-underline-offset: .25em; }
.sub-head { margin-top: 36px; }

/* --- Мобільна смуга ----------------------------------------------------- */

.mobile-cta {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-mobilebar);
  gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 18, 32, .97); backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, .1);
  transform: translateY(110%); transition: transform 350ms var(--ease-out);
}
.mobile-cta.show { transform: none; }
.mobile-cta .btn { flex: 1; min-height: 44px; padding: .75em .75em; font-size: .875rem; }
.mobile-cta .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .6); }
.mobile-cta .btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* --- Підвал: задня кришка ----------------------------------------------- */

.site-footer { background: var(--ink-deep); color: var(--on-dark-muted); font-size: .9375rem; padding: clamp(48px, 6vw, 72px) 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: clamp(24px, 3vw, 48px); padding-bottom: 44px; }
.footer-grid > div:first-child p { margin-top: 16px; }
.site-footer h4 { margin-bottom: 14px; font-weight: 600; font-size: .9375rem; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { text-decoration: none; transition: color 180ms ease; }
.site-footer a:hover { color: var(--gold-lt); }
.site-footer .logo-text b { color: #fff; }
.site-footer .logo-text span { color: var(--on-dark-muted); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 20px 0 26px;
  border-top: 1px solid rgba(255, 255, 255, .1); font-size: .875rem; color: var(--on-dark-muted);
}
.footer-bottom .spacer { margin-left: auto; }

/* --- Шапка внутрішніх сторінок ------------------------------------------ */

.page-head { background: var(--ink); color: #fff; padding: clamp(44px, 6vw, 76px) 0; }
.page-head h1 { color: #fff; margin-bottom: .35em; }
.page-head p { color: var(--on-dark); max-width: 60ch; }
.crumbs { margin-bottom: 1.2rem; font-size: .875rem; }
.page-head .crumbs { color: var(--on-dark-muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: .2em; }

/* --- Каталог ------------------------------------------------------------ */

.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.cat-nav a {
  padding: 8px 14px; font-weight: 500; font-size: .875rem; text-decoration: none;
  color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color 180ms ease;
}
.cat-nav a:hover { border-color: var(--ink); }

.catalog { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(28px, 4vw, 64px); }
.cat {
  display: grid; gap: 24px; align-items: start;
  padding: clamp(32px, 4vw, 56px) 0; border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.catalog .cat:first-child { grid-column: 1 / -1; grid-template-columns: 1.15fr 1fr; column-gap: clamp(28px, 4vw, 64px); align-items: center; }
.cat-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; border-radius: var(--r); background: var(--studio); }
.catalog .cat:first-child .cat-media img { aspect-ratio: 7 / 6; }
.cat h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem); }
.catalog .cat:first-child h2 { font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.5rem); }
.cat p { color: var(--muted); }
.spec { list-style: none; margin: 1.2rem 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.spec li { display: grid; grid-template-columns: 11rem 1fr; gap: 14px; font-size: .9375rem; }
.spec b { font-weight: 600; font-size: .875rem; color: var(--muted); padding-top: 1px; }

/* --- Хронологія (про нас) ----------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 820px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 36px 46px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--paper); border: 3px solid var(--gold-ink);
}
.timeline b { display: block; margin-bottom: 4px; font-weight: 600; font-size: .875rem; color: var(--gold-ink); }
.timeline h3 { font: 500 1.375rem/1.25 var(--font-display); color: var(--ink); margin-bottom: .35em; }
.timeline p { color: var(--muted); max-width: 62ch; }

/* --- Обладнання й принципи ---------------------------------------------- */

.equip { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(24px, 3vw, 48px); }
.equip > div { padding: 20px 0 24px; border-top: 1px solid var(--line); }
.equip b { display: block; margin-bottom: 6px; font-weight: 600; font-size: 1rem; color: var(--ink); }
.equip span { font-size: .9375rem; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 40px); }
.fact { padding: 2px 0 2px 20px; border-left: 2px solid var(--gold-ink); }
.fact p { font-size: .9375rem; color: var(--muted); }

/* --- Питання ------------------------------------------------------------ */

.faq { max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative; cursor: pointer; list-style: none;
  padding: 20px 44px 20px 0; font-weight: 600; font-size: 1.125rem; text-wrap: balance;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { text-decoration: underline; text-underline-offset: .25em; }
.faq summary::after {
  content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font: 400 1.6rem/1 var(--font-text); color: var(--gold-ink);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { max-width: 62ch; padding: 0 44px 20px 0; color: var(--muted); animation: riseIn .35s var(--ease-out) both; }

/* --- 404 ---------------------------------------------------------------- */

.err-page { min-height: 62vh; display: grid; place-items: center; padding: 80px 24px; text-align: center; }
.err-page .code { font: 500 clamp(4rem, 14vw, 8rem)/1 var(--font-display); color: var(--ink); }
.err-page .lead { margin: 0 auto 28px; }
.err-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* --- Дрібниці ----------------------------------------------------------- */

.note-tbd { margin: 18px 0; padding: 14px 18px; font-size: .9375rem; color: #4d3f0a; background: #fbf6e3; border-left: 3px solid var(--gold-ink); border-radius: var(--r); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: var(--z-skip); padding: 10px 16px; background: #fff; color: var(--ink); border-radius: var(--r); }

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

@media (max-width: 1040px) {
  /* меню згортається раніше за решту: на 861–1040 px пункти й мови не вміщуються */
  .nav-toggle { display: block; }
  .site-header .wrap { position: relative; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 16px 16px; background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(19, 30, 51, .12);
  }
  .nav.open { display: flex; animation: riseIn .3s var(--ease-out) both; }
  .nav a { padding: 13px 6px; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .nav a[aria-current="page"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--gold-ink); padding-left: 12px; }
  .lang { border-left: 0; padding-left: 6px; margin: 10px 0 0; }
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .steps, .milestones { grid-template-columns: repeat(2, 1fr); }
  .equip { grid-template-columns: repeat(2, 1fr); }
  .hero-strip .wrap { grid-template-columns: repeat(2, 1fr); }
  .hero-strip .wrap > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero-strip .wrap > div:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .1); }
  .milestone { padding-bottom: 28px; }
}

@media (max-width: 860px) {
  body { font-size: 1rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: 2; min-height: 0; aspect-ratio: 8 / 9; }
  .hero-copy { max-width: none; }
  .claims, .form-grid, .facts { grid-template-columns: 1fr; }
  .claim:first-child { grid-row: auto; }
  .cards { grid-template-columns: 1fr; }
  .card:first-child { grid-row: auto; }
  .finish-grid { grid-template-columns: 1fr; }
  .finish-grid .finish img { aspect-ratio: 4 / 3; }
  .case { grid-template-columns: 1fr; grid-template-areas: "num" "unit" "title" "body"; }
  .case h3 { margin-top: 14px; }
  .clients { grid-template-columns: repeat(2, 1fr); }
  .catalog { grid-template-columns: 1fr; }
  .catalog .cat:first-child { grid-template-columns: 1fr; }
  .spec li { grid-template-columns: 1fr; gap: 2px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .topbar .spacer { margin-left: 0; }
  .mobile-cta { display: flex; }
  .site-footer { padding-bottom: 76px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; } .lb-close { top: 10px; right: 10px; }
}

@media (max-width: 560px) {
  .feats, .steps, .milestones, .equip, .clients, .hero-strip .wrap, .footer-grid { grid-template-columns: 1fr; }
  .hero-strip .wrap > div, .hero-strip .wrap > div + div { padding-left: 0; border-left: 0; }
  .hero-strip .wrap > div + div { border-top: 1px solid rgba(255, 255, 255, .1); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-actions .text-link { justify-content: center; }
  .card:not(:first-child) { grid-template-columns: 1fr; row-gap: 16px; }
  .card:not(:first-child) .card-img { aspect-ratio: 4 / 3; }
  /* таблиця накладів: рядки стовпчиком (ролі таблиці збережено в розмітці) */
  .runs, .runs thead, .runs tbody, .runs tr, .runs td { display: block; }
  .runs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .runs tr { padding: 14px 0; }
  .runs tr + tr { border-top: 1px solid var(--line); }
  .runs td { padding: 0; }
  .runs td:nth-child(2) { margin: 4px 0; font-size: 1.25rem; }
  .runs td:nth-child(3) { font-size: .9375rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; }
}

/* Keep long temporary contact addresses inside narrow layouts. */
.contact-list a, .site-footer a { overflow-wrap: anywhere; }
