@import url('tokens.css');
:root { color-scheme: light; }
* { box-sizing: border-box; }
html { background: #e7e6dc; scrollbar-width: none; scroll-padding-top: 72px; }
body { margin: 0; color: var(--ink); font-family: var(--font-mono); font-weight: 400; -webkit-font-smoothing: antialiased; }
p, h1, figure { margin: 0; }
.screen {
  --vertical-trim: max(0px, calc((844px - 100svh) / 8));
  width: 100%;
  margin-inline: auto;
  background: var(--paper);
  overflow: clip;
  display: flex;
  flex-direction: column;
}
.segments { display: flex; gap: 5px; padding: 3px var(--frame-gutter) 0; height: 60px; flex: 0 0 auto; }
.segments a { display: flex; align-items: center; height: 43px; flex: 1; min-width: 0; }
.segments span { display: block; height: 3px; width: 100%; background: var(--progress-idle); }
.segments .segment-pending { flex: 1; min-width: 0; margin-top: 20px; }
.segments span::after { content: ''; display: block; height: 100%; background: var(--progress-complete); transform: scaleX(var(--fill, 0)); transform-origin: left center; }
.segments a[aria-current='step'] span::after { background: var(--ink); transform: scaleX(var(--fill, 1)); }
.segments:has(a[data-theme='dark'][aria-current='step']) { --ink: var(--stage-progress-current); background: var(--stage); }
.segments:has(a[data-theme='dark'][aria-current='step']) span::after { background: var(--stage-progress-complete); }
.segments:has(a[data-theme='dark'][aria-current='step']) a[aria-current='step'] span::after { background: var(--ink); }
.segments a:focus-visible, .chapter-contact:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.story-track { display: flex; flex-direction: column; }
.story-track:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.story-panel { min-width: 0; overflow: clip; }
#cover, #about, #theatre, #discover, #together { overflow: clip; }
.story-panel:focus { outline: none; }
.cover-layout { display: flex; flex-direction: column; height: 100%; }
.about-copy { flex-shrink: 0; padding: 0 var(--frame-gutter); font-size: var(--body-size); line-height: var(--body-leading); }
.about-copy h2, .editorial-copy h2 {
  margin: 0;
  font-size: var(--heading-size);
  line-height: 1;
  font-weight: 500;
}
.about-copy h2 { margin-inline-start: 10px; }
.about-places { display: grid; gap: max(10px, calc(26px - var(--vertical-trim))); margin: max(23px, calc(44px - var(--vertical-trim))) 0 0 calc(19.3% - 8px); }
.about-ending { max-width: 326px; margin-top: max(15px, calc(54px - var(--vertical-trim) * 1.4)); }
.about-copy strong { font-weight: 600; }
.photo-marker {
  --marker-angle: 4deg;
  position: relative;
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-inline: -3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  vertical-align: -2px;
  cursor: pointer;
}
.photo-marker::before { content: ''; position: absolute; inset: -24px -5px -8px; }
.photo-marker span {
  position: absolute;
  display: grid;
  place-items: center;
  inset: auto auto 0 50%;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  transform: translateX(-50%) rotate(var(--marker-angle));
  pointer-events: none;
}
.photo-marker span::before { content: ''; width: 7px; height: 7px; background: currentColor; }
.about-places p:nth-child(2) .photo-marker { --marker-angle: -9deg; --marker-delay: 220ms; }
.about-places p:nth-child(3) .photo-marker { --marker-angle: -3deg; --marker-delay: 440ms; }
#about:not([inert]) .photo-marker span::before { animation: marker-shimmer 2s ease-in-out var(--marker-delay, 0s) infinite; }
@keyframes marker-shimmer { 50% { opacity: .28; } }
.photo-marker:hover span, .photo-marker:focus-visible span { background: #e4e2d3; }
.photo-marker:focus-visible { outline: none; }
.photo-marker:focus-visible span, .photo-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
.photo-dialog { width: min(78vw, 340px, 68svh); max-width: none; max-height: none; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.photo-dialog::backdrop { background: rgb(37 38 34 / 55%); animation: photo-backdrop 440ms ease both; }
.photo-dialog-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.photo-dialog-body { position: relative; aspect-ratio: 1; background: #141411; overflow: hidden; transform: rotate(var(--viewer-angle)); }
.photo-dialog-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-dialog-media:not([hidden]) { display: block; }
.photo-dialog[open] .photo-dialog-media:not([hidden]) { animation: photo-backdrop 320ms 80ms ease both; }
.photo-close { position: absolute; inset: -22px -22px auto auto; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ink); background: var(--paper); color: inherit; font: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
@keyframes photo-backdrop { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #about:not([inert]) .photo-marker span::before, .photo-dialog::backdrop,
  .photo-dialog[open] .photo-dialog-media:not([hidden]) { animation: none; }
}
@media (max-width: 359px) { .about-copy { font-size: 13px; } }
.chapter { display: grid; align-content: start; gap: 22px; padding: 32px 24px; line-height: 1.55; }
.chapter-label { font-size: 12px; }
.chapter h2 { margin: 0; font-size: clamp(23px, 6.5vw, 29px); font-weight: 600; line-height: 1.15; text-wrap: balance; }
.chapter p:not(.chapter-label) { font-size: 14px; }
.chapter img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.chapter-contact { color: inherit; text-underline-offset: 4px; }
.collage { position: relative; width: 100%; flex: 0 1 auto; min-height: 0; isolation: isolate; }
#cover .collage {
  --side-angle: 3.3deg;
  aspect-ratio: 390 / 398;
  max-height: max(145px, calc(100dvh - 300px));
  container-type: inline-size;
}
.print { position: absolute; overflow: hidden; transform: rotate(var(--photo-angle)); }
.print img, .print video { width: 100%; height: 100%; display: block; object-fit: cover; }
.print img, .print video, .chapter img, .photo-dialog-media {
  filter: contrast(var(--photo-contrast, .87)) saturate(.78)
    sepia(var(--photo-warmth, .25)) hue-rotate(5deg) brightness(var(--photo-light, .97));
}
.photo--snow { --photo-contrast: .92; --photo-warmth: .12; --photo-light: 1.01; }
#cover .print, .collage-stack .print { width: 65.5%; height: 85.6%; }
.print--placeholder, .print--back { --photo-angle: 1deg; left: .7%; top: 4.9%; z-index: 1; background: #000; }
.print--tea, .print--right { --photo-angle: var(--side-angle, 3.3deg); left: 13.8%; top: 2.45%; z-index: 2; }
.print--winter, .print--slanted {
  --photo-angle: -9deg;
  left: 7.9%;
  top: calc(7.2% + 7px);
  /* На низкой обложке правый угол остаётся ниже края заднего фото. */
  top: max(calc(7.2% + 7px), calc(1.5% + 6.7cqw + 2px));
  z-index: 3;
}
.print--theatre, .print--front { --photo-angle: -3.3deg; left: 4.4%; top: 10.9%; z-index: 4; }
.collage--museum { flex: 1 1 350px; max-height: 350px; margin: max(12px, calc(28px - var(--vertical-trim))) 0 18px; container-type: size; }
.collage-stack { position: absolute; top: 0; left: 50%; width: min(100cqw, calc(100cqh * 390 / 398)); aspect-ratio: 390 / 398; transform: translateX(-50%); container-type: inline-size; }
.story-panel--dark { --ink: var(--stage-ink); background: var(--stage); color: var(--ink); }
.editorial-copy { flex-shrink: 0; padding: 0 var(--frame-gutter); font-size: var(--body-size); line-height: var(--body-leading); }
.editorial-copy p { margin: max(14px, calc(39px - var(--vertical-trim))) 0 0; }
.editorial-copy p + p { margin-top: max(10px, calc(20px - var(--vertical-trim))); }
.editorial-copy strong { font-weight: 600; }
.theatre-image { position: relative; flex: 0 1 355px; min-height: 0; margin: max(34px, calc(80px - var(--vertical-trim) * 2)) 0 25px; }
.theatre-image img { display: block; position: absolute; left: -5%; width: 110%; height: 100%; object-fit: cover; object-position: 54% center; transform: rotate(-9deg); filter: var(--stage-photo-filter); mix-blend-mode: lighten; }
.story-panel--dark .signature, .story-panel--dark .contact-icon { filter: invert(1); }
@media (max-width: 359px) { .editorial-copy { font-size: 13px; } }
@media (max-width: 359px) { #discover-title { font-size: 28px; } }
#cover-title { position: absolute; right: 10%; top: 5.5%; z-index: 5; writing-mode: vertical-rl; font-family: var(--font-mono); font-size: clamp(16px, 4.3dvh, 22.5px); font-weight: 400; line-height: 1; letter-spacing: 0; white-space: nowrap; transform: rotate(var(--side-angle)); transform-origin: top left; }
.collage-toggle {
  position: absolute;
  z-index: 5;
  left: 15px;
  bottom: 29px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.collage-toggle:not([hidden]) { display: grid; place-items: center; }
.collage-toggle span { display: grid; place-items: center; width: 24px; height: 24px; background: var(--paper); }
.collage-toggle span::before { content: ''; width: 8px; height: 10px; border-inline: 2px solid currentColor; }
.collage-toggle[data-paused] span::before { width: 0; height: 0; border: 5px solid transparent; border-left: 8px solid currentColor; border-right: 0; }
.collage-toggle:focus-visible { outline: 2px solid var(--paper); outline-offset: -5px; }
.details { flex-shrink: 0; padding: max(30px, calc(44px - var(--vertical-trim))) var(--frame-gutter) 0; }
.caption { font-size: var(--body-size); line-height: var(--body-leading); font-weight: 600; letter-spacing: 0; }
.intro { margin-top: max(10px, calc(35px - var(--vertical-trim))); font-size: var(--body-size); line-height: var(--body-leading); letter-spacing: 0; }
.footer { display: flex; flex-shrink: 0; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: auto; padding: max(10px, calc(32px - var(--vertical-trim))) var(--frame-gutter) max(12px, env(safe-area-inset-bottom), calc(18px - var(--vertical-trim) / 3)); }
.signature { display: block; width: 39px; height: auto; }
.contact { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; width: 158px; height: 27px; flex: 0 0 auto; border: 1px solid var(--ink); color: inherit; text-decoration: none; font-size: var(--contact-size); line-height: 25px; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* Плашка 27px из макета; зона касания расширена до 45px. */
.contact::before { content: ''; position: absolute; inset: -9px 0; }
.contact-icon { display: block; flex: 0 0 14px; }
.contact:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
@media (min-width: 600px) {
  .screen { width: 390px; box-shadow: 0 12px 48px #33332212; }
}
@media (max-height: 580px) {
  .segments { height: 44px; }
  .about-copy, .editorial-copy { font-size: 12px; }
  .about-places { margin-inline-start: 0; gap: 8px; }
  .about-places br { display: none; }
  .about-ending { margin-top: 10px; }
}
@media (max-width: 359px) { .intro { font-size: 13px; } .caption { font-size: 13px; } }
@media (max-height: 500px) { .about-ending { margin-top: 2px; } }
