/* ==========================================================================
   Физмат · дизайн-система v2
   Единые токены: цвет, типографика, отступы, радиусы, границы, тени,
   движение, слои. Компоненты ниже используют только эти переменные.
   Подключается после styles.css / motion.css / enhancements.css.
   ========================================================================== */

:root {
  /* — Цвет: нейтральная шкала — */
  --c-black: #0a0a0a;
  --c-black-2: #141414;
  --c-black-3: #1c1c1c;
  --c-graphite: #2a2a2a;
  --c-steel: #5c5c5c;
  --c-gray-dark: #666666;   /* второстепенный текст на светлом, 5.7:1 на белом */
  --c-gray-light: #a0a0a0;  /* второстепенный текст на тёмном, 7.9:1 на #0a0a0a */
  --c-mist: #e6e6e6;
  --c-paper-2: #f5f5f5;
  --c-white: #ffffff;

  /* Семантические роли (светлая тема) */
  --paper: var(--c-white);
  --surface: var(--c-paper-2);
  --surface-light: #ededed;
  --raised: var(--c-white);
  --ink: var(--c-black);
  --ink-deep: var(--c-black);
  --muted: var(--c-gray-dark);
  --caption: #6e6e6e;
  --line: #e3e3e3;
  --line-dark: #303030;
  --divider: rgb(10 10 10 / 10%);
  --divider-strong: rgb(10 10 10 / 22%);
  --button-ink: var(--c-white);
  --focus: var(--c-black);
  --selection-bg: var(--c-black);
  --selection-ink: var(--c-white);
  /* Сцены, которые всегда тёмные (первый экран, тур) */
  --scene: var(--c-black);
  --scene-2: var(--c-black-2);
  --scene-3: var(--c-black-3);
  --scene-ink: #f5f5f5;
  --scene-muted: var(--c-gray-light);
  --scene-line: rgb(255 255 255 / 12%);
  --scene-line-strong: rgb(255 255 255 / 26%);

  /* — Типографика — */
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --fs-display: clamp(4.25rem, 2rem + 13.2vw, 15.5rem);
  --fs-h1: clamp(2.5rem, 1.6rem + 4vw, 7.5rem);
  --fs-h2: clamp(1.875rem, 1.25rem + 2.4vw, 4rem);
  --fs-h3: clamp(1.5rem, 1.2rem + 1vw, 2.5rem);
  --fs-card: clamp(1.25rem, 1.12rem + .45vw, 1.75rem);
  --fs-lead: clamp(1.0625rem, .98rem + .35vw, 1.3125rem);
  --fs-body: clamp(.96875rem, .94rem + .15vw, 1.0625rem);
  --fs-small: .875rem;
  --fs-micro: .8125rem;
  --fs-label: .75rem;
  --lh-tight: 1.02;
  --lh-heading: 1.1;
  --lh-body: 1.65;
  --ls-display: -.06em;
  --ls-heading: -.04em;
  --ls-label: .08em;
  --measure: 66ch;

  /* — Отступы: 4 · 8 · 12 · 16 · 24 · 32 · 48 · 64 · 80 · 96 · 128 — */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 80px;
  --space-10: 96px;
  --space-11: 128px;
  --section-gap: clamp(var(--space-8), 4vw + 2rem, var(--space-11));

  /* — Радиусы — */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --radius: var(--radius-sm);

  /* — Границы и тени — */
  --border: 1px;
  --border-strong: 1.5px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 5%), 0 2px 8px rgb(0 0 0 / 4%);
  --shadow-md: 0 8px 28px rgb(0 0 0 / 8%);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / 14%);
  --panel-shadow: var(--shadow-md);

  /* — Движение — */
  --dur-micro: 160ms;
  --dur-button: 200ms;
  --dur-tab: 260ms;
  --dur-card: 300ms;
  --dur-modal: 320ms;
  --dur-menu: 440ms;
  --dur-heading: 700ms;
  --dur-image: 900ms;
  --dur-scene: 760ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-emph: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease: var(--ease-out);
  --stagger: 60ms;

  /* — Слои — */
  --z-base: 1;
  --z-raised: 5;
  --z-sticky: 20;
  --z-header: 40;
  --z-launcher: 45;
  --z-overlay: 60;
  --z-modal: 80;
  --z-toast: 90;

  /* — Контейнеры — */
  --content-width: 1440px;
  --content-narrow: 960px;
  --page-pad: clamp(1.25rem, 4vw, 4rem);
  --header-h: 76px;
  --tap: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: var(--c-black);
  --surface: var(--c-black-2);
  --surface-light: var(--c-black-3);
  --raised: #1a1a1a;
  --ink: #f5f5f5;
  --ink-deep: #f5f5f5;
  --muted: var(--c-gray-light);
  --caption: #9a9a9a;
  --line: #262626;
  --line-dark: #5c5c5c;
  --divider: rgb(255 255 255 / 10%);
  --divider-strong: rgb(255 255 255 / 22%);
  --button-ink: var(--c-black);
  --focus: #f5f5f5;
  --selection-bg: #f5f5f5;
  --selection-ink: var(--c-black);
  --scene: #050505;
  --scene-2: #101010;
  --scene-3: #181818;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-md: 0 10px 32px rgb(0 0 0 / 45%);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / 60%);
  --panel-shadow: var(--shadow-md);
}

@media (max-width: 860px) { :root { --header-h: 64px; } }

/* ---------- Основа ---------- */
html { scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--font); font-size: var(--fs-body); line-height: var(--lh-body); background: var(--paper); color: var(--ink); overflow-x: clip; font-feature-settings: "ss01" 0; text-rendering: optimizeLegibility; }
main { overflow-x: clip; }
h1, h2, h3, h4 { letter-spacing: var(--ls-heading); line-height: var(--lh-heading); font-weight: 600; text-wrap: balance; }
p, li { text-wrap: pretty; }
::selection { background: var(--selection-bg); color: var(--selection-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.is-scene :focus-visible, .hero-v2 :focus-visible, .tour-section :focus-visible, .site-footer :focus-visible, .lightbox :focus-visible { outline-color: #f5f5f5; }
a { text-decoration-thickness: 1px; text-underline-offset: .22em; transition: text-decoration-color var(--dur-micro) ease, opacity var(--dur-micro) ease; }
img { height: auto; }
.icon { width: 20px; height: 20px; stroke-width: 1.6; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* Скроллбар — тонкий, нейтральный */
html { scrollbar-color: color-mix(in srgb, var(--ink) 28%, transparent) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 24%, transparent); border: 3px solid var(--paper); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.page-width { width: min(100% - var(--page-pad) * 2, var(--content-width)); }
.eyebrow { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; opacity: .6; }
.section-index { font-variant-numeric: tabular-nums; }

/* ---------- Кнопки ---------- */
.btn, .button { --btn-bg: transparent; --btn-ink: var(--ink); --btn-border: var(--divider-strong); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px; border: var(--border) solid var(--btn-border); border-radius: var(--radius-sm); background: var(--btn-bg); color: var(--btn-ink); font: 600 .9375rem/1.2 var(--font); letter-spacing: -.005em; text-decoration: none; white-space: nowrap; cursor: pointer; overflow: hidden; isolation: isolate; transition: background-color var(--dur-button) var(--ease-out), color var(--dur-button) var(--ease-out), border-color var(--dur-button) var(--ease-out), transform var(--dur-button) var(--ease-out), box-shadow var(--dur-button) var(--ease-out), opacity var(--dur-button) ease; translate: none; -webkit-tap-highlight-color: transparent; }
.btn .icon, .button .icon { width: 18px; height: 18px; transition: transform var(--dur-button) var(--ease-out); }
.btn-primary, .button-primary { --btn-bg: var(--ink); --btn-ink: var(--paper); --btn-border: var(--ink); }
.btn-secondary { --btn-bg: var(--surface); --btn-ink: var(--ink); --btn-border: var(--surface); }
.btn-outline, .button-quiet { --btn-bg: transparent; --btn-ink: var(--ink); --btn-border: var(--divider-strong); }
.btn-ghost { --btn-bg: transparent; --btn-ink: var(--ink); --btn-border: transparent; padding-inline: 12px; }
.btn-icon { width: var(--tap); min-width: var(--tap); height: var(--tap); min-height: var(--tap); padding: 0; border-radius: var(--radius-sm); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: .875rem; }
.btn-block { width: 100%; }
/* Сценические кнопки (на тёмном) */
.on-scene .btn-primary, .hero-v2 .btn-primary { --btn-bg: #f5f5f5; --btn-ink: var(--c-black); --btn-border: #f5f5f5; }
.on-scene .btn-outline, .hero-v2 .btn-outline { --btn-ink: #f5f5f5; --btn-border: var(--scene-line-strong); }
.on-scene .btn-ghost, .hero-v2 .btn-ghost { --btn-ink: #f5f5f5; }
@media (hover: hover) {
  .btn-primary:hover, .button-primary:hover { --btn-bg: color-mix(in srgb, var(--ink) 84%, var(--paper)); opacity: 1; }
  .btn-outline:hover, .button-quiet:hover { --btn-bg: color-mix(in srgb, var(--ink) 6%, transparent); --btn-border: var(--ink); }
  .btn-secondary:hover { --btn-bg: var(--surface-light); --btn-border: var(--surface-light); }
  .btn-ghost:hover { --btn-bg: color-mix(in srgb, var(--ink) 7%, transparent); }
  .on-scene .btn-primary:hover, .hero-v2 .btn-primary:hover { --btn-bg: #ffffff; }
  .on-scene .btn-outline:hover, .hero-v2 .btn-outline:hover { --btn-bg: rgb(255 255 255 / 8%); --btn-border: #f5f5f5; }
  .on-scene .btn-ghost:hover, .hero-v2 .btn-ghost:hover { --btn-bg: rgb(255 255 255 / 8%); }
  .btn:hover .icon-arrow, .button:hover .icon-arrow { transform: translateX(3px); }
  .btn:hover .icon-arrow-ne { transform: translate(2px, -2px); }
}
.btn:active:not(:disabled), .button:active:not(:disabled) { transform: scale(.975); transition-duration: 80ms; }
.btn:disabled, .btn[aria-disabled="true"], .button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--btn-ink); border-right-color: transparent; animation: fz-spin 700ms linear infinite; }
@keyframes fz-spin { to { rotate: 360deg; } }

/* Текстовая ссылка со стрелкой */
.link-arrow { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-weight: 600; font-size: .9375rem; text-decoration: none; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.link-arrow .icon { width: 18px; height: 18px; transition: transform var(--dur-button) var(--ease-out); }
.link-arrow span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--dur-card) var(--ease-out); padding-bottom: 2px; }
@media (hover: hover) { .link-arrow:hover span { background-size: 100% 1px; } .link-arrow:hover .icon { transform: translateX(3px); } }

/* ---------- Чипы, сегменты, вкладки ---------- */
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: var(--border) solid var(--divider-strong); border-radius: var(--radius-pill); background: transparent; color: var(--ink); font-size: .875rem; font-weight: 500; line-height: 1.3; text-align: left; transition: background-color var(--dur-micro) ease, border-color var(--dur-micro) ease, color var(--dur-micro) ease, transform var(--dur-micro) var(--ease-out); }
@media (hover: hover) { .chip:hover { border-color: var(--ink); } }
.chip[aria-pressed="true"], .chip.is-selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .icon { width: 16px; height: 16px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: var(--border) solid var(--divider-strong); border-radius: var(--radius-xs); font-size: var(--fs-label); font-weight: 600; letter-spacing: .02em; color: var(--muted); white-space: nowrap; }
.tag-solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tabs { position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--radius-md); background: var(--surface); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"], .tabs button { position: relative; z-index: 1; min-height: 40px; padding: 8px 16px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font: 600 .875rem/1.2 var(--font); white-space: nowrap; transition: color var(--dur-tab) var(--ease-out); }
.tabs [aria-selected="true"], .tabs [aria-pressed="true"] { color: var(--ink); }
.tabs-indicator { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: var(--radius-sm); background: var(--paper); box-shadow: var(--shadow-sm); transition: transform var(--dur-tab) var(--ease-out), width var(--dur-tab) var(--ease-out); pointer-events: none; }
html[data-theme="dark"] .tabs-indicator { background: var(--surface-light); }

/* ---------- Поля ввода ---------- */
.field { display: grid; gap: 8px; font-size: var(--fs-micro); font-weight: 600; color: var(--ink); }
.field-hint { font-weight: 400; color: var(--muted); }
.input, #ege-calculator input, #ege-calculator select, .map-search-row input, .tour-controls select { min-height: 48px; padding: 12px 14px; border: var(--border) solid var(--divider-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font: 500 1rem/1.3 var(--font); transition: border-color var(--dur-micro) ease, box-shadow var(--dur-micro) ease, background-color var(--dur-micro) ease; appearance: none; -webkit-appearance: none; }
#ege-calculator select, .tour-controls select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.input:hover, #ege-calculator input:hover, #ege-calculator select:hover, .map-search-row input:hover { border-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.input:focus, #ege-calculator input:focus, #ege-calculator select:focus, .map-search-row input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
#ege-calculator input:user-invalid { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
#ege-calculator input.is-valid { border-color: color-mix(in srgb, var(--ink) 55%, transparent); }
.input::placeholder, input::placeholder { color: var(--muted); opacity: 1; }
.field-error { font-weight: 500; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.field-error::before { content: "!"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700; }

/* ---------- Фото: единая система ---------- */
.photo { position: relative; display: block; margin: 0; overflow: hidden; background: var(--surface-light); isolation: isolate; }
.photo picture, .photo img { display: block; width: 100%; height: 100%; }
.photo img { object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 700ms var(--ease-out), transform var(--dur-image) var(--ease-out), filter 700ms ease; }
.photo.is-loaded img { opacity: 1; transform: scale(var(--photo-zoom, 1)) translate3d(0, var(--photo-parallax, 0px), 0); }
html:not(.js) .photo img { opacity: 1; transform: none; }
.photo-ratio-wide { aspect-ratio: 16 / 9; }
.photo-ratio-land { aspect-ratio: 3 / 2; }
.photo-ratio-portrait { aspect-ratio: 4 / 5; }
.photo-ratio-square { aspect-ratio: 1; }
.photo-rounded { border-radius: var(--radius-md); }
/* Маска раскрытия при появлении */
.js .photo[data-reveal-mask] { clip-path: inset(0 0 100% 0); transition: clip-path var(--dur-image) var(--ease-emph); }
.js .photo[data-reveal-mask].is-revealed { clip-path: inset(0 0 0 0); }
.js .photo[data-reveal-mask="left"] { clip-path: inset(0 100% 0 0); }
.js .photo[data-reveal-mask="left"].is-revealed { clip-path: inset(0); }
/* Скелетон, пока грузится */
.photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--paper) 55%, transparent) 50%, transparent 70%) var(--surface-light); background-size: 220% 100%; animation: fz-shimmer 1.4s linear infinite; }
.photo.is-loaded::before, .photo.is-error::before { animation: none; background: var(--surface-light); }
@keyframes fz-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
/* Ошибка загрузки */
.photo-error { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; color: var(--muted); font-size: var(--fs-micro); }
.photo-error .icon { width: 28px; height: 28px; }
.photo.is-error .photo-error { display: grid; }
.photo.is-error img { visibility: hidden; }
/* Открытие в просмотрщике */
.photo-zoom { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.photo-zoom-hint { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgb(10 10 10 / 62%); color: #fff; opacity: 0; transform: translateY(6px); transition: opacity var(--dur-card) var(--ease-out), transform var(--dur-card) var(--ease-out); pointer-events: none; backdrop-filter: blur(6px); }
.photo-zoom-hint .icon { width: 18px; height: 18px; }
@media (hover: hover) {
  .photo:hover img { --photo-zoom: 1.035; }
  .photo:hover .photo-zoom-hint, .photo-zoom:focus-visible + .photo-zoom-hint { opacity: 1; transform: none; }
}
@media (hover: none) { .photo-zoom-hint { opacity: 1; transform: none; width: 34px; height: 34px; } }
.photo-caption { margin-top: 12px; font-size: var(--fs-label); line-height: 1.55; color: var(--muted); }
.photo-caption a { color: inherit; }

/* Заглушка: фото ожидается */
.photo-placeholder { position: relative; display: grid; align-content: end; gap: 8px; min-height: 220px; padding: 20px; overflow: hidden; border: var(--border) dashed var(--divider-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--muted); font-size: var(--fs-micro); line-height: 1.5; }
.photo-placeholder strong { display: block; color: var(--ink); font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; }
.photo-placeholder svg.placeholder-art { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); opacity: .14; pointer-events: none; }
.photo-placeholder > :not(svg) { position: relative; }

/* ---------- Просмотрщик фотографий ---------- */
.lightbox { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; grid-template-rows: auto 1fr auto; background: rgb(5 5 5 / 96%); color: #f5f5f5; opacity: 0; visibility: hidden; transition: opacity var(--dur-modal) var(--ease-out), visibility 0s linear var(--dur-modal); touch-action: none; }
.lightbox.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(12px + var(--safe-top)) clamp(12px, 3vw, 32px) 12px; font-size: var(--fs-micro); color: var(--scene-muted); }
.lightbox-counter { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.lightbox-counter b { color: #f5f5f5; font-weight: 600; }
.lightbox-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; }
.lightbox-figure { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 0 clamp(8px, 7vw, 96px); transition: transform var(--dur-scene) var(--ease-emph), opacity var(--dur-modal) ease; }
.lightbox-figure img { width: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; user-select: none; -webkit-user-drag: none; }
.lightbox-figure.is-entering-next { transform: translateX(8%); opacity: 0; }
.lightbox-figure.is-entering-prev { transform: translateX(-8%); opacity: 0; }
.lightbox-figure.is-leaving-next { transform: translateX(-8%); opacity: 0; }
.lightbox-figure.is-leaving-prev { transform: translateX(8%); opacity: 0; }
.lightbox-nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 52px; height: 52px; margin-top: -26px; border: 1px solid var(--scene-line-strong); border-radius: 50%; background: rgb(10 10 10 / 50%); color: #f5f5f5; transition: background-color var(--dur-micro) ease, border-color var(--dur-micro) ease, transform var(--dur-micro) var(--ease-out); }
.lightbox-nav:hover { background: rgb(255 255 255 / 10%); border-color: #f5f5f5; }
.lightbox-prev { left: clamp(8px, 2vw, 28px); }
.lightbox-next { right: clamp(8px, 2vw, 28px); }
.lightbox-close { width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 1px solid var(--scene-line-strong); border-radius: 50%; background: transparent; color: #f5f5f5; }
.lightbox-close:hover { background: rgb(255 255 255 / 10%); }
.lightbox-caption { padding: 14px clamp(16px, 7vw, 96px) calc(18px + var(--safe-bottom)); max-width: 90ch; margin-inline: auto; text-align: center; font-size: var(--fs-micro); line-height: 1.6; color: var(--scene-muted); }
.lightbox-caption strong { display: block; color: #f5f5f5; font-size: .9375rem; font-weight: 600; margin-bottom: 4px; }
.lightbox-caption a { color: inherit; }
@media (max-width: 600px) { .lightbox-nav { width: 44px; height: 44px; margin-top: -22px; top: auto; bottom: 12px; } .lightbox-stage { padding-bottom: 64px; } .lightbox-prev { left: calc(50% - 56px); } .lightbox-next { right: calc(50% - 56px); } }

/* ---------- Модальные окна и нижние панели ---------- */
.fz-dialog { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; align-items: end; justify-items: end; visibility: hidden; pointer-events: none; }
.fz-dialog.is-open { visibility: visible; pointer-events: auto; }
.fz-dialog-backdrop { position: absolute; inset: 0; background: rgb(5 5 5 / 52%); opacity: 0; transition: opacity var(--dur-modal) var(--ease-out); }
.fz-dialog.is-open .fz-dialog-backdrop { opacity: 1; }
.fz-dialog-panel { position: relative; width: min(760px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform var(--dur-scene) var(--ease-emph); }
.fz-dialog.is-open .fz-dialog-panel { transform: none; }
.fz-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(20px, 4vw, 40px); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--divider); }
.fz-dialog-body { padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 40px) calc(48px + var(--safe-bottom)); }
@media (max-width: 760px) {
  .fz-dialog { align-items: end; justify-items: stretch; }
  .fz-dialog-panel { height: auto; max-height: calc(100dvh - 24px); border-radius: var(--radius-xl) var(--radius-xl) 0 0; transform: translateY(100%); }
  .fz-dialog-panel::before { content: ""; display: block; width: 40px; height: 4px; margin: 10px auto 0; border-radius: 4px; background: var(--divider-strong); }
}
body.is-locked { overflow: hidden; }

/* ---------- Состояния ---------- */
.skeleton { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-light); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--paper) 55%, transparent) 50%, transparent 70%); background-size: 220% 100%; animation: fz-shimmer 1.4s linear infinite; }
.state { display: grid; justify-items: start; gap: 10px; padding: 24px; border: 1px solid var(--divider); border-radius: var(--radius-md); background: var(--surface); color: var(--muted); font-size: var(--fs-small); }
.state strong { color: var(--ink); font-size: 1rem; font-weight: 600; }
.state-scene { background: rgb(255 255 255 / 4%); border-color: var(--scene-line); color: var(--scene-muted); }
.state-scene strong { color: #f5f5f5; }
.notice-demo { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid currentColor; border-radius: var(--radius-pill); font-size: var(--fs-label); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.notice-demo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: fz-blink 2.4s ease-in-out infinite; }
@keyframes fz-blink { 50% { opacity: .25; } }

/* ---------- Фирменная графика ---------- */
.fz-mark { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.fz-graphic { fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fz-graphic .g-faint { opacity: .18; }
.fz-graphic .g-soft { opacity: .4; }
.fz-graphic .g-strong { stroke-width: 1.6; }
.fz-graphic .g-dot { fill: currentColor; stroke: none; }
.fz-graphic text { fill: currentColor; stroke: none; font: 500 11px/1 var(--font); letter-spacing: .04em; }
.js .fz-draw [data-draw] { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .fz-draw.is-drawn [data-draw] { stroke-dashoffset: 0; transition: stroke-dashoffset 1400ms var(--ease-in-out); transition-delay: calc(var(--d, 0) * 1ms); }

/* ---------- Появление контента ---------- */
.js [data-animate] { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity var(--dur-heading) var(--ease-out), transform var(--dur-heading) var(--ease-out); transition-delay: calc(var(--i, 0) * var(--stagger)); }
.js [data-animate].is-in { opacity: 1; transform: none; }
.js [data-animate="fade"] { transform: none; }
.js [data-animate="line"] { transform: scaleX(0); transform-origin: left; opacity: 1; transition-property: transform; transition-duration: 1000ms; }
.js [data-animate="line"].is-in { transform: scaleX(1); }
/* Маска для заголовков: строки поднимаются из-под края */
.line-mask { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line-mask > span { display: block; }
.js [data-split].is-armed .line-mask > span { transform: translate3d(0, 105%, 0); }
.js [data-split].is-in .line-mask > span { transform: none; transition: transform var(--dur-heading) var(--ease-emph); transition-delay: calc(var(--line, 0) * 90ms); }

/* Числа */
.odometer { display: inline-flex; overflow: hidden; height: 1em; line-height: 1; font-variant-numeric: tabular-nums; vertical-align: top; }
.odometer-digit { display: inline-block; height: 1em; overflow: hidden; }
.odometer-reel { display: flex; flex-direction: column; transform: translateY(calc(var(--n, 0) * -10%)); transition: transform 1100ms var(--ease-emph); transition-delay: calc(var(--k, 0) * 70ms); }
.odometer-reel span { display: block; height: 1em; line-height: 1; }

/* ---------- Уменьшенное движение и пауза ---------- */
@media (prefers-reduced-motion: reduce) {
  .js [data-animate], .js [data-split].is-armed .line-mask > span, .photo img, .js .photo[data-reveal-mask] { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
  .js .fz-draw [data-draw] { stroke-dashoffset: 0 !important; transition: none !important; }
  .odometer-reel { transition: none !important; }
  .photo::before, .skeleton::after { animation: none !important; }
}
.motion-paused [data-animate], .motion-paused [data-split] .line-mask > span, .motion-paused .photo img, .motion-paused .photo[data-reveal-mask] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
.motion-paused .fz-draw [data-draw] { stroke-dashoffset: 0 !important; }
.motion-paused .odometer-reel { transition: none !important; }
