@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/cormorant-garamond-cyrillic.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/cormorant-garamond-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.portrait-page {
  --poster-type: "Cormorant Garamond", Georgia, serif;
  --gallery-family: var(--poster-type);
  --font-semibold: var(--font-medium);
  --type-body-size: 1.25rem;
  --type-body-leading: 1.42;
  --type-small-size: 1.125rem;
  --type-caption-size: 1rem;
  --type-action-size: 1.125rem;
  --type-eyebrow-size: 1rem;
  --type-h3-size: clamp(1.25rem, 2vw, 1.5rem);
  --surface-page: #f7f3eb;
  --surface-section-light: #fcfaf7;
  --section-fade-length: var(--space-40);
  --surface-selection: #ead5d6;
  --text-primary: #282321;
  --text-secondary: #60554d;
  --text-action: #a12236;
  --text-link-hover: var(--text-action);
  --stroke-subtle: #d8cfc1;
  --focus-color: var(--text-action);
  --header-height: 68px;
  --header-height-compact: 60px;
}

.portrait-page .site-header { position: relative; z-index: 2; }
.portrait-page :is(.site-header, .gallery-footer) .wordmark {
  color: #1b2c36;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: var(--font-regular);
  letter-spacing: .17em;
}
.portrait-page .header-actions {
  display: flex;
  align-items: center;
}

.portrait-page .header-icon {
  display: grid;
  place-items: center;
  width: var(--control-min-height);
  height: var(--control-min-height);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.portrait-page .header-icon svg {
  width: 19px;
  height: 19px;
}

.portrait-page .header-icon:is(:hover, :active) { color: var(--text-link-hover); }


.portrait-page :is(.desktop-nav a, .mobile-nav a, .locale-switch button, .menu-button) {
  font-size: 1.125rem;
  font-weight: var(--font-medium);
}

.portrait-page :is(.desktop-nav, .mobile-nav) a:is(:hover, :active, [aria-current="page"], [aria-current="location"]),
.portrait-page .locale-switch button:is(:hover, :active, [aria-pressed="true"]) {
  color: var(--text-link-hover);
}

.portrait-page .locale-switch button[aria-pressed="true"] { text-decoration: none; }

.poster {
  position: relative;
  isolation: isolate;
  min-height: clamp(590px, calc(100svh - var(--header-height) - 1px), 940px);
  --poster-red: #b52d25;
}

.poster-image {
  position: absolute;
  inset: clamp(72px, 9.5svh, 92px) 0 0;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-items: end;
  pointer-events: none;
}

.poster-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center bottom;
}

.poster-title {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
  color: var(--poster-red);
  font: 500 clamp(6rem, 10.7vw, 12.1rem) / .83 var(--poster-type);
  letter-spacing: -.042em;
  text-transform: uppercase;
}

.poster-title > span {
  position: absolute;
  display: block;
  width: max-content;
  max-width: 100%;
}

.poster-first {
  inset: clamp(22px, 3.5svh, 42px) auto auto 0;
  z-index: 0;
  font-size: .91em;
}

.poster-last {
  inset: auto 0 clamp(30px, 5.4svh, 68px) auto;
  text-align: right;
  line-height: .80;
}

.poster-last-back { z-index: 0; }
.poster-last-front { z-index: 2; }
.poster-last > span { display: block; }

/* Give the line behind the portrait enough room to stay readable at the edge of the hair. */
.poster-last > span:first-child { font-size: .9em; line-height: .8889; }
.poster-last-accent {
  width: max-content;
  margin-inline-start: auto;
  clip-path: inset(0 calc(100% - .49em) 0 0);
}
:lang(ru) .poster-last-accent { clip-path: inset(0 calc(100% - 1.28em) 0 0); }
.poster-last-back > span:last-child { opacity: 0; }

.poster-welcome {
  position: absolute;
  z-index: 2;
  inset-block-start: clamp(106px, 15svh, 146px);
  inset-inline-end: 0;
  width: clamp(11rem, 20vw, 19rem);
  color: var(--text-secondary);
  font: 500 clamp(1.25rem, 1.6vw, 1.45rem) / 1.14 var(--poster-type);
  letter-spacing: -.012em;
  text-indent: .9em;
}

.poster-action {
  position: absolute;
  z-index: 2;
  inset: auto auto clamp(28px, 5.4svh, 68px) 0;
  display: grid;
  place-items: center;
  width: clamp(132px, 11.8vw, 175px);
  aspect-ratio: 1;
  color: var(--text-action);
  border-radius: 50%;
}

.catalog-ring, .catalog-arrow { grid-area: 1 / 1; }

.catalog-ring {
  width: 100%;
  overflow: visible;
  fill: currentColor;
  font-size: 14px;
  font-weight: var(--font-medium);
  transform-origin: center;
  animation: catalog-rotation 28s linear infinite;
}

.catalog-arrow { width: 25%; }

.poster-action:hover .catalog-ring,
.poster-action:focus-visible .catalog-ring { animation-play-state: paused; }

@keyframes catalog-rotation { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: no-preference) {
  .portrait-page {
    --intro-easing: cubic-bezier(.22, 1, .36, 1);
    --intro-catalog-delay: 1120ms;
    --intro-catalog-duration: 620ms;
    --intro-lead-offset: -30px;
    --intro-end-offset: 26px;
    --intro-caption-offset: 10px;
    --intro-portrait-scale: 1.015;
  }

  .portrait-page .site-header { animation: poster-enter 460ms var(--intro-easing) backwards; }

  .poster-first {
    --intro-x: var(--intro-lead-offset);
    animation: poster-enter 800ms var(--intro-easing) 100ms backwards;
  }

  .poster-image img {
    --intro-scale: var(--intro-portrait-scale);
    transform-origin: center bottom;
    animation: poster-enter 1000ms var(--intro-easing) 260ms backwards;
  }

  /* Both halves of the lower title follow one timeline across the portrait. */
  .poster-last {
    --intro-x: var(--intro-end-offset);
    animation: poster-enter 800ms var(--intro-easing) 580ms backwards;
  }

  .poster-welcome {
    --intro-y: var(--intro-caption-offset);
    animation: poster-enter 660ms var(--intro-easing) 880ms backwards;
  }

  .poster-action {
    animation: poster-enter var(--intro-catalog-duration) var(--intro-easing) var(--intro-catalog-delay) backwards;
  }

  .catalog-ring { animation-delay: calc(var(--intro-catalog-delay) + var(--intro-catalog-duration)); }
}

@keyframes poster-enter {
  from {
    opacity: 0;
    transform: translate(var(--intro-x, 0), var(--intro-y, 0)) scale(var(--intro-scale, 1));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1020px) {
  .poster { min-height: clamp(570px, calc(100svh - var(--header-height) - 1px), 900px); }
  .poster-image { inset-block: 65px 126px; }
  .poster-title { font-size: clamp(4.65rem, 13.8vw, 8.25rem); }
  .poster-first { inset-block-start: 12px; }
  .poster-last { inset-block-end: 124px; }
  .poster-welcome { inset-block-start: 94px; width: 10rem; }
  .poster-action { inset-block-end: 25px; }
}

@media (max-width: 760px) {
  .portrait-page {
    --type-body-size: 1.1875rem;
    --intro-lead-offset: -10px;
    --intro-end-offset: 8px;
    --intro-caption-offset: 4px;
    --intro-portrait-scale: 1;
  }
}

@media (max-width: 900px) {
  .portrait-page .header-row {
    min-height: var(--header-height-compact);
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-08);
  }

  .portrait-page .desktop-nav { display: none; }
  .portrait-page .menu-button { display: inline-flex; }
  .portrait-page .header-tools > .locale-switch { display: none; }
  .portrait-page .header-tools .header-actions { order: 0; }
  .portrait-page .header-tools .menu-button { order: 1; }

  .portrait-page .mobile-nav:not([hidden]) {
    display: grid;
    position: absolute;
    inset: 100% 0 auto;
    width: 100%;
    padding-inline: var(--layout-gutter);
    background: var(--surface-page);
    border-bottom: 1px solid var(--stroke-subtle);
    max-block-size: calc(100dvh - var(--header-height-compact));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .portrait-page :is(.site-header, .gallery-footer) .wordmark {
    font-size: 1rem;
    letter-spacing: .12em;
    white-space: normal;
  }
  .portrait-page .mobile-nav {
    padding-block: var(--space-04) var(--space-12);
    border-top: var(--divider-width) solid var(--stroke-subtle);
  }
  .portrait-page .mobile-nav a {
    display: flex;
    min-height: var(--control-menu-row);
  }
  .portrait-page .mobile-nav .desktop-nav {
    display: grid;
    gap: 0;
    min-width: 0;
  }
  .portrait-page .mobile-nav > .locale-switch {
    justify-self: start;
    padding-block: var(--space-08) var(--space-04);
  }
  .portrait-page .header-tools { gap: var(--space-08); }
  .portrait-page .header-icon { width: var(--control-min-height); }
}

@media (max-width: 450px) {
  .portrait-page .header-row {
    --layout-gutter: 16px;
    gap: 6px;
  }
  .portrait-page :is(.site-header, .gallery-footer) .wordmark {
    font-size: clamp(.8rem, 3.62vw, .93rem);
    letter-spacing: .105em;
    white-space: nowrap;
  }
  .portrait-page .header-tools { gap: var(--space-04); }
  .portrait-page .header-tools .locale-switch { gap: 4px; }
  .portrait-page .menu-button {
    width: 36px;
    justify-content: center;
    padding: 0;
  }
  .portrait-page .menu-button [data-ru] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 375px) {
  .portrait-page .site-header .wordmark {
    font-size: .75rem;
    letter-spacing: .08em;
  }
}

@media (max-width: 350px) {
  .portrait-page .header-row { --layout-gutter: 10px; gap: var(--space-04); }
  .portrait-page .site-header .wordmark { letter-spacing: .04em; }
  .portrait-page .header-tools { gap: 3px; }
  .portrait-page .header-tools .locale-switch button { min-width: 27px; padding-inline: 2px; }
  .portrait-page .header-icon { width: 36px; }
}

@media (max-width: 590px), (max-width: 740px) and (orientation: landscape) and (max-height: 480px) {
  .poster {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    --portrait-height: clamp(420px, calc(125vw + 44px), 580px);
    grid-template-rows: var(--portrait-height) auto;
  }
  .poster-image {
    inset: clamp(45px, 13vw, 71px) -15px auto;
    height: calc(var(--portrait-height) - 78px);
  }
  .poster-title { height: var(--portrait-height); font-size: clamp(2.25rem, 14.4vw, 5.4rem); }
  .poster-first { inset: 17px auto auto 0; }
  .poster-last { inset: auto 0 22px auto; }
  .poster-last-back > span:first-child { opacity: 0; }
  .poster-last-front .poster-last-accent { clip-path: none; }
  .poster-welcome {
    position: static;
    grid-area: 2 / 1;
    width: auto;
    max-width: 25ch;
    align-self: start;
    margin-block-start: 12px;
    margin-inline-start: 9.25rem;
    text-indent: 0;
  }
  .poster-action {
    position: static;
    grid-area: 2 / 1;
    justify-self: start;
    margin-block: 0 16px;
  }
}

@media (max-width: 350px) {
  .poster-welcome { font-size: 1.125rem; }
}

@media (max-width: 740px) and (orientation: landscape) and (max-height: 480px) {
  .poster { --portrait-height: clamp(245px, calc(100svh - 55px), 340px); }
  .poster-image { inset-block-start: 32px; height: calc(var(--portrait-height) - 50px); }
  .poster-title { font-size: clamp(2.7rem, 10vw, 4.25rem); }
  .poster-last { inset-block-end: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-ring { animation: none; }
}

@media (forced-colors: active) {
  .poster-title span { color: CanvasText; background: Canvas; }
}
