/* главная после героя: музей, залы, пауза, свет, визит. У каждого блока своя композиция и своё движение. */

/* 01 музей: крупная фраза под лучом-фонарём (свет идёт за курсором), справа узкая пластина-макро */
.museum { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 2vw; padding: clamp(120px, 13vw, 210px) var(--pad) clamp(100px, 10vw, 170px); }
.manifest {
  --mx: 24%; --my: 30%;
  grid-column: 2 / 10; grid-row: 1; margin: 0; font-family: var(--ff-display); font-weight: var(--fw-display); font-synthesis: none; letter-spacing: -.014em;
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image:
    radial-gradient(circle 300px at var(--mx) var(--my), rgb(236 226 255), rgb(236 226 255 / 0)),
    radial-gradient(circle 240px at calc(100% - var(--mx)) calc(100% - var(--my)), rgb(255 226 170), rgb(255 226 170 / 0)),
    linear-gradient(rgb(244 245 250 / .44), rgb(244 245 250 / .44));
}
.manifest .m1 { display: block; font-size: clamp(40px, 7.4vw, 136px); line-height: .98; }
.manifest .m2 { display: block; margin: clamp(22px, 2.6vw, 44px) 0 0 18%; max-width: 17em; font-size: clamp(24px, 2.8vw, 50px); line-height: 1.1; }
.mu-plate { grid-column: 10 / 13; grid-row: 1 / 3; align-self: start; margin: clamp(60px, 15vw, 240px) 0 0; border: 1px solid var(--line); background: #000; }
.mu-plate img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }

/* 02 залы: закреплённый экран, лента едет вбок, формы и размеры у всех разные, дальние в тени */
.halls { position: relative; height: var(--halls-h, 320vh); }
.halls-pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding-top: var(--hdr-h); }
.halls-head { display: grid; gap: 14px; padding: 0 var(--pad); margin-bottom: clamp(18px, 3.4vh, 40px); }
.halls-head h2 { font-size: clamp(40px, 6vw, 108px); }
.halls-line { display: block; position: relative; height: 1px; max-width: 34vw; background: var(--line); }
.halls-line i { position: absolute; left: 0; top: -1px; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--light-violet), var(--light-gold)); }
.halls-track { display: flex; align-items: flex-start; gap: clamp(20px, 3.4vw, 56px); width: max-content; padding: 0 var(--pad) 0 calc(var(--pad) + 6vw); will-change: transform; }
.niche {
  --mx: 24%; --my: 12%; --k: 1;
  position: relative; flex: none; overflow: hidden; isolation: isolate; outline-offset: 4px; background: var(--color-surface);
  width: clamp(260px, var(--w, 25vw), 440px); height: clamp(340px, var(--h, 56vh), 580px); border-radius: 50vw 50vw 0 0;
  scale: calc(.9 + .1 * var(--k)); filter: brightness(calc(.3 + .7 * var(--k)));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 0 0 1px var(--line-soft);
  transition: translate .6s var(--ease-out);
}
.n1 { --w: 24vw; --h: 62vh; }
.n2 { --w: 19vw; --h: 46vh; margin-top: clamp(40px, 18vh, 170px); }
.n3 { --w: 26vw; height: auto; aspect-ratio: 1; border-radius: 50%; margin-top: clamp(12px, 5vh, 50px); }
.n4 { --w: 34vw; --h: 56vh; margin-top: clamp(24px, 11vh, 110px); }
.niche:hover, .niche:focus-visible { translate: 0 -8px; }
.niche::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .45s;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--light-violet), transparent 62%), radial-gradient(260px circle at calc(100% - var(--mx)) calc(100% - var(--my)), var(--light-gold), transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.niche:hover::after, .niche:focus-visible::after { opacity: 1; }
.niche-pic { position: absolute; inset: 0; z-index: 0; background-repeat: no-repeat; background-size: cover; -webkit-mask-image: linear-gradient(to bottom, #000 54%, transparent 96%); mask-image: linear-gradient(to bottom, #000 54%, transparent 96%); transition: transform 1.2s var(--ease-out); }
.niche:hover .niche-pic { transform: scale(1.04); }
.n1 .niche-pic { background-image: url("../../assets/hall-hand.webp"); background-position: 50% 30%; }
.n2 .niche-pic { background-image: url("../../assets/hall-amphora.webp"); background-position: 50% 40%; }
.n3 .niche-pic { background-image: url("../../assets/bust-2000.webp"); background-size: 340% auto; background-position: 44% 30%; -webkit-mask-image: none; mask-image: none; }
.n4 .niche-pic { background-image: url("../../assets/hall-niche.webp"); background-position: 50% 62%; }
.niche-txt { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 0 clamp(20px, 2vw, 30px) clamp(22px, 2.4vw, 34px); display: grid; gap: 8px; }
.niche-txt .rn { font-family: var(--ff-display); font-weight: var(--fw-display); font-synthesis: none; font-size: clamp(44px, 4.6vw, 80px); line-height: .8; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--color-text) 72%, transparent); letter-spacing: 0; }
.niche-txt h3 { font-size: clamp(34px, 3.2vw, 54px); }
.niche-txt p { font-size: 15px; line-height: 1.45; color: color-mix(in srgb, var(--color-text) 82%, transparent); max-width: 30ch; }
.n3 .niche-txt { bottom: 7%; justify-items: center; text-align: center; padding: 0 16%; }
.n3 .niche-txt .rn { display: none; }
.n3 .niche-txt p { font-size: 14px; max-width: 22ch; text-wrap: balance; }
.n3 .niche-pic::after { content: ""; position: absolute; inset: 0; background: radial-gradient(closest-side, transparent 45%, #000 100%), linear-gradient(to top, #000 0, transparent 38%); }

/* 08 ниша раскрывается по арке из центра, потом проявляется подпись */
.js .niche-pic { clip-path: inset(50% 50% 50% 50% round 999px 999px 0 0); transition: transform 1.2s var(--ease-out), clip-path 1.5s var(--ease-io) var(--rd, 0s); }
.js .niche.is-open .niche-pic { clip-path: inset(0 0 0 0 round 999px 999px 0 0); }
.js .niche-txt { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease-out) calc(var(--rd, 0s) + .9s), transform .9s var(--ease-out) calc(var(--rd, 0s) + .9s); }
.js .niche.is-open .niche-txt { opacity: 1; transform: none; }

/* 09 наклон ниши за курсором (мышь) и блик; свет по краю уже идёт за курсором */
.niche { transition: translate .6s var(--ease-out), transform .6s var(--ease-out); }
.niche.is-tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: translate .6s var(--ease-out), transform .12s linear; }
.niche::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(240px circle at var(--mx) var(--my), rgb(255 255 255 / .12), transparent 62%); }
.niche:hover::before { opacity: 1; }

/* 07 код печатается на зале «Код» (Typed.js) */
.n3-code { position: absolute; z-index: 2; left: 21%; top: 36%; margin: 0; font: 400 clamp(10px, .95vw, 13px)/1.7 var(--ff-mono); letter-spacing: .02em; color: #d3ceff; text-shadow: 0 0 12px rgb(123 63 242 / .95), 0 0 2px rgb(0 0 0 / .9); white-space: pre; pointer-events: none; }
.n3-code::after { content: "▍"; color: var(--light-gold); text-shadow: none; animation: n3blink .9s steps(1) infinite; }
.js .n3-code { opacity: 0; transition: opacity .6s calc(var(--rd, 0s) + .9s); }
.js .niche.is-open .n3-code { opacity: 1; }
@keyframes n3blink { 50% { opacity: 0; } }

/* пауза: широкий кадр без плашек, одна фраза */
.pause { position: relative; height: clamp(420px, 78vh, 840px); overflow: clip; }
.pause-img { position: absolute; inset: 0; }
.pause-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.pause::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #000 0, rgb(0 0 0 / .6) 24%, transparent 58%), linear-gradient(to top, #000 0, transparent 38%), linear-gradient(to bottom, #000 0, transparent 20%); }
.pause-line { position: absolute; z-index: 2; left: var(--pad); bottom: clamp(32px, 6vw, 96px); max-width: 9ch; font-family: var(--ff-display); font-weight: var(--fw-display); font-synthesis: none; font-size: clamp(40px, 7vw, 128px); line-height: .96; letter-spacing: -.014em; }

/* 03 свет: бюст во всю ширину, лампы управляются, текст прижат к низу слева */
.light { position: relative; min-height: 100svh; display: grid; align-items: end; padding: clamp(90px, 10vw, 150px) 0 clamp(50px, 6vw, 96px); overflow: clip; }
.light-stage { --lx: 34%; --ly: 24%; --kx: 70%; --ky: 78%; --iv: 1; --ig: 1; position: absolute; z-index: 0; right: -4vw; top: 50%; translate: 0 -50%; width: min(80vw, 1360px); }
.light-copy { position: relative; z-index: 2; display: grid; gap: 20px; justify-items: start; padding: 0 var(--pad); max-width: 560px; }
.light-copy h2 { font-size: clamp(38px, 4.8vw, 88px); }
.light-toggles { display: flex; gap: 26px; }
.tg { appearance: none; padding: 14px 6px 0 0; min-width: 96px; cursor: pointer; border: 0; border-top: 2px solid var(--c); background: transparent; color: var(--color-text); font: 500 14px/1 var(--ff-text); text-align: left; transition: color .3s, border-color .3s; }
.tg-v { --c: var(--light-violet); }
.tg-g { --c: var(--light-gold); }
.tg[aria-pressed="false"] { color: var(--color-text-muted); border-top-color: var(--line); }
.tg:hover { border-top-color: var(--c); }
.lb { position: relative; width: 100%; aspect-ratio: 2000 / 1493; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.lb-in { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 64%, transparent 98%); mask-image: linear-gradient(to bottom, #000 0, #000 64%, transparent 98%); }
.lb-img { position: absolute; inset: 0; width: 100%; height: 100%; filter: brightness(.5) saturate(.4) contrast(1.05); pointer-events: none; }
.lb-v, .lb-g { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; transition: opacity .7s ease; -webkit-mask: url("../../assets/bust-2000.webp") center / 100% 100% no-repeat; mask: url("../../assets/bust-2000.webp") center / 100% 100% no-repeat; }
.lb-v { opacity: var(--iv); background: radial-gradient(30% 36% at var(--lx) var(--ly), color-mix(in srgb, var(--light-violet) 78%, transparent), transparent 76%); }
.lb-g { opacity: var(--ig); background: radial-gradient(28% 34% at var(--kx) var(--ky), color-mix(in srgb, var(--light-gold) 68%, transparent), transparent 76%); }

/* 04 визит: огромное слово-контур, форма сплошной панелью */
.visit { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .8fr); gap: var(--pad); align-items: start; padding: clamp(110px, 12vw, 190px) var(--pad) clamp(120px, 14vw, 230px); overflow: clip; }
.visit-city { position: absolute; z-index: 0; left: -2vw; bottom: -3vw; margin: 0; font-family: var(--ff-display); font-weight: var(--fw-display); font-synthesis: none; font-size: clamp(120px, 24vw, 430px); line-height: .8; letter-spacing: -.02em; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--color-text) 15%, transparent); user-select: none; pointer-events: none; }
.visit-copy, .visit-form { position: relative; z-index: 1; }
.visit-copy { display: grid; gap: 22px; justify-items: start; }
.visit-copy h2 { font-size: clamp(40px, 6vw, 108px); }
.visit-copy p { max-width: 28ch; color: color-mix(in srgb, var(--color-text) 80%, transparent); }
.visit-form { background: var(--color-surface); border: 1px solid var(--line); padding: clamp(24px, 3vw, 44px); }
.visit-form form { display: grid; gap: 22px; }
.visit-form .small { font-size: 13px; color: var(--color-text-muted); justify-self: start; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; color: var(--color-text-muted); }
.field input { width: 100%; padding: 12px 0; background: transparent; border: 0; border-bottom: 1px solid var(--color-border-strong); border-radius: 0; color: var(--color-text); font: 400 18px/1.3 var(--ff-text); color-scheme: dark; transition: border-color .3s; }
.field input:focus { outline: none; border-bottom-color: var(--color-focus-ring); }
.field.is-bad input { border-bottom-color: var(--color-error); }
.err { display: none; font: 500 13px/1.4 var(--ff-text); color: var(--color-error); }
.err.show { display: flex; gap: 8px; align-items: baseline; }
.err.show::before { content: "!"; flex: none; width: 16px; height: 16px; display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font: 700 11px/1 var(--ff-text); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; cursor: pointer; font-size: 14px; line-height: 1.45; color: color-mix(in srgb, var(--color-text) 86%, transparent); }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.check .box { width: 20px; height: 20px; margin-top: 1px; border: 1px solid var(--color-border-strong); background: transparent; display: grid; place-items: center; transition: background-color .25s, border-color .25s; }
.check input:checked + .box { background: var(--color-primary); border-color: var(--color-primary); }
.check input:checked + .box::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--color-primary-foreground); border-bottom: 2px solid var(--color-primary-foreground); transform: translateY(-1px) rotate(-45deg); }
.check input:focus-visible + .box { outline: 2px solid var(--color-focus-ring); outline-offset: 3px; }
.check.is-bad .box { border-color: var(--color-error); }
.check a { text-underline-offset: 3px; }
.visit-done { display: grid; gap: 22px; justify-items: start; }
.visit-done[hidden], .visit-form form[hidden] { display: none; }
.visit-form.is-done { background: none; border-color: transparent; padding: 0; }

/* 03 после отправки форма превращается в билет «Запись принята» */
.tkw { position: relative; display: inline-block; max-width: 100%; filter: drop-shadow(0 26px 30px rgb(0 0 0 / .7)); transform: rotate(-1.6deg); transition: transform .7s var(--ease-out); }
.tkw:hover { transform: rotate(0deg) translateY(-4px); }
.tk { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); width: min(500px, 100%); background: linear-gradient(135deg, #1d1d25 0%, #121217 100%);
  -webkit-mask: radial-gradient(circle 12px at 96px 0, #0000 97%, #000), radial-gradient(circle 12px at 96px 100%, #0000 97%, #000); -webkit-mask-composite: source-in;
  mask: radial-gradient(circle 12px at 96px 0, #0000 97%, #000), radial-gradient(circle 12px at 96px 100%, #0000 97%, #000); mask-composite: intersect; }
.tk::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--light-violet), transparent 52%, var(--light-gold)); }
.tk-stub { display: grid; place-items: center; padding: 18px 0; border-right: 2px dashed rgb(244 245 250 / .22); min-width: 0; }
.tk-stub span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .2em; font-size: 11px; color: var(--color-text-muted); white-space: nowrap; max-height: 100%; }
.tk-body { display: grid; gap: 8px; padding: 22px clamp(18px, 2.4vw, 30px) 20px; min-width: 0; }
.tk-body > .mono { color: var(--color-text-muted); }
.tk-who { font-family: var(--ff-display); font-weight: var(--fw-display); font-synthesis: none; font-size: clamp(32px, 3.4vw, 48px); line-height: 1; word-break: break-word; }
.tk-date { color: var(--color-text); font-size: 11.5px; letter-spacing: .08em; }
.tk-perf { display: block; height: 0; border-top: 2px dashed rgb(244 245 250 / .22); margin: 4px -4px; }
.tk-sub { color: color-mix(in srgb, var(--color-text) 82%, transparent); font-size: 15px; }
.tk-stamp { position: absolute; right: -14px; top: -16px; width: 104px; height: 104px; border-radius: 50%; border: 2px solid var(--light-gold); display: grid; place-items: center; color: var(--light-gold); transform: rotate(14deg); background: rgb(0 0 0 / .55); opacity: 0; }
.tk-stamp::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--light-gold) 60%, transparent); }
.tk-stamp span { font: 400 11px/1 var(--ff-mono); letter-spacing: .22em; text-transform: uppercase; padding-left: .22em; }
.visit-done:not([hidden]) .tkw { animation: tk-drop .9s .1s var(--ease-out) both; }
.visit-done:not([hidden]) .tk-stamp { animation: tk-stamp .55s .85s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes tk-drop { 0% { transform: translateY(-70px) rotate(-8deg); opacity: 0; } 100% { transform: rotate(-1.6deg); opacity: 1; } }
@keyframes tk-stamp { 0% { transform: rotate(14deg) scale(2.2); opacity: 0; } 100% { transform: rotate(14deg) scale(1); opacity: 1; } }
button.link-u { background: none; border: 0; padding: 0 0 4px; cursor: pointer; font: 400 15px/1.2 var(--ff-text); }

@media (hover: none) {
  .manifest { background-image: linear-gradient(rgb(244 245 250 / .94), rgb(244 245 250 / .94)); }
  .niche { filter: none; scale: 1; }
}

@media (max-width: 1100px) {
  .visit { grid-template-columns: 1fr; }
  .visit-form { max-width: 560px; }
  .light-stage { width: 110vw; right: -8vw; top: 38%; }
}
@media (max-width: 900px) {
  .museum { grid-template-columns: 1fr; padding-top: clamp(90px, 22vw, 150px); }
  .manifest { grid-column: 1; }
  .manifest .m1 { font-size: clamp(38px, 12vw, 80px); }
  .manifest .m2 { margin-left: 0; font-size: clamp(22px, 6vw, 36px); }
  .mu-plate { grid-column: 1; grid-row: auto; width: 62%; margin: 40px 0 0 auto; }
  .halls { height: auto; }
  .halls-pin { position: static; height: auto; padding: 40px 0 70px; }
  .halls-track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--pad) 24px; transform: none !important; scroll-padding-left: var(--pad); }
  .niche { scroll-snap-align: start; width: min(76vw, 340px) !important; height: 430px !important; aspect-ratio: auto; scale: 1; filter: none; border-radius: 50vw 50vw 0 0; margin-top: 0 !important; }
  .n2, .n4 { margin-top: 28px !important; }
  .n3 .niche-txt { bottom: 0; padding: 0 20px 24px; text-align: left; justify-items: start; }
  .n3 .niche-pic { background-size: 300% auto; }
  .halls-line { max-width: 60vw; }
  .pause { height: 62vh; }
  .light { min-height: auto; padding-top: 70px; grid-template-columns: minmax(0, 100%); }
  .light-stage { position: relative; right: auto; top: auto; translate: none; width: 120vw; margin-left: -10vw; order: -1; }
  .light-copy { margin-top: -6vw; }
  .visit-city { font-size: 34vw; }
}
@media (prefers-reduced-motion: reduce) {
  .manifest { background-image: linear-gradient(rgb(244 245 250 / .94), rgb(244 245 250 / .94)); }
  .halls { height: auto; }
  .halls-pin { position: static; height: auto; padding: 40px 0 70px; }
  .halls-track { transform: none !important; overflow-x: auto; width: auto; }
  .niche { filter: none; scale: 1; }
}
