.moscow-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: start;
  min-height: clamp(350px, 34vw, 540px);
  overflow: hidden;
  margin-bottom: 15px;
  --city-night: 0;
  --city-fade-x: clamp(12px, 4%, 60px);
  --city-fade-y: clamp(24px, 10%, 64px);
  color: #fff;
}

.moscow-hero-art,
.moscow-hero-art img,
.moscow-hero-art::after,
.moscow-hero-glow { position: absolute; inset: 0; width: 100%; height: 100%; }

.moscow-hero-art {
  z-index: -1;
  background: #182235;
  mask-image:
    linear-gradient(90deg, transparent, #000 var(--city-fade-x), #000 calc(100% - var(--city-fade-x)), transparent),
    linear-gradient(transparent, #000 19px, #000 calc(100% - var(--city-fade-y)), transparent);
  mask-composite: intersect;
}

.moscow-hero-art img { object-fit: cover; object-position: 72% center; }
.moscow-hero-art::after {
  content: "";
  background: linear-gradient(110deg, #0a1021e0 0%, #0a102180 48%, transparent 80%);
}

:root[data-theme="dark"] .moscow-hero { --city-night: 1; }

.moscow-hero-night {
  opacity: var(--city-night);
  transition: opacity 3200ms cubic-bezier(.44, 0, .56, 1);
}

.moscow-hero-glow {
  background:
    radial-gradient(ellipse at 76% 48%, #f8bd6624, transparent 19%),
    radial-gradient(ellipse at 83% 79%, #ffa34025, transparent 26%);
  mix-blend-mode: screen;
  opacity: calc(var(--city-night) * .6);
  transition: opacity 3200ms cubic-bezier(.55, 0, .6, 1);
}
.moscow-hero-copy { padding: clamp(22px, 4vw, 64px); max-width: 760px; }
.app-shell .moscow-hero h1 {
  max-width: 12em;
  margin: 0 0 12px;
  color: #fff;
  font: 900 clamp(28px, 5.2vw, 68px)/1.06 "Bounded Site", sans-serif;
  text-wrap: balance;
}
.app-shell .moscow-hero p {
  margin: 0;
  max-width: 36ch;
  color: #fff;
  font: 400 clamp(13px, 1.55vw, 19px)/1.45 "Bounded Site", sans-serif;
}
.home-view:has(.moscow-hero) .hero-grid { margin-top: 0; }
@media (max-width: 700px) {
  .home-view .home-discovery .discovery-top-month-section .top-month-card {
    --rank-offset: 42px;
    flex-basis: max(158px, 16vw);
    --recommendation-height: clamp(120px, 10vw, 140px);
    height: var(--recommendation-height);
  }
  .home-view .home-discovery .discovery-top-month-section .top-month-poster { height: var(--recommendation-height); }
  .home-view .home-discovery .discovery-top-month-section .top-month-rank { font-size: clamp(105px, 9vw, 136px); }
}
@media(max-width:700px) {
  .moscow-hero { min-height: 320px; --city-fade-x: 10px; --city-fade-y: 36px; }
  .moscow-hero-art::after { background: linear-gradient(#0a1021eb, #0a10216e 49%, transparent 80%); }
  .moscow-hero-art img { object-position: 75% center; }
}
@media (prefers-reduced-motion: reduce) {
  .moscow-hero-night, .moscow-hero-glow { transition: none; }
}

/* Treat the city as atmosphere behind the home content. */
.moscow-hero {
  min-height: 0;
  overflow: visible;
  isolation: auto;
  margin-bottom: 0;
  color: #111318;
}

.moscow-hero .moscow-hero-art {
  inset: 12px -36px auto auto;
  width: min(79%, 1050px);
  height: clamp(350px, 40vw, 565px);
  background: transparent;
  opacity: .62;
  mask-image:
    radial-gradient(ellipse at 79% 35%, #000 15%, #000b 40%, #0004 60%, transparent 86%),
    linear-gradient(to bottom, transparent, #000 12px, #000 70%, transparent),
    linear-gradient(to right, transparent, #000 34%);
  mask-composite: intersect;
  pointer-events: none;
}

.moscow-hero-art::after { content: none; }
.moscow-hero-art img { object-position: 82% center; }
.moscow-hero-copy {
  padding: clamp(8px, 1.2vw, 18px) 0 18px;
  max-width: min(58%, 730px);
}

.app-shell .moscow-hero :is(h1, p) { color: inherit; }
:root[data-theme="dark"] .moscow-hero { color: #f6f5f2; }
:root[data-theme="dark"] .moscow-hero .moscow-hero-art { opacity: .7; }

@media (max-width: 700px) {
  .moscow-hero-copy { max-width: 100%; padding: 20px 0 18px; }
  .moscow-hero .moscow-hero-art {
    inset: 10px -38px auto auto;
    width: min(116%, 590px);
    height: 310px;
    opacity: .28;
    mask-image:
      radial-gradient(ellipse at 83% 36%, #000 17%, #000b 37%, #0003 61%, transparent 83%),
      linear-gradient(to bottom, transparent, #000 10px, #000 70%, transparent);
    mask-composite: intersect;
  }
  :root[data-theme="dark"] .moscow-hero .moscow-hero-art { opacity: .38; }
  .app-shell .moscow-hero h1 { max-width: 11em; }
}

@media (max-width: 700px) {
  .home-view .discovery-top-month-section :is(.top-month-poster-category, .top-month-favorite) {
    display: none;
  }

  .venue-view .venue-cover-favorite { display: block; }
}

.moscow-hero-description-mobile { display: none; }

@media (max-width: 700px) {
  .moscow-hero-description { display: none; }
  .app-shell .moscow-hero .moscow-hero-description-mobile {
    display: block;
    max-width: none;
    font-size: clamp(12px, 3.25vw, 15px);
    text-wrap: balance;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .app-shell:has(.moscow-hero) { transition: background-color 550ms ease; }
  .moscow-hero { transition: color 550ms ease; }
  .moscow-hero .moscow-hero-art { transition: opacity 900ms ease; }
}

.moscow-hero .moscow-hero-art {
  --sky-extension: 10px;
  width: min(79%, 1050px);
  height: calc(clamp(350px, 40vw, 565px) + var(--sky-extension));
}
/* Fade the photo itself: an opaque sky strip above it creates a seam. */
.moscow-hero-art img {
  top: var(--sky-extension);
  height: calc(100% - var(--sky-extension));
  /* Match the photograph's crop so the opaque silhouette follows the spire. */
  mask-image: url("/brand/moscow-day-contour.png");
  mask-size: cover;
  mask-position: 82% center;
  mask-repeat: no-repeat;
}
@media (max-width: 700px) {
  .moscow-hero .moscow-hero-art {
    --sky-extension: 6px;
    width: min(116%, 590px);
    height: calc(310px + var(--sky-extension));
  }
}

.moscow-hero-art .moscow-hero-night {
  mask-image: none;
}
.moscow-hero-art img:first-child {
  opacity: calc(1 - var(--city-night));
}
@media (prefers-reduced-motion: no-preference) {
  .moscow-hero-art img:first-child {
    transition: opacity 3200ms cubic-bezier(.44, 0, .56, 1);
  }
}
@media (max-width:700px) {
  .home-view .home-discovery .discovery-top-month-section .top-month-details {
    left:calc(var(--rank-offset) + 5px); right:4px; bottom:7px;
  }
  .home-view .home-discovery .discovery-top-month-section .top-month-details h3 {
    font-size:12px; line-height:1.12; white-space:normal; overflow-wrap:normal; word-break:normal; hyphens:none;
    display:block; max-height:none;
  }
}

@media (max-width:700px) {
  .home-view .home-discovery .discovery-top-month-section .top-month-details {
    top:8px;
    bottom:auto;
  }
  .home-view .home-discovery .discovery-top-month-section .top-month-poster::after {
    inset:0;
    background:linear-gradient(to bottom,rgba(12,10,12,.73),rgba(12,10,12,.38) 33%,transparent 70%);
  }
}
@media (max-width:700px) and (prefers-reduced-motion:no-preference) {
  .home-view .discovery-top-month-section .top-month-poster .reference-photo {
    transition:transform 420ms cubic-bezier(.2,.75,.25,1);
  }
  .home-view .discovery-top-month-section .top-month-poster:is(:active,:focus-visible) .reference-photo {
    transform:scale(1.055);
    transition-duration:160ms;
  }
}
@media (max-width:700px) and (hover:hover) and (prefers-reduced-motion:no-preference) {
  .home-view .discovery-top-month-section .top-month-card:hover .top-month-poster {transform:none}
  .home-view .discovery-top-month-section .top-month-poster:hover .reference-photo {transform:scale(1.055)}
}

.home-view .discovery-top-month-section .top-month-card .top-month-rank {
  font-family:"Bounded Site",sans-serif !important;
  font-weight:900 !important;
  font-synthesis:none;
}
/* Anchor both numeral layers to the photograph, independent of glyph width. */
.home-view .home-discovery .discovery-top-month-section .top-month-card {
  --rank-size:96px;
  --rank-top:28px;
  --rank-overlap:10px;
  --rank-offset:94px;
  flex-basis:334px;
}
.home-view .home-discovery .discovery-top-month-section .top-month-card .top-month-rank {
  font-size:var(--rank-size) !important;
  top:var(--rank-top) !important;
  left:auto !important;
  right:calc(100% - var(--rank-overlap));
  width:max-content;
  transform:scaleX(.78) !important;
  transform-origin:right center;
}
@media (max-width:700px) {
  .home-view .home-discovery .discovery-top-month-section .top-month-card {
    --rank-size:49px;
    --rank-top:11px;
    --rank-overlap:7px;
    --rank-offset:60px;
    flex-basis:176px;
  }
}
