/* Hartwell & Sons — стили. Токены и решения описаны в docs/design.md */

:root {
  --paper: #F2ECDF;
  --ink: #1E2A23;
  --oak: #2F4A3A;
  --moss: #5B6656;
  --haint: #CFE0DC;
  --brass: #8A6A3B;
  --brass-ink: #765A30;
  --dusk: #18211C;
  --cream: #EDE4D0;
  --lantern: #E9B970;
  --error: #F2A68E;

  --page-bg: var(--paper); /* меняется скриптом: утро → вечер */

  --f-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --f-serif: "Libre Caslon Text", Georgia, serif;
  --f-sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* движение по экрану */
  --gutter: clamp(20px, 6vw, 96px);
  --chapter-gap: clamp(112px, 22vh, 240px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: clamp(17px, 0.35vw + 15.8px, 19px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

::selection { background: var(--lantern); color: var(--dusk); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}
.evening :focus-visible,
.footer :focus-visible,
.hero :focus-visible { outline-color: var(--lantern); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 12px 18px; background: var(--ink); color: var(--paper);
  border-radius: 999px; text-decoration: none; transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* ---------- Сетка ---------- */

.wrap {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 16px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
  }
}

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

.eyebrow {
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 22px;
}
.eyebrow--light { color: rgba(237, 228, 208, .82); }

.h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(36px, 4.6vw + 12px, 78px);
  line-height: 1.02;
  letter-spacing: -.012em;
}

em, i {
  font-family: var(--f-serif);
  font-style: italic;
  letter-spacing: -.02em;
}

.prose { max-width: 34em; margin-top: clamp(24px, 3vw, 36px); }
.prose p + p { margin-top: 1em; }

/* строки заголовков: каждая в своей «рамке» */
[data-lines] .line {
  display: block;
  overflow: hidden;
  padding-bottom: .08em;
  margin-bottom: -.08em;
}
[data-lines] .line > span { display: block; }

.caption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--moss);
  max-width: 30ch;
}

/* ---------- Кнопки и ссылки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font: 600 15px/1 var(--f-sans);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, transform .16s var(--ease-out);
}
.btn:active { transform: scale(.98); }
.btn--light { background: var(--cream); color: var(--ink); }
.btn--lantern { background: var(--lantern); color: var(--dusk); }
@media (hover: hover) and (pointer: fine) {
  .btn--light:hover { background: #FBF5E8; }
  .btn--lantern:hover { background: var(--cream); }
}

.link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  /* тонкая постоянная линия + сплошная, которая растёт слева при наведении */
  box-shadow: inset 0 -1px 0 0 color-mix(in srgb, currentColor 38%, transparent);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size .2s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .link:hover { background-size: 100% 1px; }
}
.link:focus-visible { background-size: 100% 1px; }
.link--light { color: var(--cream); }

/* ---------- Верхняя полоса ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gutter);
  color: var(--cream);
  transition: transform .28s var(--ease-out), background-color .4s ease, color .4s ease, box-shadow .4s ease;
}
.topbar.is-solid {
  background: color-mix(in srgb, var(--page-bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(30, 42, 35, .08);
}
.topbar.is-solid.is-dark { color: var(--cream); box-shadow: 0 1px 0 rgba(237, 228, 208, .08); }
.topbar.is-hidden { transform: translateY(-105%); }

.wordmark {
  font-family: var(--f-display);
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark i { font-size: .92em; }

.topbar__call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}
.topbar__call-label {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .75;
}
@media (max-width: 420px) {
  .topbar__call-label { display: none; }
}

/* ---------- Меню-таблетка (лента времени) ---------- */

.timeline-nav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 40;
  transform: translate(-50%, 140%);
  opacity: 0;
  padding: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 0 0 1px rgba(30, 42, 35, .1), 0 10px 30px -12px rgba(30, 42, 35, .35);
  transition: transform .35s var(--ease-out), opacity .3s var(--ease-out), background-color .5s ease, box-shadow .5s ease;
}
.timeline-nav.is-visible,
.timeline-nav:focus-within { transform: translate(-50%, 0); opacity: 1; }
.no-js .timeline-nav,
html:not(.js) .timeline-nav { transform: translate(-50%, 0); opacity: 1; }

.timeline-nav__list { position: relative; z-index: 1; display: flex; }
.timeline-nav__list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 clamp(11px, 2.4vw, 18px);
  border-radius: 999px;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .04em;
  font-variant-numeric: lining-nums;
  text-decoration: none;
  color: var(--ink);
  transition: color .35s var(--ease-out);
}
.timeline-nav__list a[aria-current] { color: var(--paper); }

/* подложка на всю ширину списка, видимая часть вырезается clip-path (без анимации ширины) */
.timeline-nav__pill {
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: var(--oak);
  clip-path: inset(0 100% 0 0 round 999px);
  opacity: 0;
  transition: clip-path .3s var(--ease-in-out), opacity .2s ease, background-color .5s ease;
}
.timeline-nav__pill.is-on { opacity: 1; }

.timeline-nav.is-dark {
  background: color-mix(in srgb, var(--dusk) 72%, transparent);
  box-shadow: 0 0 0 1px rgba(237, 228, 208, .14), 0 10px 30px -12px rgba(0, 0, 0, .6);
}
.timeline-nav.is-dark .timeline-nav__list a { color: var(--cream); }
.timeline-nav.is-dark .timeline-nav__list a[aria-current] { color: var(--dusk); }
.timeline-nav.is-dark .timeline-nav__pill { background: var(--lantern); }

/* ---------- 1. Первый экран ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--cream);
  background: var(--dusk);
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(14, 20, 16, .8) 0%, rgba(14, 20, 16, .55) 42%, rgba(14, 20, 16, .14) 76%, rgba(14, 20, 16, 0) 100%),
    linear-gradient(to bottom, rgba(14, 20, 16, .5) 0%, rgba(14, 20, 16, 0) 24%);
}

.hero__content {
  position: relative;
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding: 120px var(--gutter) clamp(96px, 14vh, 140px);
}
.hero__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(44px, 7.4vw + 10px, 128px);
  line-height: .98;
  letter-spacing: -.018em;
  max-width: 12.5em;
}
.hero__foot {
  display: grid;
  gap: 28px;
  margin-top: clamp(28px, 4vw, 48px);
}
.hero__lede { max-width: 36ch; color: rgba(237, 228, 208, .9); }
.hero .eyebrow,
.hero__lede { text-shadow: 0 1px 14px rgba(14, 20, 16, .55); }
.hero .eyebrow { color: var(--cream); }
@media (max-width: 899px) {
  .hero__media::after {
    background:
      linear-gradient(to top, rgba(14, 20, 16, .86) 0%, rgba(14, 20, 16, .64) 50%, rgba(14, 20, 16, .24) 82%, rgba(14, 20, 16, .1) 100%),
      linear-gradient(to bottom, rgba(14, 20, 16, .5) 0%, rgba(14, 20, 16, 0) 18%);
  }
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.hero__actions .link { font-size: 15px; }

.hero__hint {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(32px, 5vh, 48px);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(237, 228, 208, .7);
  display: none;
}

@media (min-width: 900px) {
  .hero__foot { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .hero__hint { display: block; }
  .hero__content { padding-bottom: clamp(80px, 11vh, 120px); }
}

/* ---------- Главы ---------- */

.chapter { padding-top: var(--chapter-gap); }

.chapter__year {
  grid-column: 1 / -1;
  font-family: var(--f-display);
  font-size: clamp(96px, 19vw, 300px);
  line-height: .78;
  letter-spacing: -.035em;
  color: var(--brass);
  font-variant-numeric: oldstyle-nums;
  margin-bottom: 28px;
  user-select: none;
}
.chapter__year--word { font-size: clamp(80px, 15vw, 240px); }
.chapter__text { grid-column: 1 / -1; }

@media (min-width: 900px) {
  .chapter__year { grid-column: 1 / 7; margin-bottom: 0; }
  .chapter__text { grid-column: 7 / 13; padding-top: clamp(8px, 2vw, 32px); }
}

/* фото в рамке: внутри картинка чуть больше, чтобы был запас на параллакс */
.frame { position: relative; }
.frame__img,
.bleed__img {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ar, 3 / 2);
  background: color-mix(in srgb, var(--oak) 14%, var(--page-bg));
}
.frame__img img,
.bleed__img img {
  position: absolute;
  left: 0;
  top: -7%;
  width: 100%;
  height: 114%;
  object-fit: cover;
}

/* 2005 */
.gallery-2005 { margin-top: clamp(64px, 12vh, 150px); row-gap: 28px; }
.frame--b1 { grid-column: 1 / -1; --ar: 16 / 10; }
.frame--b3 { grid-column: 2 / -1; --ar: 4 / 5; }
@media (min-width: 900px) {
  .frame--b1 { grid-column: 1 / 9; }
  .frame--b3 { grid-column: 10 / 13; align-self: end; margin-bottom: -14vh; }
}

.plate {
  margin-top: clamp(96px, 18vh, 200px);
  background: var(--oak);
  color: var(--cream);
}
.plate__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding-block: 18px;
}
.plate__title { font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: 20px; line-height: 1.3; }
.plate__meta { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: rgba(237, 228, 208, .8); }

.bleed { --ar: 4 / 3; }
@media (min-width: 900px) { .bleed { --ar: 21 / 9; } }

/* 2012: чертёж → сад */
.plan { margin-top: clamp(48px, 8vh, 96px); }
.plan__stage {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 88px var(--gutter) 104px;
}
.plan__canvas {
  position: relative;
  width: min(100%, calc((100svh - 230px) * 900 / 756), 980px);
  aspect-ratio: 900 / 756;
  background-color: color-mix(in srgb, var(--paper) 92%, var(--brass));
  background-image:
    linear-gradient(to right, rgba(138, 106, 59, .12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(138, 106, 59, .12) 1px, transparent 1px);
  background-size: calc(100% / 18) calc(100% / 15);
  box-shadow: 0 0 0 1px rgba(30, 42, 35, .12);
}
.plan__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plan__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* --u = сколько единиц чертежа в одном пикселе экрана (ставит скрипт) */
.plan { --plan-line: #1E2A23; }
.plan__lines path,
.plan__lines circle { fill: none; stroke: var(--plan-line); stroke-width: calc(1.5px * var(--u, 1)); stroke-linejoin: round; }
.plan__guides line { stroke: var(--brass); stroke-width: calc(1px * var(--u, 1)); opacity: .7; }
html:not(.motion) .plan__guides line { stroke-dasharray: 6 6; }
.plan__notes line,
.plan__notes path { fill: none; stroke: var(--plan-line); stroke-width: calc(1px * var(--u, 1)); }
.plan__north path { fill: var(--plan-line); stroke: none; }
.plan__notes text {
  font-family: var(--f-sans);
  font-size: calc(13px * var(--u, 1));
  font-weight: 500;
  letter-spacing: .06em;
  fill: var(--plan-line);
  text-anchor: middle;
  /* тёмная обводка под текстом, чтобы подписи читались поверх фото */
  paint-order: stroke;
  stroke: var(--plan-halo, transparent);
  stroke-width: calc(4px * var(--u, 1));
  stroke-linejoin: round;
  transition: stroke .4s;
}
.plan.is-grown,
html:not(.motion) .plan { --plan-halo: rgba(24, 33, 28, .55); }

/* на телефоне на чертеже только номера, названия ниже списком */
.plan__legend {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 28px;
  font-size: 13px;
  color: var(--ink);
}
.plan__legend span { font-family: var(--f-display); color: var(--brass-ink); margin-right: 4px; }
@media (max-width: 599px) {
  .plan__name { display: none; }
  .plan__scale { display: none; }
}
@media (min-width: 600px) {
  .plan__legend { display: none; }
}
.plan__notes text.start { text-anchor: start; }
.plan__notes text.end { text-anchor: end; }

.plan__caption {
  position: relative;
  display: grid;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--moss);
}
.plan__caption > span { grid-area: 1 / 1; text-align: center; transition: opacity .4s; }
.plan__caption-b { opacity: 0; }
.plan.is-grown .plan__caption-a { opacity: 0; }
.plan.is-grown .plan__caption-b { opacity: 1; }

/* без анимации показываем готовый сад с бледным чертежом */
html:not(.motion) .plan { --plan-line: var(--cream); }
html:not(.motion) .plan__lines { opacity: .55; }
html:not(.motion) .plan__caption-a { opacity: 0; }
html:not(.motion) .plan__caption-b { opacity: 1; }

/* 2019 */
.gallery-2019 { margin-top: clamp(64px, 12vh, 150px); row-gap: 28px; }
.frame--d1 { grid-column: 1 / -1; --ar: 3 / 2; }
.frame--d3 { grid-column: 2 / 4; --ar: 3 / 4; }
@media (min-width: 900px) {
  .frame--d1 { grid-column: 4 / 13; grid-row: 1; }
  .frame--d3 { grid-column: 1 / 4; grid-row: 1; align-self: end; margin-bottom: -10vh; }
}

.projects { margin-top: clamp(140px, 24vh, 260px); }
.projects__title { margin-bottom: clamp(40px, 6vw, 72px); }

.project {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 24px;
  margin-bottom: clamp(96px, 16vh, 180px);
}
.project .frame { grid-column: 1 / -1; }
.project__text { grid-column: 1 / -1; max-width: 32em; }
.project--a .frame { --ar: 3 / 2; }
.project--b .frame { --ar: 4 / 3; }

.project__num {
  font-family: var(--f-display);
  font-size: 16px;
  color: var(--brass-ink);
  margin-bottom: 10px;
}
.project__name {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(28px, 2vw + 16px, 40px);
  line-height: 1.05;
}
.project__meta {
  margin: 10px 0 16px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--moss);
}

.project:last-child { margin-bottom: 0; }
.project--c .plate { margin-top: 0; }
.project--c .plate,
.project--c .bleed { grid-column: 1 / -1; }
.project--c .bleed { margin-top: -24px; } /* плашка вплотную к фото */
.plate--inline .plate__inner { padding-inline: 20px; }
.bleed--contained { --ar: 4 / 3; }
.project__text--wide { margin-top: 8px; }

@media (min-width: 900px) {
  .project { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .project--a .frame { grid-column: 1 / 9; }
  .project--a .project__text { grid-column: 9 / 13; align-self: end; padding-left: 8px; }
  .project--b .frame { grid-column: 5 / 13; grid-row: 1; }
  .project--b .project__text { grid-column: 1 / 5; grid-row: 1; align-self: center; padding-right: 16px; }
  .bleed--contained { --ar: 21 / 9; }
  .project--c .project__text { grid-column: 3 / 11; text-align: left; }
}

/* Today */
.today { margin-top: clamp(64px, 10vh, 120px); row-gap: 56px; }
.frame--today { grid-column: 1 / -1; --ar: 4 / 5; }
.steps { grid-column: 1 / -1; position: relative; border-left: 1px solid rgba(138, 106, 59, .5); }
@media (min-width: 900px) {
  .frame--today { grid-column: 1 / 6; align-self: start; position: sticky; top: 110px; }
  .steps { grid-column: 7 / 13; }
}

.step { position: relative; padding: 0 0 clamp(48px, 8vh, 80px) clamp(24px, 3vw, 40px); }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--page-bg);
  box-shadow: inset 0 0 0 1px var(--brass);
}
.step__num { display: block; font-family: var(--f-display); font-size: 16px; color: var(--brass-ink); margin-bottom: 12px; }
.step__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(26px, 1.6vw + 16px, 36px);
  line-height: 1.08;
  margin-bottom: 12px;
}
.step p { max-width: 30em; }

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 0;
  margin-top: clamp(96px, 16vh, 180px);
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(19px, 1vw + 14px, 24px);
  text-align: center;
  text-wrap: balance;
}
.facts span { padding: 0 clamp(14px, 2vw, 28px); }
/* разделители только в одну строку, иначе черта попадает в начало строки */
@media (min-width: 900px) {
  .facts { flex-wrap: nowrap; font-size: clamp(20px, 1vw + 12px, 24px); }
  .facts span { white-space: nowrap; padding: 0 clamp(16px, 1.6vw, 28px); }
  .facts span + span { border-left: 1px solid rgba(138, 106, 59, .55); }
}
@media (max-width: 899px) {
  .facts { flex-direction: column; align-items: center; }
}

/* ---------- 6. Вечер ---------- */

.evening {
  margin-top: var(--chapter-gap);
  color: var(--cream);
}

.lights { position: relative; }
.lights__img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2000 / 1333;
  background: #0d120f;
}
.lights__img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* сумерки: тёмный слой поверх фото, при прокрутке меняется только его прозрачность */
.lights__dark {
  position: absolute;
  inset: 0;
  background: #0b100d;
  opacity: 0;
  pointer-events: none;
}
.motion .lights__dark { opacity: .68; }

.lamp {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  pointer-events: none;
  mix-blend-mode: screen;
  border-radius: 50%;
}
.lamp--wash {
  width: 13%;
  aspect-ratio: 1 / 2.4;
  transform: translate(-50%, -78%);
  border-radius: 0;
  background: radial-gradient(ellipse 42% 50% at 50% 82%, rgba(255, 196, 122, .3) 0%, rgba(255, 178, 102, .1) 50%, rgba(255, 170, 90, 0) 75%);
}
.lamp--path {
  width: 2.6%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 230, 180, .95) 0%, rgba(255, 196, 120, .38) 30%, rgba(255, 180, 100, 0) 70%);
}
.motion .lamp { opacity: 0; }

.lights__text { padding-top: 40px; }
.lights__line {
  font-family: var(--f-display);
  font-size: clamp(30px, 3.2vw + 12px, 60px);
  line-height: 1.05;
  max-width: 14em;
}
@media (min-width: 900px) {
  .lights__text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(36px, 6vw, 80px);
    margin-inline: auto;
    padding-top: 0;
  }
  .lights__line { max-width: 13em; }
}

.contact {
  padding-top: clamp(96px, 16vh, 180px);
  padding-bottom: clamp(96px, 14vh, 160px);
  row-gap: 64px;
}
.contact__intro { grid-column: 1 / -1; }
.form { grid-column: 1 / -1; position: relative; }
@media (min-width: 900px) {
  .contact__intro { grid-column: 1 / 6; align-self: start; position: sticky; top: 110px; }
  .form { grid-column: 7 / 13; }
}
.contact .prose { color: rgba(237, 228, 208, .86); }

.call {
  display: inline-grid;
  gap: 6px;
  margin-top: 40px;
  text-decoration: none;
}
.call__label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: rgba(237, 228, 208, .75); }
.call__number {
  font-family: var(--f-display);
  font-size: clamp(32px, 2vw + 20px, 46px);
  line-height: 1;
  color: var(--lantern);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 6px;
  transition: background-size .2s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .call:hover .call__number { background-size: 100% 1px; }
}
.call:focus-visible .call__number { background-size: 100% 1px; }

/* анкета */
.field { border: 0; padding: 0; margin: 0 0 40px; min-width: 0; }
.field__label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin-bottom: 16px;
  font-size: 17px;
  font-weight: 500;
  color: var(--cream);
}
.field__num { font-family: var(--f-serif); font-style: italic; color: var(--lantern); }
.field__hint { font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #A9AE98; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; display: inline-flex; }
.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(237, 228, 208, .34);
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .chip:hover span { box-shadow: inset 0 0 0 1px rgba(237, 228, 208, .7); }
}
.chip input:checked + span { background: var(--cream); color: var(--dusk); box-shadow: inset 0 0 0 1px var(--cream); }
.chip input:focus-visible + span { outline: 2px solid var(--lantern); outline-offset: 3px; }

.input {
  width: 100%;
  min-height: 52px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(237, 228, 208, .4);
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  font: 400 18px/1.4 var(--f-sans);
  transition: border-color .25s var(--ease-out);
}
.input::placeholder { color: rgba(237, 228, 208, .55); }
.input:focus { outline: none; border-bottom-color: var(--lantern); }
.input:focus-visible { outline: none; box-shadow: 0 2px 0 0 var(--lantern); }
.input[aria-invalid="true"] { border-bottom-color: var(--error); }

.pair { display: grid; gap: 20px; }
@media (min-width: 600px) { .pair { grid-template-columns: 1fr 1fr; gap: 24px; } }

.field__error { margin-top: 10px; font-size: 14px; color: var(--error); }
.field__error:empty { display: none; }

.form .btn { margin-top: 8px; }
.form__note { margin-top: 18px; font-size: 13px; color: rgba(237, 228, 208, .68); max-width: 40ch; }

.form__done {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 32px 0;
  background: var(--dusk);
}
.form__done[hidden] { display: none; }
.form__done-title { font-family: var(--f-display); font-size: clamp(40px, 3vw + 20px, 64px); line-height: 1; color: var(--lantern); }
.form__done p { max-width: 36ch; }
.form__done .link { justify-self: start; min-height: 44px; }
.form__done:focus { outline: none; }

/* без анимаций вечер и подвал тёмные сами по себе */
html:not(.motion) .evening,
html:not(.motion) .footer { background: var(--dusk); }

/* ---------- Подвал ---------- */

.footer {
  color: var(--cream);
  padding: clamp(72px, 12vh, 120px) 0 120px;
  border-top: 1px solid rgba(237, 228, 208, .12);
}
.footer__grid { display: grid; gap: 40px; }
.footer__mark { font-family: var(--f-display); font-size: clamp(40px, 4vw + 16px, 72px); line-height: 1; }
.footer__col p:not(.eyebrow) { color: rgba(237, 228, 208, .86); max-width: 32ch; }
@media (min-width: 900px) {
  .footer__grid { grid-template-columns: 6fr 4fr 2fr; align-items: end; }
}
.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid rgba(237, 228, 208, .12);
  font-size: 13px;
  color: rgba(237, 228, 208, .7);
}
.nw { white-space: nowrap; }
.credits summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}
.credits summary::-webkit-details-marker { display: none; }
/* свой знак вместо стандартного треугольника браузера */
.credits summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .3s var(--ease-out);
}
.credits[open] summary::before { transform: translateY(1px) rotate(225deg); }
@media (hover: hover) and (pointer: fine) {
  .credits summary:hover { color: var(--cream); }
}
.credits p { margin-top: 10px; max-width: 60ch; }

/* ---------- Начальные состояния для анимаций ---------- */

.motion [data-lines] .line > span { transform: translateY(110%); }
.motion [data-fade] { opacity: 0; transform: translateY(22px); }
.motion [data-year] { opacity: 0; transform: translateY(36px); }
.motion [data-reveal] .frame__img,
.motion [data-reveal] .bleed__img { clip-path: inset(100% 0 0 0); }

/* ставни: полосы цвета страницы поверх фото */
.shutter {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--slats, 7), 1fr);
  pointer-events: none;
}
.shutter i {
  display: block;
  background: var(--page-bg);
  margin-right: -1px;
  transform-origin: 0 50%;
}
.motion [data-shutter] .frame__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--page-bg);
}
.motion [data-shutter].has-shutter .frame__img::after { content: none; }

/* «Уменьшить движение»: блоки только проявляются (0.4 s), ничего не сдвигается */
.calm :is([data-fade], [data-lines], [data-year], [data-reveal], [data-shutter]) {
  opacity: 0;
  transition: opacity .4s ease;
}
.calm :is([data-fade], [data-lines], [data-year], [data-reveal], [data-shutter]).is-in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  /* переходы цвета и прозрачности остаются, движение (transform, clip-path) мгновенное */
  *, *::before, *::after {
    transition-property: opacity, color, background-color, border-color, box-shadow !important;
  }
}
