@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/GeistMono-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --bg: #fcfbf9;
  --ink: #1a1a1a;
  --ink-soft: rgba(26, 26, 26, .6);
  --ink-faint: rgba(26, 26, 26, .4);
  --line: rgba(26, 26, 26, .12);
  --plate: #f1ede6;
  --err: #9b2c2c;
  --font: 'Geist Mono', 'Cascadia Mono', Consolas, monospace;
  --fs: 13px;
  --edge: 32px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs)/1.5 var(--font);
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}
a, button { color: inherit; font: inherit; text-decoration: none; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
img { display: block; max-width: 100%; }
main { animation: pageIn .5s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--bg); padding: 6px 10px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- шапка и подвал: закреплены только на главной ---------- */
.brand { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); z-index: 20; display: block; padding: 8px; }
.brand img { height: 20px; width: auto; }
.foot { display: flex; justify-content: center; gap: 40px; padding: 0 0 40px; }
.foot a { color: var(--ink-soft); padding: 8px 2px; transition: color .25s var(--ease); }
.foot a:hover, .foot a[aria-current="page"] { color: var(--ink); }
body[data-view="home"] .brand { position: fixed; }
body[data-view="home"] .foot { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); padding: 0; z-index: 20; }

/* ---------- главная: список - кадр - место ---------- */
.home { height: 100vh; height: 100dvh; overflow: hidden; position: relative; }
.index { position: absolute; left: var(--edge); top: 50%; transform: translateY(-50%); list-style: none; z-index: 10; }
.index li a {
  display: flex; align-items: center; gap: 10px;
  line-height: 18px; white-space: nowrap;
  transition: opacity .5s var(--ease);
}
.index .mark { display: block; height: 1px; width: 0; background: var(--ink); transition: width .5s var(--ease); }
.index li.is-on .mark { width: 24px; }
.index li a:hover { opacity: 1 !important; }

.stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(60vw, calc(72vh * 1.5)); aspect-ratio: 3 / 2; }
.frame {
  position: absolute; inset: 0; display: block; overflow: hidden;
  opacity: 0; transform: scale(1.015);
  transition: opacity .8s var(--ease), transform 1.4s var(--ease);
  pointer-events: none;
}
.frame.is-on { opacity: 1; transform: none; pointer-events: auto; }
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* сатинированное стекло: обложка в покое чуть мутная, при наведении проясняется */
@media (hover: hover) {
  .frame img {
    filter: blur(3px) saturate(.85) brightness(1.02);
    transform: scale(1.03);
    transition: filter .7s var(--ease), transform 1.2s var(--ease);
  }
  .frame:has(img)::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
      rgba(252, 251, 249, .12);
    opacity: 1; transition: opacity .7s var(--ease);
  }
  .stage.is-clear .frame.is-on img, .frame.is-on:focus-visible img { filter: none; transform: none; }
  .stage.is-clear .frame.is-on::after, .frame.is-on:focus-visible::after { opacity: 0; }
}

.plate { width: 100%; height: 100%; background: var(--plate); display: flex; flex-direction: column; justify-content: space-between; padding: 22px 24px; }
.plate .n { color: var(--ink-faint); }
.plate .t { color: var(--ink-soft); max-width: 30ch; }

.place { position: absolute; right: var(--edge); top: 50%; transform: translateY(-50%); text-align: right; z-index: 10; }
.place .count { color: var(--ink-faint); margin-top: 6px; font-variant-numeric: tabular-nums; }
.swap { display: inline-block; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.swap.out { opacity: 0; transform: translateY(4px); }

.hint {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(50% + min(20vw, 36vh) + 18px);
  color: var(--ink-faint); pointer-events: none;
  transition: opacity .35s var(--ease), color .35s var(--ease);
}
.hint.is-open { color: var(--ink); }
.m-list { display: none; }

/* ---------- внутренние страницы ---------- */
.page { padding: 150px var(--edge) 100px; }
.aside { position: fixed; left: var(--edge); top: 150px; width: 210px; z-index: 5; }
.back { color: var(--ink-soft); display: inline-block; padding: 4px 0; margin-bottom: 40px; transition: color .25s; }
.back:hover { color: var(--ink); }
.facts { display: grid; gap: 14px; }
.facts dt { color: var(--ink-faint); }
.facts dd { margin-top: 2px; }

.work { max-width: 1080px; margin: 0 auto; }
.work-head { max-width: 620px; margin: 0 auto 72px; text-align: center; }
.work-head h1 { font-size: var(--fs); font-weight: 400; }
.work-head p { color: var(--ink-soft); margin-top: 16px; }
.gallery { display: grid; gap: 64px; }
.row { display: flex; gap: 24px; align-items: flex-start; }
.shot { flex: var(--r) 1 0; min-width: 0; }
.shot img { width: 100%; height: auto; aspect-ratio: var(--r); object-fit: cover; background: var(--plate); }
.shot figcaption { display: flex; gap: 18px; margin-top: 10px; color: var(--ink-soft); }
.shot figcaption span:first-child { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.wip { aspect-ratio: 3 / 2; }
.next { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 1px solid var(--line); margin-top: 110px; padding-top: 18px; }
.next span { color: var(--ink-faint); }
.next a { color: var(--ink-soft); transition: color .25s; }
.next a:hover { color: var(--ink); }

.text { max-width: 640px; margin: 0 auto; }
.text h1 { font-size: var(--fs); font-weight: 400; margin-bottom: 40px; text-align: center; }
.lead { font-size: 15px; line-height: 1.7; }
.block { margin-top: 88px; }
.block > h2 { font-size: var(--fs); font-weight: 400; color: var(--ink-faint); margin-bottom: 22px; }
.items { list-style: none; border-top: 1px solid var(--line); }
.items li { display: grid; grid-template-columns: 48px 1fr; gap: 0 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.items .k { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.items .h { grid-column: 2; }
.items .d { grid-column: 2; color: var(--ink-soft); margin-top: 6px; line-height: 1.65; }
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.person img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--plate); filter: grayscale(1); }
.person .nm { margin-top: 16px; }
.person .rl { margin-top: 2px; }
.person .co { margin-top: 2px; color: var(--ink-faint); }
.person .ds { margin-top: 12px; color: var(--ink-soft); line-height: 1.65; }
.quote { margin-top: 88px; padding-left: 34px; position: relative; color: var(--ink-soft); line-height: 1.7; }
.quote::before { content: ''; position: absolute; left: 0; top: .75em; width: 24px; height: 1px; background: var(--ink); }

/* ---------- форма ---------- */
.contact-page { min-height: calc(100vh - 80px); min-height: calc(100dvh - 80px); }
.form { max-width: 460px; margin: 0 auto; display: grid; gap: 22px; }
.form-title { font-size: var(--fs); font-weight: 400; text-align: center; }
.form .intro { color: var(--ink-soft); text-align: center; line-height: 1.65; margin-bottom: 10px; }
.field { display: grid; gap: 6px; }
.field label { color: var(--ink-soft); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 8px 0; min-height: 44px; width: 100%;
  transition: border-color .25s var(--ease);
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.field .help { color: var(--ink-faint); }
.field .err, .agree .err { color: var(--err); min-height: 0; }
.field [aria-invalid="true"] { border-bottom-color: var(--err); }
.agree { display: grid; grid-template-columns: 18px 1fr; gap: 4px 12px; align-items: start; color: var(--ink-soft); line-height: 1.6; }
.agree input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--ink); cursor: pointer; }
.agree a { color: var(--ink); border-bottom: 1px solid var(--line); }
.agree .err { grid-column: 2; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.submit {
  justify-self: start; margin-top: 6px; padding: 12px 0; min-height: 44px;
  display: inline-flex; align-items: center; gap: 12px;
}
.submit .mark { display: block; width: 24px; height: 1px; background: var(--ink); transition: width .35s var(--ease); }
.submit:hover .mark { width: 40px; }
.submit[disabled] { opacity: .45; cursor: progress; }
.status { min-height: 1.5em; line-height: 1.6; }
.status.ok { color: var(--ink); }
.status.bad { color: var(--err); }

.not-found { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.not-found h1 { font-size: var(--fs); font-weight: 400; }
.not-found p { margin-top: 16px; }

/* ---------- политика ---------- */
.legal h2 { font-size: var(--fs); font-weight: 400; margin: 36px 0 10px; }
.legal p, .legal li { color: var(--ink-soft); line-height: 1.7; }
.legal ul { padding-left: 18px; }
.legal p + p { margin-top: 10px; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1100px) {
  .aside { position: static; width: auto; margin-bottom: 56px; }
  .facts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 809px) {
  :root { --edge: 20px; }
  .brand, body[data-view="home"] .brand { position: absolute; top: 22px; }
  .brand img { height: 16px; }
  .home { height: auto; overflow: visible; }
  .index, .place, .stage, .hint { display: none; }
  .m-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 96px var(--edge) 72px; list-style: none; }
  .m-list li, .m-list a { display: block; min-width: 0; }
  .m-list .plate, .m-list img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; height: auto; }
  .m-list .cap { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; }
  .m-list .cap span:last-child { color: var(--ink-soft); text-align: right; }
  body[data-view="home"] .foot { position: static; transform: none; padding: 0 0 40px; }
  .page { padding: 96px var(--edge) 72px; }
  .row { flex-direction: column; gap: 40px; }
  .shot { flex: none; width: 100%; }
  .gallery { gap: 40px; }
  .team { grid-template-columns: minmax(0, 1fr); }
  .field input, .field textarea { font-size: 16px; }
  /* место нажатия на телефоне - не меньше 44 пикселей */
  .back, .next a, .foot a { display: inline-flex; align-items: center; min-height: 44px; }
  .back { margin-bottom: 28px; }
  .agree { grid-template-columns: 22px 1fr; }
  .agree input { width: 22px; height: 22px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
