:root {
  --blue: #2452bc;
  --navy: #17314e;
  --ink: #1d2936;
  --muted: #536371;
  --paper: #edf0f2;
  --white: #fff;
  --line: #cbd2d8;
  --rail-width: max(236px, 14.75rem);
  --gutter: clamp(24px, 3.8vw, 64px);
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
button, summary, input { font: inherit; }
button, summary { cursor: pointer; touch-action: manipulation; }
figure, h1, h2, h3, p { margin: 0; }
p, h1, h2, h3 { overflow-wrap: anywhere; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
::selection { background: var(--blue); color: var(--white); }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 18px; border: 1px solid var(--blue); background: var(--white); transform: translateY(-170%); }
.skip-link:focus { transform: translateY(0); }
main { min-width: 0; margin-right: var(--rail-width); }
.section { padding: 72px var(--gutter); border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.section-index { margin-bottom: 24px; color: var(--muted); font-family: var(--font); font-size: .75rem; line-height: 1.5; letter-spacing: .055em; text-transform: uppercase; }
.section-index > span { margin-right: 8px; color: var(--blue); }
h2 { font-size: clamp(2rem, 3.3vw, 3.5rem); font-weight: 650; line-height: 1.1; letter-spacing: -.02em; }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-bottom: 36px; }
.section-heading > p { max-width: 34em; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; padding: 3px 0 7px; border-bottom: 1px solid currentColor; color: var(--blue); font-size: .875rem; font-weight: 600; }
.text-link:hover { border-bottom-width: 3px; padding-bottom: 5px; }
.button { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; min-height: 48px; padding: 13px 24px; background: var(--blue); color: var(--white); font-size: .875rem; font-weight: 600; transition: background-color 160ms ease; }
.button:hover { background: #163d97; }

/* Правая панель: контакты закреплены над прокручиваемым меню. */
.navigation { position: fixed; z-index: 30; inset: 0 0 0 auto; width: var(--rail-width); height: 100vh; height: 100dvh; border-left: 1px solid rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5); box-shadow: -12px 0 36px rgba(23, 49, 78, .08); color: var(--navy); }
.site-menu { height: 100%; }
.menu-toggle, .menu-backdrop { display: none; }
.navigation-body { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 28px 24px 18px; overflow: hidden; }
.rail-header { flex-shrink: 0; }
.logo { display: block; width: 100%; background: transparent; }
.rail-brand { display: block; padding: 8px; background: transparent; }
.rail-brand--mark { display: none; }
.rail-caption { margin-top: 15px; color: var(--muted); font-family: var(--font); font-size: .75rem; line-height: 1.7; }
.rail-phone { display: block; margin-top: 18px; font-size: 1.125rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.rail-email { display: inline-block; margin-top: 7px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.navigation nav { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; margin-top: 24px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #a8b7c6 transparent; }
.navigation nav a { display: flex; flex-shrink: 0; gap: 12px; align-items: center; min-height: 48px; padding: 12px 0; border-bottom: 1px solid rgba(23, 49, 78, .12); color: var(--navy); font-size: .875rem; line-height: 1.45; }
.nav-number { flex-shrink: 0; color: var(--muted); font-family: var(--font); font-size: .75rem; }
.navigation nav a:hover, .navigation nav a[aria-current="location"], .navigation nav a.is-active { color: var(--blue); }
.navigation nav a[aria-current="location"], .navigation nav a.is-active { box-shadow: inset 0 -2px 0 var(--blue); }
.navigation nav a[aria-current="location"] .nav-number, .navigation nav a.is-active .nav-number { color: var(--blue); }
.navigation a:focus-visible { outline-color: var(--blue); outline-offset: 2px; }
.rail-bottom { display: flex; flex-shrink: 0; align-items: center; min-height: 44px; margin-top: 14px; color: var(--muted); font-family: var(--font); font-size: .75rem; }

/* Первый экран: фоновая фотография с осветлением под текстом. */
.hero-cover, .direction-hero { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; overflow: hidden; background: #c5cdd4; isolation: isolate; }
.hero-backdrop { position: absolute; z-index: -1; inset: 0; background-color: #c5cdd4; background-image: linear-gradient(#1d29360b 1px, transparent 1px), linear-gradient(90deg, #1d29360b 1px, transparent 1px); background-position: center; background-size: 48px 48px; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 36px; }
.brand { display: block; width: 206px; flex-shrink: 0; padding: 8px; background: transparent; }
.masthead > p { color: var(--muted); font-family: var(--font); font-size: .75rem; line-height: 1.7; text-align: right; }
.hero-cover { padding-top: 36px; padding-bottom: 28px; }
.hero-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; padding: 30px 0 54px; }
.hero-copy .section-index { margin-bottom: 24px; color: var(--ink); font-size: .875rem; }
h1 { max-width: 100%; font-size: clamp(2.75rem, 6.2vw, 5.625rem); font-weight: 700; line-height: 1.06; letter-spacing: -.02em; }
h1 span { display: block; }
h1 span:nth-child(2) { color: var(--blue); }
.hero-description { max-width: 570px; margin: 28px 0 24px; color: var(--ink); font-size: 1.125rem; line-height: 1.65; }
.hero-footer { display: flex; flex-wrap: wrap; gap: 12px 28px; padding-top: 20px; border-top: 1px solid #1d29362b; color: var(--muted); font-family: var(--font); font-size: .75rem; }
.hero-footer span { display: inline-flex; gap: 10px; align-items: center; }
.hero-footer span::before { width: 5px; height: 5px; background: var(--blue); content: ""; }

/* Подписанные заглушки фотографий. */
.media-slot { position: relative; display: flex; flex-direction: column; padding: 20px 24px 30px; overflow: hidden; background-color: #c5cdd4; background-image: linear-gradient(#1d293612 1px, transparent 1px), linear-gradient(90deg, #1d293612 1px, transparent 1px); background-position: center; background-size: 48px 48px; color: var(--ink); }
.slot-header { position: relative; display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 22px; font-family: var(--font); font-size: .75rem; text-transform: uppercase; }
.slot-header > span:last-child { font-size: 1.375rem; line-height: 1; }
.slot-frame { position: relative; flex: 1; min-height: 80px; margin: 20px 8px 0; border: 1px dashed #1d293640; }
.slot-frame::before, .slot-frame::after { position: absolute; top: 50%; left: 50%; background: #1d29364d; content: ""; transform: translate(-50%, -50%); }
.slot-frame::before { width: 28px; height: 1px; }
.slot-frame::after { width: 1px; height: 28px; }
.slot-caption { position: relative; display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 24px; }
.slot-caption > span { font-family: var(--font); font-size: .75rem; line-height: 1.5; }
.slot-caption > strong { font-size: 1.375rem; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; overflow-wrap: anywhere; }

/* Направления: фотографии и ссылки на HTML-страницы. */
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.work-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 280px; padding: 20px 24px 24px; overflow: hidden; background: #536678; color: var(--white); }
.work-card--wide { grid-column: span 2; }
.tile-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 240ms ease; }
.work-card:nth-child(3n + 2) .tile-photo { background-color: #455a6c; }
.work-card:nth-child(3n) .tile-photo { background-color: #586b79; }
.tile-photo::after { position: absolute; top: 78px; right: 28px; width: 38px; height: 38px; border: 1px solid #ffffff2e; content: ""; }
.photo-label { position: relative; align-self: flex-start; max-width: calc(100% - 54px); margin-top: 24px; color: #edf2f6; font-family: var(--font); font-size: .75rem; line-height: 1.55; overflow-wrap: anywhere; }
.card-top { position: relative; display: flex; justify-content: space-between; gap: 12px; align-items: center; font-family: var(--font); font-size: .75rem; }
.card-action { font-family: var(--font); font-size: .75rem; }
.card-title { position: relative; margin-top: auto; padding-top: 38px; font-size: clamp(1.375rem, 1.9vw, 1.875rem); font-weight: 600; line-height: 1.14; letter-spacing: -.02em; }
.work-card--wide .card-title { font-size: clamp(1.75rem, 2.65vw, 2.5rem); }
.work-card--accent .tile-photo { background-color: var(--blue); }
.work-card:hover .tile-photo, .work-card:focus-visible .tile-photo { transform: scale(1.035); }
.work-card:hover .card-action { text-decoration: underline; text-underline-offset: 4px; }

/* Пять компаний группы. */
.group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.group-card { display: flex; flex-direction: column; min-width: 0; min-height: 205px; padding: 26px; border: 1px solid var(--line); background: #f7f9fa; }

.group-card .section-index { margin-bottom: 20px; }
.group-card h3 { margin-bottom: 12px; font-size: clamp(1.5rem, 2.1vw, 2rem); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.group-card > p { color: var(--muted); }
.group-card .text-link { align-self: flex-start; margin-top: auto; padding-top: 18px; }

/* Производственная база. */
.production { border-bottom-color: var(--blue); background: var(--blue); color: var(--white); }
.production .section-index, .production .section-index > span, .production .section-heading > p { color: #e0e8fc; }
.production-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: stretch; }
.production-copy { display: flex; flex-direction: column; min-width: 0; padding-top: 10px; }
.production-location { margin-bottom: 30px; font-size: clamp(1.375rem, 2.2vw, 2rem); line-height: 1.35; letter-spacing: -.02em; }
.production-list { margin: 0; padding: 0; list-style: none; }
.production-list li { display: flex; gap: 18px; align-items: baseline; padding: 19px 0; border-top: 1px solid #ffffff4d; font-size: clamp(1.1875rem, 1.7vw, 1.5625rem); line-height: 1.35; }
.production-list li:last-child { border-bottom: 1px solid #ffffff4d; }
.production-list li > span { flex-shrink: 0; color: #e0e8fc; font-family: var(--font); font-size: .75rem; }
.production-list strong { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.production-photo { min-height: 390px; background-color: #bcc7d1; }

/* Один значимый проект, без вымышленных данных. */
.featured-project { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: stretch; }
.featured-photo { min-height: 400px; }
.featured-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.featured-copy h3 { margin-bottom: 28px; font-size: clamp(1.75rem, 2.8vw, 2.625rem); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.featured-copy dl { margin: 0; }
.featured-copy dl > div { padding: 20px 0; border-top: 1px solid var(--line); }
.featured-copy dt { color: var(--muted); font-family: var(--font); font-size: .75rem; }
.featured-copy dd { margin: 8px 0 0; font-size: 1.25rem; }

/* Галерея и список выполненных объектов. */
.gallery-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; }
.project { display: flex; flex-direction: column; min-width: 0; }
.project--main { grid-row: span 2; }
.gallery-image { flex: 1; min-height: 240px; }
.project--main .gallery-image { min-height: 530px; }
.gallery-image--light { background-color: #d4dbe0; }
.gallery-image--dark { background-color: #aab7c2; }
.project-caption { display: flex; flex-direction: column; gap: 8px; padding: 18px 0 22px; border-bottom: 1px solid var(--line); }
.project-caption h3 { font-size: 1rem; font-weight: 600; line-height: 1.45; }
.object-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.object-image { min-height: 260px; }
.object-card { min-width: 0; }
.object-card .project-caption h3 { font-size: 1.1875rem; line-height: 1.4; }
.clarification { padding: 30px; border: 1px solid var(--line); color: var(--muted); font-size: 1.125rem; }

/* Сравнение становится видимым только при двух загруженных снимках. */
.comparison { margin-top: 40px; }
.comparison-stage { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #c5cdd4; }
.comparison-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.comparison-before { clip-path: inset(0 calc(100% - var(--comparison-position, 50%)) 0 0); }
.comparison-divider { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--comparison-position, 50%); width: 2px; background: #fff; transform: translateX(-50%); pointer-events: none; }
.comparison-label { position: absolute; z-index: 3; top: 18px; padding: 6px 12px; background: var(--navy); color: #fff; font-size: .875rem; }
.comparison-label--before { left: 18px; }
.comparison-label--after { right: 18px; }
.comparison-controls { display: flex; gap: 20px; align-items: center; padding: 16px 0; }
.comparison-controls span { font-size: .875rem; }
.comparison-controls input { flex: 1; min-width: 0; min-height: 44px; margin: 0; accent-color: var(--blue); cursor: ew-resize; }
.comparison figcaption { color: var(--muted); font-size: .875rem; }

/* Компания и допуски. */
.company { background: #e3e8ec; }
.company-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; }
.company-grid > div { min-width: 0; }
.company h2 { color: var(--blue); font-size: clamp(2.25rem, 4vw, 4rem); line-height: 1.08; }
.company-signature { margin-top: 30px; color: var(--muted); font-family: var(--font); font-size: .75rem; line-height: 1.7; }
.company-facts { margin: 0 0 30px; padding: 0; list-style: none; }
.company-facts li { padding: 14px 0; border-bottom: 1px solid #bbc6cf; font-size: 1.0625rem; }
.format-list { margin: 0; }
.format-list > div { padding: 20px 0; border-top: 1px solid #bbc6cf; }
.format-list dt { margin-bottom: 5px; font-size: 1.25rem; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.format-list dd { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.admissions { margin-top: 44px; padding-top: 34px; border-top: 1px solid #bbc6cf; }
.admissions > h3 { margin-bottom: 24px; font-size: 1.75rem; font-weight: 600; }
.admissions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.admission { min-width: 0; }
.admission > h4 { margin: 0 0 14px; font-size: 1rem; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.admission p { color: var(--muted); font-size: .875rem; }
.admission-limit { display: block; margin-top: 8px; color: var(--ink); font-weight: 600; }

/* Контакты и место для Яндекс Карты. */
.contact-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-bottom: 42px; }
.contact-item { min-width: 0; padding-top: 22px; border-top: 2px solid var(--blue); }
.contact-label { margin-bottom: 12px; color: var(--muted); font-family: var(--font); font-size: .75rem; line-height: 1.5; }
.contact-value { color: var(--ink); font-size: clamp(1.3125rem, 2.2vw, 2rem); line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.contact-value:hover { color: var(--blue); }
.address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; font-style: normal; }
.address-card { min-width: 0; padding-top: 20px; border-top: 1px solid var(--line); }
.address-card > p:not(.contact-label) { max-width: 32em; font-size: 1rem; line-height: 1.7; }
.address-card .text-link { margin-top: 16px; }
.map-placeholder { min-height: 280px; margin-top: 34px; }
.map-placeholder .slot-caption > strong { font-size: 1.25rem; }

/* Страницы направлений используют тот же шаблон и общие стили. */
.direction-hero { min-height: 570px; padding-top: 36px; padding-bottom: 28px; }
.direction-hero .hero-copy { padding-bottom: 30px; }
.direction-hero h1 { max-width: 850px; font-size: clamp(2.25rem, 4.6vw, 4.5rem); line-height: 1.08; letter-spacing: -.02em; }
.direction-hero .hero-description { max-width: 650px; }
.back-link { display: inline-block; min-height: 44px; padding: 8px 0; margin-bottom: 18px; color: var(--blue); font-size: .875rem; border-bottom: 1px solid transparent; }
.back-link:hover { border-color: var(--blue); }
.other-directions .work-card { min-height: 250px; }
.other-directions .card-title { font-size: clamp(1.3125rem, 1.8vw, 1.6875rem); }

/* Подвал. */
.page-footer { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px var(--gutter); color: var(--muted); font-size: .75rem; line-height: 1.6; }
.footer-brand { display: block; width: 150px; padding: 6px; background: transparent; }
.footer-copy { min-width: 0; }
.workshop-credit { margin-top: 5px; font-size: .75rem; }

/* Тематические фотографии созданы с помощью ImageGen. */
[data-background="roof"] { --background-photo: url("../img/backgrounds/roof.webp"); }
[data-background="facade"] { --background-photo: url("../img/backgrounds/facade.webp"); }
[data-background="landscape"] { --background-photo: url("../img/backgrounds/landscape.webp"); }
[data-background="foundation"] { --background-photo: url("../img/backgrounds/foundation.webp"); }
[data-background="engineering"] { --background-photo: url("../img/backgrounds/engineering.webp"); }
[data-background="country"] { --background-photo: url("../img/backgrounds/country.webp"); }
[data-background="social"] { --background-photo: url("../img/backgrounds/social.webp"); }
[data-background="construction"] { --background-photo: url("../img/backgrounds/construction.webp"); }
[data-background="interior"] { --background-photo: url("../img/backgrounds/interior.webp"); }
[data-background="design"] { --background-photo: url("../img/backgrounds/design.webp"); }
.hero-backdrop[data-background] {
  background-image: linear-gradient(90deg, #edf0f2f5 0%, #edf0f2e6 55%, #edf0f280 83%, #edf0f21a 100%), linear-gradient(0deg, #edf0f2eb 0%, #edf0f200 28%), var(--background-photo);
  background-position: center, center, 62% center;
  background-size: cover;
  background-repeat: no-repeat;
}



.generated-visual { position: relative; overflow: hidden; isolation: isolate; background: #32495d; }
.generated-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.generated-visual > figcaption { position: absolute; inset: auto 0 0; display: flex; flex-direction: column; gap: 6px; padding: 50px 24px 22px; background: linear-gradient(transparent, #0b1f37ed); color: #fff; }
.generated-visual > figcaption span { font-family: var(--font); font-size: .75rem; }
.generated-visual > figcaption strong { font-size: 1.25rem; font-weight: 500; line-height: 1.35; }
@media (max-width: 760px) {
  .hero-backdrop[data-background] {
    background-image: linear-gradient(90deg, #edf0f2f0 0%, #edf0f2d6 100%), var(--background-photo);
    background-position: center, 62% center;
  }
}

@media (max-width: 1100px) {
  :root { --rail-width: max(210px, 13.125rem); }
  .navigation-body { padding: 22px 18px 16px; }
  .rail-phone { font-size: 1.0625rem; }
  .navigation nav a { gap: 10px; }
  .section-heading { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .section-heading > p { max-width: 42em; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-card--wide { grid-column: span 1; }
  .card-title, .work-card--wide .card-title { font-size: clamp(1.4375rem, 2.6vw, 1.8125rem); }
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  
  .production-grid, .featured-project { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .production-photo { min-height: 320px; }
  .featured-photo { min-height: 340px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project--main { grid-column: 1 / -1; grid-row: auto; }
  .project--main .gallery-image { min-height: 340px; }
  .company-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .admissions-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .page-footer { grid-template-columns: auto minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 760px) {
  :root { --gutter: 22px; }
  html { scroll-padding-top: 20px; }
  main { margin-right: 0; }
  .section { padding-top: 52px; padding-bottom: 52px; scroll-margin-top: 20px; }
  .hero-cover, .direction-hero { padding-top: 24px; padding-bottom: 26px; }
  .masthead { min-height: 48px; margin-bottom: 24px; padding-right: 112px; }
  .masthead > p { display: none; }
  .brand { width: min(150px, calc(100vw - 168px)); padding: 6px; }
  .hero-copy { padding: 28px 0 38px; }
  .hero-copy .section-index { margin-bottom: 20px; }
  h1 { font-size: clamp(1.9rem, 8.2vw, 3.875rem); line-height: 1.09; }
  .hero-description { margin-top: 24px; font-size: 1rem; }
    .hero-footer { gap: 10px 18px; }
  h2 { font-size: clamp(2rem, 6.2vw, 2.75rem); }
  .section-index { margin-bottom: 20px; }
  .section-heading { gap: 20px; margin-bottom: 28px; }
  .work-grid { gap: 12px; }
  .work-card { min-height: 300px; padding: 20px; }
  .card-title, .work-card--wide .card-title { font-size: 1.4375rem; }
  .photo-label { max-width: calc(100% - 38px); }
  .tile-photo::after { right: 20px; width: 26px; height: 26px; }
  .group-card { padding: 24px; }
  .production-grid, .featured-project { gap: 28px; }
  .production-location { margin-bottom: 24px; font-size: 1.5625rem; }
  .production-list li { padding: 18px 0; font-size: 1.375rem; }
  .production-photo { min-height: 300px; }
  .featured-photo { min-height: 300px; }
  .gallery-grid { gap: 22px 16px; }
  .gallery-image { min-height: 260px; }
  .project--main .gallery-image { min-height: 300px; }
  .media-slot { padding-right: 20px; padding-left: 20px; }
  .slot-caption > strong { font-size: 1.3125rem; }
  .company h2 { font-size: clamp(2.25rem, 7vw, 3.25rem); }
  .company-signature { margin-top: 24px; }
  .contact-main { gap: 24px; margin-bottom: 32px; }
  .contact-value { font-size: 1.375rem; }
  .address-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .object-grid { gap: 24px 18px; }
  .object-image { min-height: 250px; }
  .direction-hero { min-height: 520px; }
  .direction-hero h1 { font-size: clamp(2rem, 7vw, 3.25rem); }
  .comparison-controls { gap: 12px; }
  .page-footer { align-items: start; padding-top: 24px; padding-bottom: 24px; }
  .footer-brand { width: 120px; }
}

@media (max-width: 540px) {
  .group-grid, .gallery-grid, .object-grid, .contact-main { grid-template-columns: minmax(0, 1fr); }
  .project--main { grid-column: auto; }
  .work-card { min-height: 270px; }
  .card-title, .work-card--wide .card-title { font-size: 1.75rem; }
  .photo-label { max-width: calc(100% - 54px); }
  .tile-photo::after { width: 44px; height: 44px; }
  .project--main .gallery-image { min-height: 280px; }
  .gallery-image { min-height: 250px; }
  .page-footer { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 360px) {
  :root { --gutter: 18px; }
  .card-title, .work-card--wide .card-title { font-size: 1.5625rem; }
  .production-list li { gap: 14px; font-size: 1.25rem; }
  .company h2 { font-size: 2.125rem; }
}


/* Рамки и черновые разделы доступны только с class="preview" у body. */
body:not(.preview) .media-slot,
body:not(.preview) [data-preview-only] { display: none !important; }
body.preview section[data-preview-only][hidden] { display: block !important; }
body.preview .navigation a[data-preview-only][hidden] { display: flex !important; }
.section-index { font-family: var(--font); }
.section-index > span, .card-top > span:first-child { font-family: var(--mono); }
.rail-brand .logo { filter: none; }
.work-card { isolation: isolate; }
.work-card::before { position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, #0b1f3799 0%, #0b1f3726 40%, #0b1f37e0 100%); content: ""; pointer-events: none; }
.work-card--accent::before { background: linear-gradient(180deg, #143b8999 0%, #143b8933 40%, #123372e8 100%); }
.card-top, .card-title { z-index: 2; }
.group-grid { grid-auto-rows: 1fr; }
.group-card { min-height: 230px; }
.group-card:first-child { grid-column: auto; border-top: 3px solid var(--blue); }
.production { border-bottom-color: var(--line); background: #e3e8ec; color: var(--ink); }
.production .section-index, .production .section-heading > p { color: var(--muted); }
.production .section-index > span { color: var(--blue); }
.production-list li, .production-list li:last-child { border-color: #bbc6cf; }
.production-list li > span { color: var(--muted); }
.object-list { margin: 0; padding: 0; list-style: none; }
.object-item { padding: 22px 0; border-top: 1px solid var(--line); }
.object-item:last-child { border-bottom: 1px solid var(--line); }
.object-address { max-width: 50em; font-size: 1.125rem; line-height: 1.6; }
.preview .object-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.preview .object-item { min-width: 0; padding-top: 0; border-top: 0; border-bottom: 1px solid var(--line); }
.preview .object-address { margin-top: 18px; }
.company-facts { margin: 28px 0 0; }
.direction-formats > .format-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
@media (max-width: 760px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .work-card, .other-directions .work-card { min-height: 160px; padding: 12px; }
  .card-title, .work-card--wide .card-title, .other-directions .card-title { padding-top: 28px; font-size: 1rem; line-height: 1.2; }
  .card-top { gap: 8px; font-size: .625rem; }
  .card-action { font-size: .625rem; }
  .group-card { min-height: 190px; }
  .direction-formats > .format-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 540px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview .object-list { grid-template-columns: minmax(0, 1fr); }
  .card-title, .work-card--wide .card-title, .other-directions .card-title { font-size: .9375rem; }
}
@media (max-width: 360px) {
  .card-title, .work-card--wide .card-title, .other-directions .card-title { font-size: .875rem; }
}

@media (max-width: 760px) {
  .work-card--wide { grid-column: span 1; }
  .card-top .card-action { display: none; }
  .card-top::after { content: "↗"; font-family: var(--font); font-size: 1rem; line-height: 1; }
}


/* Доработка: активные карточки, крупнее первый экран, новые блоки компании и контактов. */
.hero-cover .hero-backdrop { transform: scale(1.1); transform-origin: 62% center; }

.group-card { transition: border-color 180ms ease, background-color 180ms ease; }
.group-number { margin-bottom: 20px; color: var(--muted); font-size: .75rem; }
.group-destination { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; margin-top: auto; padding-top: 28px; color: var(--blue); font-size: .875rem; font-weight: 600; }
.group-destination > span:first-child { text-decoration: underline; text-decoration-color: #2452bc66; text-underline-offset: 7px; }
.link-arrow { display: grid; flex-shrink: 0; place-items: center; width: 34px; height: 34px; border: 1px solid #2452bc4d; border-radius: 50%; font-size: 1.125rem; transition: background-color 180ms ease, color 180ms ease; }
a.group-card:hover, a.group-card:focus-visible { border-color: var(--blue); background: #fff; }
a.group-card:hover .link-arrow, a.group-card:focus-visible .link-arrow { background: var(--blue); color: #fff; }

.production-list li { display: block; padding: 0; }
.production-list li > a { display: flex; gap: 18px; align-items: baseline; min-height: 72px; padding: 20px 0; transition: color 180ms ease; }
.production-list li > a > span:first-child { flex-shrink: 0; color: var(--muted); font-size: .75rem; }
.production-list .production-arrow { flex-shrink: 0; color: var(--blue); font-size: 1.375rem; }
.production-list li > a:hover, .production-list li > a:focus-visible { color: var(--blue); }
.production-photo-link { display: block; min-width: 0; overflow: hidden; }
.production-photo-link .production-photo { height: 100%; }
.production-photo-link img { transition: transform 240ms ease; }
.production-photo-link:hover img, .production-photo-link:focus-visible img { transform: scale(1.025); }
.production-photo-link figcaption { flex-direction: row; justify-content: space-between; align-items: end; gap: 16px; }
.production-photo-link figcaption .visual-arrow { display: grid; flex-shrink: 0; place-items: center; width: 44px; height: 44px; border: 1px solid #ffffff70; border-radius: 50%; font-size: 1.5rem; }
[data-background="production"] { --background-photo: url("../img/backgrounds/production.webp"); }
.production-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }
.production-tabs a { display: inline-flex; gap: 18px; align-items: center; min-height: 48px; padding: 12px 16px; border: 1px solid #aab9c7; background: #edf0f2dd; font-size: .875rem; }
.production-tabs a span { color: var(--blue); font-size: 1.125rem; }
.production-tabs a:hover { border-color: var(--blue); background: #fff; }
.production-detail:nth-of-type(odd) { background: #e3e8ec; }
.production-detail-copy { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.production-detail-copy h2 { font-size: clamp(1.75rem, 3vw, 2.75rem); }
.production-detail-copy > p { max-width: 36em; color: var(--muted); }
.production-detail-photo { min-height: 320px; margin-top: 32px; }

.company { background: #e9edef; }
.company-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); }
.company h2 { max-width: 12em; color: var(--ink); font-size: clamp(2.25rem, 3.9vw, 4rem); }
.company h2 > span { display: block; margin-top: 8px; color: var(--blue); }
.company-facts { margin-top: 36px; }
.company-facts li { display: grid; grid-template-columns: minmax(70px, .28fr) minmax(0, 1fr); gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.company-facts li > span { padding-top: 3px; color: var(--muted); font-size: .75rem; }
.company-facts strong { font-size: 1.125rem; font-weight: 500; line-height: 1.5; }
.company-signature { margin-top: 24px; letter-spacing: .03em; }
.company-formats-label { margin-bottom: 16px; color: var(--muted); font-size: .75rem; letter-spacing: .055em; text-transform: uppercase; }
.company-formats .format-list { display: grid; gap: 12px; }
.company-formats .format-list > div { position: relative; min-height: 110px; padding: 24px 22px 24px 78px; border: 1px solid var(--line); background: #f8fafb; }
.company-formats .format-list dt { margin-bottom: 7px; font-size: 1.125rem; }
.format-mark { position: absolute; top: 28px; left: 26px; width: 28px; height: 28px; border: 2px solid var(--blue); }
.format-mark--part { border-style: dashed; }
.format-mark--part::after { position: absolute; inset: -2px auto auto -2px; width: 14px; height: 14px; background: var(--blue); content: ""; }
.format-mark--control { border-radius: 50%; }
.format-mark--control::after { position: absolute; top: 5px; left: 7px; width: 9px; height: 13px; border: solid var(--blue); border-width: 0 2px 2px 0; content: ""; transform: rotate(45deg); }
.admissions { margin-top: 36px; padding: 26px; border: 1px solid var(--line); background: #f8fafb; }
.admissions-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.sro-mark { padding: 5px 9px; border: 1px solid #2452bc50; color: var(--blue); font-size: .75rem; font-weight: 600; }
.admissions-heading h3 { font-size: 1.125rem; font-weight: 600; }
.admission > h4 { margin-bottom: 10px; }

.contacts { background: #f7f9fa; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: stretch; }
.contact-main { display: flex; flex-direction: column; gap: 30px; margin: 0; padding: clamp(24px, 3vw, 40px); background: var(--navy); color: #fff; }
.contact-item { padding: 0; border: 0; }
.contact-main .contact-label { margin-bottom: 14px; color: #b9cbdc; }
.contact-value { display: flex; gap: 14px; justify-content: space-between; align-items: baseline; color: #fff; font-size: clamp(1.375rem, 2.3vw, 2.1rem); }
.contact-value > span { flex-shrink: 0; color: #aac8ff; font-size: 1.125rem; }
.contact-value--email { font-size: clamp(1.0625rem, 1.65vw, 1.5rem); }
.contact-value:hover { color: #c9dcff; }
.contact-signature { margin-top: auto; padding-top: 40px; color: #b9cbdc; font-size: .75rem; letter-spacing: .08em; }
.address-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.address-card { padding: 24px 28px; border: 1px solid var(--line); background: #fff; }
.address-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.address-heading .contact-label { margin: 0; }
.address-mark { position: relative; display: block; flex-shrink: 0; width: 16px; height: 20px; border: 1.5px solid var(--blue); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.address-mark::after { position: absolute; top: 5px; left: 4px; width: 5px; height: 5px; border: 1px solid var(--blue); border-radius: 50%; content: ""; }
.address-card > p:not(.contact-label) { max-width: 40em; font-size: .9375rem; }
.address-card .text-link { gap: 18px; justify-content: space-between; margin-top: 12px; min-height: 44px; border: 0; }
.address-card .text-link > span { font-size: 1.125rem; }
.address-card .text-link:hover { padding-bottom: 7px; text-decoration: underline; text-underline-offset: 5px; }

@media (max-width: 1100px) {
  .company-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .company h2 { max-width: 16em; }
  .company h2 > span { display: inline; margin-top: 0; }
  .company-formats .format-list { grid-template-columns: minmax(0, 1fr); }
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .contact-main { gap: 28px; }
  .contact-value { max-width: 24em; font-size: 1.75rem; }
  .contact-value--email { font-size: 1.375rem; }
  .contact-signature { padding-top: 20px; }
  .production-detail-copy { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 760px) {
  .company h2 { font-size: clamp(2.125rem, 7vw, 3.25rem); }
  .company h2 > span { display: block; margin-top: 8px; }
  .company-facts { margin-top: 28px; }
  .company-facts li { grid-template-columns: 74px minmax(0, 1fr); gap: 14px; }
  .company-facts strong { font-size: 1rem; }
  .company-formats .format-list > div { min-height: 106px; padding: 22px 18px 22px 64px; }
  .format-mark { left: 20px; width: 24px; height: 24px; }
  .format-mark--control::after { top: 3px; left: 5px; }
  .admissions { padding: 22px; }
  .contact-layout { gap: 16px; }
  .contact-main { padding: 26px 22px; }
  .contact-value { font-size: 1.5rem; }
  .contact-value--email { font-size: 1.125rem; }
  .address-card { padding: 22px; }
  .production-list li > a { gap: 14px; padding: 18px 0; }
  .production-photo-link figcaption { padding: 44px 20px 20px; }
  .production-photo-link figcaption strong { font-size: 1.0625rem; }
  .production-detail-photo { min-height: 260px; }
}
@media print {
  .hero-cover .hero-backdrop { transform: none; }
  .contact-layout, .production-detail-copy { grid-template-columns: minmax(0, 1fr); }
  .contact-main { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

.production-photo-link figcaption strong { min-width: 0; overflow-wrap: anywhere; }
.company-facts strong, .group-destination > span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* Нумерация без пропусков: скрытые пункты и разделы не увеличивают счётчик.
   При включении body.preview номера автоматически учитывают галерею и проекты. */
.navigation nav { counter-reset: menu-section; }
.navigation nav > a { counter-increment: menu-section; }
.nav-number::before { content: counter(menu-section, decimal-leading-zero); }
main[data-numbered-sections] { counter-reset: page-section; }
main[data-numbered-sections] > section { counter-increment: page-section; }
main[data-numbered-sections] > section > .section-index > span::before {
  content: counter(page-section, decimal-leading-zero) " /";
}


/* ИП Нилов: главный кадр и два компактных фотоальбома. */
.nilov-hero { padding-top: 32px; padding-bottom: 48px; background: #e9eef2; }
.nilov-hero .back-link { margin-bottom: 28px; }
.nilov-hero-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr); gap: clamp(24px, 3vw, 48px); align-items: center; }
.nilov-copy { min-width: 0; }
.nilov-copy .section-index { margin-bottom: 20px; color: var(--blue); }
.nilov-copy h1 { font-size: clamp(2.5rem, 4.1vw, 4.75rem); }
.nilov-copy .hero-description { max-width: 23em; margin-top: 24px; font-size: 1rem; }
.nilov-cover { position: relative; min-width: 0; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 20px; background: #d6dde2; box-shadow: 0 16px 40px rgba(23, 49, 78, .1); }
.nilov-image-link { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: #d6dde2; }
.nilov-image-link img { width: 100%; height: 100%; object-fit: cover; object-position: center 58%; transition: transform 240ms ease; }
.nilov-image-link:hover img, .nilov-image-link:focus-visible img { transform: scale(1.045); }
.nilov-image-link:focus-visible { outline-offset: -4px; }
.nilov-cover .nilov-image-link img { object-position: center; }
.nilov-cover figcaption { position: absolute; inset: auto 0 0; display: flex; flex-direction: column; gap: 8px; padding: 64px 24px 22px; background: linear-gradient(transparent, rgba(12, 30, 49, .9)); color: #fff; pointer-events: none; }
.nilov-cover-kicker { font-size: .6875rem; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.nilov-cover figcaption strong { max-width: 26em; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.nilov-enlarge { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; background: rgba(23, 49, 78, .7); color: #fff; font-size: 1.25rem; transition: background-color 180ms ease; }
.nilov-image-link:hover .nilov-enlarge, .nilov-image-link:focus-visible .nilov-enlarge { background: var(--blue); }
.nilov-works { background: #f8fafb; }
.nilov-albums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.nilov-album { min-width: 0; padding: 20px; border: 1px solid #d8e0e6; border-radius: 20px; background: #fff; }
.nilov-album-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; min-height: 72px; padding-bottom: 20px; }
.nilov-album-header > div { min-width: 0; }
.nilov-album-number { display: block; margin-bottom: 7px; color: var(--blue); font-family: var(--mono); font-size: .6875rem; }
.nilov-album h3 { font-size: clamp(1.0625rem, 1.55vw, 1.375rem); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.nilov-album-count { flex-shrink: 0; margin-top: 3px; padding: 4px 8px; border-radius: 20px; background: #eef3f8; color: var(--muted); font-size: .6875rem; }
.nilov-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, clamp(88px, 7.2vw, 132px)); gap: 8px; }
.nilov-photo { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 10px; background: #d6dde2; }
.nilov-photo:first-child { grid-column: span 2; grid-row: span 2; }
.nilov-photo figcaption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nilov-photo-number { position: absolute; bottom: 9px; left: 9px; padding: 2px 6px; border-radius: 4px; background: rgba(23, 49, 78, .72); color: #fff; font-family: var(--mono); font-size: .625rem; }
.nilov-photo .nilov-enlarge { top: 7px; right: 7px; width: 24px; height: 24px; font-size: 1rem; }
.nilov-photo:first-child .nilov-enlarge { top: 12px; right: 12px; width: 34px; height: 34px; font-size: 1.25rem; }

/* Оригиналы открываются целиком; стрелки, клавиатура и свайп переключают кадры. */
.nilov-lightbox { position: fixed; inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 24px; border: 0; background: #0c1d31; color: #fff; overflow: hidden; }
.nilov-lightbox[open] { display: flex; flex-direction: column; gap: 16px; }
.nilov-lightbox:not([open]) { display: none; }
.nilov-lightbox::backdrop { background: rgba(12, 29, 49, .9); }
.nilov-lightbox-toolbar { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 24px; }
.nilov-lightbox-counter { color: #cad6e2; font-size: .875rem; }
.nilov-lightbox-close, .nilov-lightbox-arrow { display: grid; flex-shrink: 0; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #ffffff3d; border-radius: 50%; background: #ffffff0f; color: #fff; cursor: pointer; }
.nilov-lightbox-close { font-size: 2rem; line-height: 1; }
.nilov-lightbox-arrow { font-size: 1.5rem; }
.nilov-lightbox-close:hover, .nilov-lightbox-arrow:hover { background: #2452bc; }
.nilov-lightbox button:focus-visible { outline-color: #b3cbff; }
.nilov-lightbox-stage { position: relative; display: grid; flex: 1; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 24px; align-items: center; min-height: 0; touch-action: pan-y pinch-zoom; }
.nilov-lightbox-figure { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; height: 100%; }
.nilov-lightbox-frame { position: relative; flex: 1; min-height: 0; }
.nilov-lightbox-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.nilov-lightbox-figure figcaption { flex-shrink: 0; min-height: 24px; text-align: center; color: #e4ecf4; font-size: .9375rem; line-height: 1.5; }
html.photo-open { overflow: hidden; }
.photo-open body { position: fixed; top: var(--photo-scroll-offset, 0px); left: 0; width: 100%; overflow: hidden; }

@media (max-width: 1000px) {
  .nilov-hero-grid, .nilov-albums { grid-template-columns: minmax(0, 1fr); }
  .nilov-hero-grid { gap: 28px; }
  .nilov-copy .hero-description { max-width: 34em; }
  .nilov-cover { aspect-ratio: 16 / 9; }
  .nilov-gallery { grid-template-rows: repeat(2, clamp(88px, 14vw, 132px)); }
}
@media (max-width: 768px) {
  .nilov-hero { padding-top: 24px; padding-bottom: 32px; }
  .nilov-hero .back-link { margin-bottom: 20px; }
  .nilov-copy h1 { font-size: clamp(2.5rem, 10vw, 3.75rem); }
  .nilov-copy .hero-description { margin: 18px 0 22px; }
  .nilov-cover { border-radius: 16px; }
  .nilov-cover figcaption { gap: 6px; padding: 52px 18px 16px; }
  .nilov-cover figcaption strong { font-size: .875rem; }
  .nilov-cover-kicker { font-size: .5625rem; }
  .nilov-albums { gap: 18px; }
  .nilov-album { padding: 14px; border-radius: 16px; }
  .nilov-album-header { gap: 12px; min-height: 65px; padding-bottom: 16px; }
  .nilov-album h3 { font-size: 1.125rem; }
  .nilov-gallery { grid-template-rows: repeat(2, clamp(70px, 20vw, 96px)); gap: 6px; }
  .nilov-photo { border-radius: 7px; }
  .nilov-photo .nilov-enlarge { top: 5px; right: 5px; width: 22px; height: 22px; font-size: .875rem; }
  .nilov-photo-number { bottom: 5px; left: 5px; padding: 1px 4px; font-size: .5625rem; }
  .nilov-lightbox { padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); }
  .nilov-lightbox-stage { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .nilov-lightbox-arrow { position: absolute; z-index: 1; top: calc(50% - 24px); background: rgba(12, 29, 49, .8); }
  #nilov-lightbox-prev { left: 0; }
  #nilov-lightbox-next { right: 0; }
  .nilov-lightbox-figure figcaption { padding: 0 12px; font-size: .8125rem; }
}
@media print {
  .nilov-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .nilov-enlarge, .nilov-lightbox { display: none !important; }
  .nilov-album { break-inside: avoid; }
}

/* На планшетах сохраняется полный логотип в панели; подвал без дубля. */
@media screen and (min-width: 769px) {
  .masthead, .footer-brand { display: none; }
  .page-footer { grid-template-columns: minmax(0, 1fr); }
}

/* На ПК полный логотип возвращён на первый экран, в панели только знак. */
@media screen and (min-width: 1024px) {
  .masthead { display: flex; }
  .rail-brand--full { display: none; }
  .rail-brand--mark { display: block; width: 48px; height: 48px; padding: 0; }
  .rail-brand--mark .brand-mark { width: 48px; height: 48px; }
  .rail-phone { font-size: 18px; font-weight: 600; white-space: nowrap; }
}

/* Без JavaScript мобильное меню остаётся доступным в потоке страницы. */
@media screen and (max-width: 768px) {
  main { margin-right: 0; }
  .masthead { padding-right: 64px; }
  .navigation { position: static; width: 100%; height: auto; }
  .site-menu { height: auto; }
  .navigation-body { height: auto; padding: 24px; overflow: visible; }
  .navigation nav { flex: 0 0 auto; overflow: visible; }
  .rail-brand { width: min(160px, calc(100% - 52px)); padding: 0; }
  .rail-caption { margin-top: 12px; }
  .rail-phone { margin-top: 14px; font-size: 1.125rem; }
  .rail-email { margin-top: 5px; }
  .rail-bottom { margin-top: 12px; }

  .js-menu .menu-toggle {
    position: fixed;
    z-index: 50;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 4px 18px rgba(23, 49, 78, .12);
    color: var(--navy);
    transition: transform 240ms ease, opacity 240ms ease, background-color 180ms ease;
  }
  .menu-toggle:hover { background-color: rgba(255, 255, 255, .72); }
  .menu-toggle.is-scroll-hidden:not(:focus-visible) { transform: translateY(-80px); opacity: 0; pointer-events: none; }
  .menu-icon { position: relative; display: block; width: 20px; height: 16px; }
  .menu-bar { position: absolute; left: 0; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 240ms ease, opacity 160ms ease; }
  .menu-bar:nth-child(1) { top: 0; }
  .menu-bar:nth-child(2) { top: 7px; }
  .menu-bar:nth-child(3) { top: 14px; }
  .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .js-menu .menu-backdrop {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    background: rgba(23, 49, 78, .25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 280ms ease, visibility 0s linear 280ms;
  }
  .js-menu .navigation {
    position: fixed;
    z-index: 40;
    inset: 0 0 0 auto;
    width: 82%;
    max-width: 340px;
    height: 100vh;
    height: 100dvh;
    border-left: 1px solid rgba(255, 255, 255, .8);
    border-radius: 24px 0 0 24px;
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    backdrop-filter: blur(24px) saturate(1.5);
    box-shadow: -16px 0 48px rgba(23, 49, 78, .16);
    transform: translateX(calc(100% + 48px));
    visibility: hidden;
    transition: transform 280ms cubic-bezier(.22, .68, .2, 1), visibility 0s linear 280ms;
  }
  .js-menu .site-menu { height: 100%; }
  .js-menu .navigation-body { height: 100%; padding: 24px 24px max(20px, env(safe-area-inset-bottom)); overflow: hidden; }
  .js-menu .navigation nav { flex: 1 1 auto; margin-top: 22px; overflow-y: auto; overscroll-behavior: contain; }
  .menu-open .menu-backdrop { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .menu-open .navigation { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  .menu-open .menu-toggle { transform: none; opacity: 1; pointer-events: auto; }
  html.menu-open { overflow: hidden; }
  .menu-open body { position: fixed; top: var(--menu-scroll-offset, 0px); left: 0; width: 100%; overflow: hidden; }
}

/* На невысоком экране прокручивается вся панель, включая контакты. */
@media screen and (max-width: 768px) and (max-height: 480px) {
  .js-menu .navigation-body { overflow-y: auto; overscroll-behavior: contain; }
  .js-menu .navigation nav { flex: 0 0 auto; overflow: visible; }
}

@supports not (backdrop-filter: blur(1px)) {
  .navigation, .js-menu .navigation, .js-menu .menu-toggle, .js-menu .menu-toggle:hover { background: rgba(255, 255, 255, .96); }
}

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

@media print {
  .menu-shell, .navigation, .skip-link, .button, .comparison-controls { display: none !important; }
  main { margin-right: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { padding: 24px 0; break-inside: auto; }
  .hero-cover, .direction-hero { min-height: 0; }
  .section-heading, .production-grid, .featured-project, .company-grid { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 38pt; }
  h2, .company h2 { font-size: 26pt; }
  .work-card, .group-card, .object-card, .address-card { break-inside: avoid; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-card--wide { grid-column: span 1; }
  .work-card { min-height: 240px; }
  .card-title, .work-card--wide .card-title { font-size: 19pt; }
  .production, .company, .work-card, .media-slot, .hero-backdrop { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .page-footer { padding: 16px 0; }
}


/* Главная: фасад дома Бенуа в фирменной сине-серой гамме. */
[data-background="benois"] { --background-photo: url("../img/backgrounds/benois-hero.webp?v=20261012-reference"); }
.hero-cover .hero-backdrop[data-background="benois"] {
  overflow: hidden;
  background-image: linear-gradient(90deg, #edf0f2f5 0%, #edf0f2e6 55%, #edf0f280 83%, #edf0f21a 100%), linear-gradient(0deg, #edf0f2eb 0%, #edf0f200 28%), var(--background-photo);
  background-position: center, center, left center;
}
/* Чёткий фасад справа; поверх левой части — тот же кадр с размытием.
   Маска плавно убирает размытие к фотографии, без видимого стыка. */
.hero-cover .hero-backdrop[data-background="benois"]::after {
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-position: inherit;
  background-size: inherit;
  background-repeat: inherit;
  filter: blur(20px);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 32%, #000c 48%, #0000 76%);
  mask-image: linear-gradient(90deg, #000 0%, #000 32%, #000c 48%, #0000 76%);
  pointer-events: none;
  content: "";
}
@media (min-width: 769px) and (max-width: 1100px) {
  .hero-cover .hero-backdrop[data-background="benois"] { background-position: center, center, 25% center; }
}
.company-public-work {
  max-width: 30em;
  margin-top: 28px;
  padding: 18px 22px;
  border-left: 4px solid var(--blue);
  background: #f8fbff;
  color: var(--navy);
  font-size: clamp(1.125rem, 1.7vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
}
.image-credit { margin-top: 10px; font-size: .6875rem; line-height: 1.6; }
.image-credit a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 768px) {
  .hero-cover .hero-backdrop[data-background="benois"] {
    background-image: linear-gradient(90deg, #edf0f2f5 0%, #edf0f2e0 52%, #edf0f27a 100%), linear-gradient(0deg, #edf0f2eb 0%, #edf0f245 58%, #edf0f21a 100%), var(--background-photo);
    background-position: center, center, 50% center;
  }
  .hero-cover .hero-backdrop[data-background="benois"]::after {
    filter: blur(12px);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000b 38%, #0000 84%);
    mask-image: linear-gradient(90deg, #000 0%, #000b 38%, #0000 84%);
  }
  .company-public-work { margin-top: 24px; padding: 16px 18px; font-size: 1.125rem; }
}

/* Уведомление о техническом cookie: без блокировки страницы. */
.cookie-notice {
  position: fixed;
  z-index: 32;
  right: calc(var(--rail-width) + 24px);
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 24px;
  overflow-y: auto;
  border: 1px solid #d5dfe9;
  border-left: 4px solid var(--blue);
  border-radius: 16px;
  background: #f8fbff;
  box-shadow: 0 12px 40px rgba(23, 49, 78, .16);
  color: var(--navy);
}
.cookie-copy { flex: 1; min-width: 0; }
.cookie-copy h2 { margin-bottom: 8px; font-size: 1.125rem; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.cookie-copy p { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.cookie-policy { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; color: var(--blue); font-size: .8125rem; font-weight: 600; }
.cookie-policy:hover { text-decoration: underline; text-underline-offset: 4px; }
.cookie-dismiss { flex-shrink: 0; align-self: center; border: 0; border-radius: 8px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; margin-top: 8px; }
.footer-legal a, .cookie-open { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .75rem; }
.cookie-open { padding: 0; border: 0; background: transparent; }
.footer-legal a:hover, .cookie-open:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 768px) {
  .cookie-notice {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
    max-width: none;
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    padding: 18px;
  }
  .cookie-dismiss { align-self: stretch; }
}
@media print {
  .cookie-notice, .cookie-open { display: none !important; }
}

/* Политика: спокойная страница документа в фирменной сине-серой гамме. */
.policy-header { padding-top: 36px; padding-bottom: 48px; background: linear-gradient(135deg, #f8fbff, #e5ecf3); }
.policy-header .masthead { margin-bottom: 32px; }
.policy-back { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; margin-bottom: 24px; color: var(--blue); font-size: .875rem; font-weight: 600; }
.policy-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.policy-eyebrow { margin-bottom: 14px; color: var(--muted); font-size: .8125rem; letter-spacing: .04em; }
.policy-header h1 { max-width: 950px; color: var(--navy); font-size: clamp(2.25rem, 4.5vw, 3.75rem); line-height: 1.1; letter-spacing: -.02em; }
.policy-summary { max-width: 45em; margin-top: 20px; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; }
.policy-updated { margin-top: 24px; color: var(--muted); font-size: .8125rem; }
.policy-document { max-width: 1150px; margin: 0 auto; padding-top: 48px; padding-bottom: 16px; background: var(--white); }
.policy-section { margin-bottom: 36px; padding-bottom: 36px; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.policy-section:last-child { margin-bottom: 0; border-bottom: 0; }
.policy-section h2 { margin-bottom: 20px; font-size: clamp(1.375rem, 2vw, 1.75rem); line-height: 1.25; letter-spacing: -.02em; }
.policy-section p, .policy-section li { font-size: 1rem; line-height: 1.75; }
.policy-section p + p { margin-top: 16px; }
.policy-section ul { margin: 16px 0; padding-left: 24px; }
.policy-section li + li { margin-top: 12px; }
.policy-section li::marker { color: var(--blue); }
.policy-section a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.policy-section a:hover { text-decoration-thickness: 2px; }
.policy-section strong { font-weight: 600; }
.policy-section code { font-family: var(--font); font-size: .9375em; overflow-wrap: anywhere; }
.policy-operator { margin: 24px 0; padding: 20px 24px; border-left: 3px solid var(--blue); background: #f1f5f9; }
.policy-operator p + p { margin-top: 8px; }
.policy-storage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.policy-storage > div { min-width: 0; padding: 22px; border: 1px solid var(--line); background: #f8fafc; }
.policy-storage h3 { margin-bottom: 12px; color: var(--navy); font-size: 1.125rem; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.policy-storage p { font-size: .9375rem; line-height: 1.7; }
.policy-section .policy-law { margin-top: 24px; color: var(--muted); font-size: .8125rem; }
@media (max-width: 768px) {
  .policy-header { padding-top: 80px; padding-bottom: 32px; }
  .policy-back { margin-bottom: 20px; }
  .policy-header h1 { font-size: clamp(1.875rem, 7.5vw, 2.75rem); }
  .policy-summary { font-size: 1rem; }
  .policy-document { padding-top: 32px; }
  .policy-section { margin-bottom: 28px; padding-bottom: 28px; }
  .policy-section h2 { margin-bottom: 16px; }
  .policy-operator { padding: 18px; }
  .policy-storage { grid-template-columns: minmax(0, 1fr); }
  .policy-storage > div { padding: 18px; }
}
@media print {
  .policy-header, .policy-document { max-width: none; padding: 24px 0; background: #fff; }
  .policy-back, .policy-header .masthead { display: none !important; }
  .policy-header h1 { font-size: 26pt; }
  .policy-section h2 { font-size: 16pt; }
  .policy-section p, .policy-section li { font-size: 11pt; }
  .policy-section { margin-bottom: 20px; padding-bottom: 20px; }
  .policy-section h2, .policy-storage h3 { break-after: avoid; }
  .policy-operator, .policy-storage > div { break-inside: avoid; }
  .policy-storage { grid-template-columns: minmax(0, 1fr); }
}
