/* ══════════════════════════════════════════════════════════
   Усадьба Пущино-на-Наре — стиль страницы объекта
   Тёмный вход (кадр), светлый корпус (чтение), тёмные врезки.
   Шрифты только системные: страница обязана открываться без сети.
   ══════════════════════════════════════════════════════════ */

:root {
  --ink:        #17130F;   /* текст на бумаге */
  --ink-soft:   #4A423A;
  --paper:      #F6F3EE;
  --paper-warm: #EFEAE1;
  --night:      #12100E;   /* тёмные секции */
  --night-2:    #1B1815;
  --light:      #F4EFE7;   /* текст на тёмном */
  --light-soft: #C3B9AC;
  --bronze:     #7A5A2E;   /* акцент на светлом */
  --bronze-lt:  #C9A876;   /* акцент на тёмном */
  --line:       rgba(23,19,15,.14);
  --line-dark:  rgba(244,239,231,.16);

  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* Кривые: встроенные ease слишком вялые для этой подачи */
  --out: cubic-bezier(.23, 1, .32, 1);
  --inout: cubic-bezier(.77, 0, .175, 1);

  --wrap: 1180px;
  --gut: clamp(20px, 5vw, 64px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* <picture> по умолчанию строчный: без явной высоты у него height:100%
   у картинки не разрешается, и кадр схлопывается в свою пропорцию.
   На широком экране это незаметно, на телефоне — чёрная пустота под фото. */
.hero__media picture,
.shot picture { height: 100%; }

::selection { background: rgba(122,90,46,.22); }

/* ── Плашка черновика ───────────────────────────────────── */
.draft-bar {
  position: relative;
  z-index: 40;
  background: #241E17;
  color: #E8DFD1;
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-align: center;
  padding: 9px 16px;
}

/* ── Общая раскладка ────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.wrap--narrow { max-width: 760px; }

.section { padding: clamp(72px, 11vw, 140px) 0; }
.section--paper { background: var(--paper); color: var(--ink); }
.section--dark  { background: var(--night); color: var(--light); }

/* ── Типографика: трекинг и интерлиньяж зависят от кегля ── */
.eyebrow {
  margin: 0 0 22px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 600;
}
.section--dark .eyebrow { color: #C9A876; }

.h2 {
  margin: 0 0 clamp(28px, 4vw, 48px);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -.018em;
}

.lede {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 27px);
  line-height: 1.42;
  letter-spacing: -.008em;
}
.lede--tight { max-width: 760px; }

.body { margin: 0 0 20px; max-width: 68ch; color: var(--ink-soft); }
.section--dark .body { color: var(--light-soft); }
.body strong { color: var(--ink); font-weight: 600; }
.section--dark .body strong { color: var(--light); font-weight: 600; }

.note {
  margin: 26px 0 0;
  max-width: 66ch;
  font-size: 14px;
  line-height: 1.55;
  color: #6B6157;
  border-left: 2px solid var(--line);
  padding-left: 16px;
}
.section--dark .note { color: #A9A093; border-left-color: var(--line-dark); }
.note--center { border: 0; padding: 0; text-align: center; max-width: none; }

/* ── Кнопки ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 2px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn--light { background: var(--light); color: #16120E; }
.btn--dark  { background: #16120E; color: var(--light); }
.btn--ghost { border-color: rgba(244,239,231,.42); color: var(--light); }
.section--paper .btn--ghost { border-color: rgba(23,19,15,.32); color: var(--ink); }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--lg { padding: 16px 32px; font-size: 16px; }

@media (hover: hover) and (pointer: fine) {
  .btn--light:hover { background: #fff; }
  .btn--dark:hover  { background: #241E17; }
  .btn--ghost:hover { border-color: rgba(244,239,231,.85); background: rgba(244,239,231,.07); }
  .section--paper .btn--ghost:hover { border-color: var(--ink); background: rgba(23,19,15,.05); }
}

:focus-visible { outline: 2px solid #C9A876; outline-offset: 3px; }

/* ══ ПЕРВЫЙ ЭКРАН ═══════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
  background: #0B0908;
  overflow: hidden;
}

.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 46%;
  /* Медленный наезд: кадр дышит, но движение на грани заметности */
  animation: heroDrift 26s var(--inout) forwards;
}
/* На узком экране кадр режется по бокам — сдвигаем к дому, иначе он уходит
   в тёмный правый край и первый экран остаётся без главного героя. */
@media (max-width: 620px) {
  .hero__media img { object-position: 62% 40%; }
}
@keyframes heroDrift {
  from { transform: scale(1.005); }
  to   { transform: scale(1.065); }
}

/* Затемнение снизу — без него светлый текст на фото не читается */
.hero__veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(6,5,4,.95) 0%, rgba(6,5,4,.88) 32%, rgba(6,5,4,.62) 58%, rgba(6,5,4,.26) 80%, rgba(6,5,4,.40) 100%);
}

.hero__inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut) clamp(88px, 13vh, 150px);
  color: var(--light);
}

.hero__title {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 8.2vw, 104px);
  line-height: 1.02;
  letter-spacing: -.028em;  /* крупному кеглю нужен отрицательный трекинг */
  text-wrap: balance;
}

.hero__lead {
  margin: 0 0 36px;
  max-width: 33ch;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: #EBE3D7;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero .eyebrow { color: #D6BC8C; }

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: 34px; height: 46px;
  display: grid; place-items: center;
}
.hero__scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, rgba(244,239,231,.06), rgba(244,239,231,.6));
  transform-origin: top;
  animation: scrollHint 2.6s var(--inout) infinite;
}
@keyframes scrollHint {
  0%, 100% { transform: scaleY(.35); opacity: .35; }
  50%      { transform: scaleY(1);   opacity: .9; }
}

/* ══ ПЛАВАЮЩАЯ ПАНЕЛЬ ═══════════════════════════════════ */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom));
  background: rgba(246,243,238,.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid rgba(23,19,15,.10);
  transform: translateY(100%);
  transition: transform 320ms var(--out);
}
.dock[data-shown] { transform: translateY(0); }
.dock__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dock__facts { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.dock__facts strong { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.dock__facts span {
  font-size: 13px; color: #5E554B;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ══ ПЛИТКА ФАКТОВ ══════════════════════════════════════ */
.facts {
  margin: clamp(48px, 7vw, 84px) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.facts__item { background: var(--paper-warm); padding: clamp(22px, 3vw, 34px); }
.facts dt {
  font-size: 12px; letter-spacing: .13em; text-transform: uppercase;
  color: #6B6157; margin-bottom: 12px;
}
.facts dd {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.facts__note {
  margin-top: 10px !important;
  font-family: var(--sans) !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
  color: #5E554B;
}

/* ══ ДВЕ КОЛОНКИ ════════════════════════════════════════ */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.cols--flip .cols__media { order: -1; }
.cols__media { margin: 0; }
.cols__media img { width: 100%; border-radius: 2px; }
.cols__media figcaption {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #A9A093;
}
.section--paper .cols__media figcaption { color: #6B6157; }

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .cols--flip .cols__media { order: 0; }
}

/* ══ СПИСОК-СТРОКИ ══════════════════════════════════════ */
.lines { list-style: none; margin: 0; padding: 0; }
.lines li {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-dark);
  color: var(--light-soft);
  font-size: 15.5px;
}
.lines li:first-child { border-top: 1px solid var(--line-dark); }
.lines span {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: #C9A876; padding-top: 3px;
}
@media (max-width: 520px) {
  .lines li { grid-template-columns: 1fr; gap: 4px; }
}

/* ══ РАБОТЫ ═════════════════════════════════════════════ */
.works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(24px, 3vw, 40px);
  margin: clamp(40px, 6vw, 68px) 0 clamp(44px, 6vw, 72px);
}
.work { border-top: 2px solid var(--ink); padding-top: 20px; }
.work__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 23px;
  letter-spacing: -.012em;
}
.work p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.work strong { color: var(--ink); font-weight: 600; }
.work__when {
  font-size: 12px !important;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bronze) !important;
}

/* ══ ДОКАЗАТЕЛЬСТВА ═════════════════════════════════════ */
.proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}
.proof__item { margin: 0; }
.proof__item img { width: 100%; border-radius: 2px; }
.proof__item figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #6B6157;
}

.callout {
  margin: clamp(44px, 6vw, 72px) 0 0;
  padding: clamp(26px, 3.4vw, 40px);
  background: var(--paper-warm);
  border-left: 3px solid var(--bronze);
  font-family: var(--serif);
  font-size: clamp(18px, 1.9vw, 23px);
  line-height: 1.45;
  letter-spacing: -.006em;
  max-width: 900px;
}

/* ══ КАРТОЧКИ СЦЕНАРИЕВ ═════════════════════════════════ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.card { background: var(--paper); padding: clamp(24px, 3vw, 36px); }
.card h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -.012em;
}
.card p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }

/* ══ ШАГИ СДЕЛКИ ════════════════════════════════════════ */
.steps { margin: 0 0 24px; padding: 0 0 0 22px; }
.steps li {
  margin-bottom: 16px;
  padding-left: 8px;
  color: var(--light-soft);
  font-size: 16px;
  line-height: 1.55;
}
.steps li::marker { color: #C9A876; }
.steps strong { color: var(--light); font-weight: 600; }

/* ══ ВОПРОСЫ ════════════════════════════════════════════ */
.qa { border-top: 1px solid var(--line); max-width: 860px; }
.qa__item { border-bottom: 1px solid var(--line); }
.qa__item summary {
  padding: 22px 40px 22px 0;
  position: relative;
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.32;
  letter-spacing: -.01em;
  transition: color 200ms ease;
}
.qa__item summary::-webkit-details-marker { display: none; }
.qa__item summary::after {
  content: '';
  position: absolute;
  right: 6px; top: 50%;
  width: 11px; height: 11px;
  margin-top: -8px;
  border-right: 1.5px solid var(--bronze);
  border-bottom: 1.5px solid var(--bronze);
  transform: rotate(45deg);
  transition: transform 220ms var(--out);
}
.qa__item[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.qa__item p {
  margin: 0 0 24px;
  max-width: 66ch;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.62;
}
@media (hover: hover) and (pointer: fine) {
  .qa__item summary:hover { color: var(--bronze); }
}

/* ══ ГАЛЕРЕЯ ════════════════════════════════════════════ */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.4vw, 18px);
}
.shot {
  position: relative;
  margin: 0; padding: 0;
  border: 0;
  background: var(--paper-warm);
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 2px;
  transition: transform 200ms var(--out);
}
.shot--wide { grid-column: span 2; }
.shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  aspect-ratio: 3 / 2;
  transition: transform 500ms var(--out);
}
.shot:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) {
  .shot:hover img { transform: scale(1.035); }
}
@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .shot--wide { grid-column: span 2; }
}

/* ══ ФИНАЛ ══════════════════════════════════════════════ */
.section--final {
  background: var(--night);
  color: var(--light);
  padding: clamp(90px, 13vw, 170px) 0;
  text-align: center;
}
.final__title {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.6vw, 66px);
  line-height: 1.06;
  letter-spacing: -.024em;
}
.final__lead {
  margin: 0 auto 26px;
  max-width: 46ch;
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
  color: #D9CFC1;
}
.section--final .body { margin-left: auto; margin-right: auto; text-align: center; }
.final__actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
  margin-top: 34px;
}

/* ══ ПОДВАЛ ═════════════════════════════════════════════ */
.footer {
  background: var(--night-2);
  color: #9C9285;
  padding: 40px 0 calc(64px + env(safe-area-inset-bottom));
  font-size: 13.5px;
  line-height: 1.6;
}
.footer p { margin: 0 0 12px; }
.footer__legal { max-width: 76ch; color: #968D81; }

/* ══ ПРОСМОТР ФОТО ══════════════════════════════════════ */
.viewer {
  border: 0;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  background: rgba(8,7,6,.96);
  color: var(--light);
}
.viewer::backdrop { background: rgba(8,7,6,.9); }
.viewer[open] { display: grid; place-items: center; }
.viewer__img {
  max-width: min(94vw, 1500px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 2px;
}
.viewer__caption {
  margin: 18px auto 0;
  max-width: 60ch;
  padding: 0 20px;
  text-align: center;
  font-size: 14px;
  color: var(--light-soft);
}
.viewer__close {
  position: absolute;
  top: 14px; right: 16px;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(244,239,231,.12);
  color: var(--light);
  font-size: 26px; line-height: 1;
  cursor: pointer;
  transition: transform 160ms var(--out), background-color 200ms ease;
}
.viewer__close:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .viewer__close:hover { background: rgba(244,239,231,.22); }
}

/* ══ ПОЯВЛЕНИЕ ══════════════════════════════════════════
   Ничего не появляется из ничего: 10px сдвиг + прозрачность.  */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 620ms var(--out), transform 620ms var(--out);
  transition-delay: var(--d, 0ms);
}
.js .reveal[data-in] { opacity: 1; transform: none; }

/* Первый экран показывается сразу после загрузки, без ожидания прокрутки */
.hero .reveal { transition-duration: 900ms; }

/* ══ ДОСТУПНОСТЬ И НАСТРОЙКИ СИСТЕМЫ ════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__media img { animation: none; transform: scale(1.02); }
  .hero__scroll-line { animation: none; opacity: .6; }
  .dock { transition: none; }
  .shot img, .btn, .viewer__close { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .dock { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --ink-soft: #2A241E; --light-soft: #E4DCD0; --line: rgba(23,19,15,.34); --line-dark: rgba(244,239,231,.4); }
  .note { color: #3A342C; }
  .section--dark .note { color: #D2C9BC; }
  .hero__veil { background: linear-gradient(to top, rgba(4,3,3,.97) 0%, rgba(4,3,3,.9) 34%, rgba(4,3,3,.6) 70%, rgba(4,3,3,.5) 100%); }
}

@media print {
  .dock, .hero__scroll, .draft-bar { display: none; }
  .js .reveal { opacity: 1; transform: none; }
  .section--dark, .section--final { background: #fff; color: #000; }
}
