*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  /* overflow-x не на html/body: иначе Safari/Chromium схлопывают
     scrollport и обрезают низ длинного hero (004). */
}

:root {
  --object-card-width: min(428px, 100vw);
  --object-card-open-duration: 480ms;
  --object-card-swap-duration: 360ms;
  --object-card-easing: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-zoom-scale: 1;
  --hero-zoom-ox: 50%;
  --hero-zoom-oy: 50%;
  --hero-zoom-duration: 320ms;
}

.frame {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-inline-end: 0;
  overflow-x: hidden;
  transition: padding-inline-end var(--object-card-open-duration) var(--object-card-easing);
}

.frame[data-card-state="open"] {
  padding-inline-end: var(--object-card-width);
}

.object-card {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 3;
  width: var(--object-card-width);
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  transform: translateX(100%);
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  line-height: normal;
  transition: transform var(--object-card-open-duration) var(--object-card-easing);
  will-change: transform;
}

.object-card[hidden] {
  display: none;
}

.object-card[data-motion-state="opening"],
.object-card[data-motion-state="open"] {
  transform: translateX(0);
}

.object-card__content {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
}

.object-card__article {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 30px 30px;
  scrollbar-color: #000 transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  overscroll-behavior: contain;
  transform: translateX(0);
  background: #fff;
}

.object-card__article[data-card-page-state="entering"] {
  z-index: 1;
  transform: translateX(100%);
}

.object-card__article[data-card-page-state="incoming"] {
  z-index: 1;
  transform: translateX(0);
  transition: transform var(--object-card-swap-duration) var(--object-card-easing);
}

.object-card__article::-webkit-scrollbar {
  width: 3px;
}

.object-card__article::-webkit-scrollbar-track {
  background: transparent;
}

.object-card__article::-webkit-scrollbar-thumb {
  background: #000;
  border-radius: 0;
}

.object-card__date {
  margin: 0 0 9px;
  color: #d3184b;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.object-card__title {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 500;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

.object-card__media {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 18px;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
}

.object-card__video {
  object-fit: cover;
  background: #eee;
}

.object-card__description {
  margin: 0 0 24px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
}

.object-card__description:last-child {
  margin-bottom: 0;
}

.hero {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: 0;
  flex: 0 0 auto;
}

/* 017: map zoom around Pointer — separate from 011 layer pulse transforms */
.hero__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  line-height: 0;
  transform: scale(var(--hero-zoom-scale));
  transform-origin: var(--hero-zoom-ox) var(--hero-zoom-oy);
  transition: transform var(--hero-zoom-duration) ease-out;
}

.hero__hits {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__hit {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hero__selection {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.hero__selection[hidden] {
  display: none;
}

.hero__selection-pair {
  position: absolute;
  inset: 0;
  /* Single-slot path (014/018): visible when unhidden. Dual-pair fade (011)
     can override via inline opacity when restored. */
  opacity: 1;
}

.hero__selection-pair[hidden] {
  display: none;
}

.hero__selection-layer {
  position: absolute;
  max-width: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.hero__selection-layer--vector {
  z-index: 0;
  transform-origin: center center;
}

.hero__selection-layer--pointer {
  z-index: 1;
}

/* 011: cyclic layer motion — shared period; Vector scale, Pointer translateY */
.hero__selection-pair--motion .hero__selection-layer--vector {
  animation: selection-vector-pulse 1.8s ease-in-out infinite;
}

.hero__selection-pair--motion .hero__selection-layer--pointer {
  animation: selection-pointer-bob 1.8s ease-in-out infinite;
}

@keyframes selection-vector-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Phase: at Vector max (50%) Pointer is at base (0) */
@keyframes selection-pointer-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-6px);
  }
  75% {
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .frame,
  .object-card,
  .object-card__article[data-card-page-state="incoming"],
  .hero__stage,
  .launch-chrome.is-main {
    transition: none;
  }

  .hero__selection-pair--motion .hero__selection-layer--vector,
  .hero__selection-pair--motion .hero__selection-layer--pointer {
    animation: none;
  }

  .hero__selection-pair {
    transition: none !important;
  }
}

/* 009: crop+center между mobile-format и natural width; границы — scale */
@media (min-width: 441px) and (max-width: 2325px) {
  .hero {
    width: 2326px;
  }
}

.hero__tile {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  -webkit-user-drag: none;
  user-select: none;
}

/*
 * 019/032: launch = same H2 surface, CSS scale (stronger than fit-width).
 * --launch-scale = fit-width × 1.35 → enlarged top fragment; sides crop.
 * Natural width 2326 (K-13). Morph 022 reads computed scale via WAAPI.
 * Hooks: html.is-launch / [data-launch]; exit via JS.
 */
html.is-launch {
  /* ponytail: 1.35× fit-width until Figma 951:12464 exact coeff re-synced. */
  --launch-scale: calc(100vw / 2326px * 1.35);
}

html.is-launch,
html.is-launch body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

html.is-launch .frame {
  height: 100%;
  overflow: hidden;
}

html.is-launch .hero {
  width: 2326px;
  /* Avoid flex stretch squashing cross-size to viewport (breaks 022 morph). */
  align-self: flex-start;
  height: auto;
  transform: scale(var(--launch-scale));
  transform-origin: top center;
}

html.is-launch .hero__hits,
html.is-launch .object-card {
  pointer-events: none;
}

/*
 * 020/032-2: launch chrome (logo + static loader). Fixed to viewport — outside
 * scaled .hero. SoT Figma 2319:32500 @ 1728×812; sizes/offsets via vw/vh.
 */
.launch-chrome {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: block;
  margin: 0;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
}

.launch-chrome[hidden] {
  display: none;
}

.launch-chrome.is-visible {
  opacity: 1;
}

.launch-chrome__logo,
.launch-chrome__loader {
  display: block;
  max-width: none;
}

/* Launch pose only — morph sets inline fixed; is-main uses flex strip below. */
html.is-launch .launch-chrome:not(.is-morphing):not(.is-main) .launch-chrome__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100vw * 444 / 1728);
  height: auto;
  transform: translate(-50%, -50%);
}

html.is-launch .launch-chrome:not(.is-morphing):not(.is-main) .launch-chrome__loader {
  position: absolute;
  left: 50%;
  top: calc(50% + 100vh * 322 / 812);
  width: calc(100vw * 56 / 1728);
  height: calc(100vw * 56 / 1728);
  transform: translate(-50%, -50%);
}

.launch-chrome__logo {
  width: calc(100vw * 444 / 1728);
  height: auto;
  overflow: visible;
}

.launch-chrome__loader {
  width: calc(100vw * 56 / 1728);
  height: calc(100vw * 56 / 1728);
}

/* During WAAPI morph children are position:fixed; keep overlay opaque. */
.launch-chrome.is-morphing {
  transition: none;
  opacity: 1;
}

/*
 * 022 end pose / reduced-motion cut: logo parked (Figma 732:20679).
 * 023: fixed vertical (padding-top 76); horizontal couples to frame
 * data-card-state via :has — chrome is a preceding sibling of .frame.
 */
.launch-chrome.is-main {
  /* Logo strip only — do not keep inset:0 overlay after morph (blocks tools / hits). */
  display: flex;
  flex-direction: column;
  align-items: center;
  inset: auto;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  height: auto;
  justify-content: flex-start;
  padding-top: 76px;
  gap: 0;
  opacity: 1;
  transform: translateX(0);
  transition: transform var(--object-card-open-duration) var(--object-card-easing);
}

body:has(.frame[data-card-state="open"]) .launch-chrome.is-main {
  transform: translateX(calc(-0.5 * var(--object-card-width)));
}

.launch-chrome.is-main .launch-chrome__logo {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  width: 214px;
  height: auto;
}

/* 032: anniversary subtitle gone in main (wordmark only @ 023 pose). */
.launch-chrome.is-main #launch-logo-subtitle {
  display: none;
}

.launch-chrome.is-main .launch-chrome__loader[hidden] {
  display: none;
}

html:not(.is-launch) .launch-chrome:not(.is-main) {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .launch-chrome {
    transition: none;
  }
}

/*
 * 024: mobile preview card at bottom (Figma 730:10702).
 * Mobile-only: hidden outside max-width:440px. Slides up from bottom.
 * One compact row: date+title column (258px) + 86×86 poster.
 */
.mobile-preview {
  display: none;
}

@media (max-width: 440px) {
  .mobile-preview {
    display: block;
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 2;
    width: min(408px, 100vw - 32px);
    height: 126px;
    padding: 20px;
    background: #fff;
    border-radius: 24px;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    line-height: normal;
    transform: translate(-50%, 100%);
    transition: transform var(--object-card-open-duration) var(--object-card-easing);
    will-change: transform;
  }

  .mobile-preview[hidden] {
    display: none;
  }

  .mobile-preview[data-state="open"] {
    transform: translate(-50%, 0);
  }

  /* 027: two-layer row stack. Rows are absolutely positioned so the old
     (outgoing) and new (incoming) cards coexist during the crossfade. */
  .mobile-preview__row {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    transform: translateY(0) scale(1);
    opacity: 1;
    transition: transform var(--object-card-swap-duration) var(--object-card-easing),
      opacity var(--object-card-swap-duration) var(--object-card-easing);
    will-change: transform, opacity;
  }

  /* Entering: offset opposite to the move direction, small, hidden. */
  .mobile-preview__row[data-row-state="entering"] {
    transform: translateY(calc(-1 * var(--dir, 1) * 24px)) scale(0.85);
    opacity: 0;
  }

  /* Outgoing: drifts in the move direction, grows, fades out. */
  .mobile-preview__row[data-row-state="outgoing"] {
    transform: translateY(calc(var(--dir, 1) * 24px)) scale(1.15);
    opacity: 0;
  }

  .mobile-preview__text {
    flex: 0 0 258px;
    min-width: 0;
  }

  .mobile-preview__date {
    margin: 0 0 4px;
    color: #e40046;
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
  }

  .mobile-preview__title {
    margin: 0;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    line-height: 19px;
    letter-spacing: 0.16px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .mobile-preview__poster {
    flex: 0 0 86px;
    width: 86px;
    height: 86px;
    object-fit: cover;
    border-radius: 12px;
    user-select: none;
    -webkit-user-drag: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-preview,
    .mobile-preview__row {
      transition: none;
    }
  }
}

/*
 * 025: mobile bottom sheet — full object detail (Figma 730:10705).
 * Mobile-only: hidden outside max-width:440px. Slides up from bottom.
 */
.mobile-sheet,
.mobile-sheet-backdrop {
  display: none;
}

@media (max-width: 440px) {
  .mobile-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    opacity: 0;
    transition: opacity var(--object-card-open-duration) var(--object-card-easing);
    will-change: opacity;
  }

  .mobile-sheet-backdrop[hidden] {
    display: none;
  }

  .mobile-sheet-backdrop[data-state="open"] {
    opacity: 1;
  }

  .mobile-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 11;
    width: 100%;
    max-width: 440px;
    max-height: 100dvh;
    background: #fff;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    line-height: normal;
    border-radius: 24px 24px 0 0;
    transform: translate(-50%, 100%);
    transition: transform var(--object-card-open-duration) var(--object-card-easing);
    will-change: transform;
  }

  .mobile-sheet[hidden] {
    display: none;
  }

  .mobile-sheet[data-state="open"] {
    transform: translate(-50%, 0);
  }

  /* 026: during drag, follow the finger (no transition). */
  .mobile-sheet.is-dragging {
    transition: none;
    transform: translate(-50%, var(--sheet-drag-y, 0px));
  }

  .mobile-sheet__header {
    position: relative;
    flex: 0 0 auto;
    height: 49px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-sheet__grabber {
    width: 32px;
    height: 5px;
    background: #000;
    border-radius: 100px;
    opacity: 0.15;
    transition: opacity var(--object-card-open-duration) var(--object-card-easing);
  }

  .mobile-sheet__close {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.24);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--object-card-open-duration) var(--object-card-easing);
  }

  /* 026: scrolled past threshold → close icon visible, grabber hidden. */
  .mobile-sheet[data-close-visible="true"] .mobile-sheet__close {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-sheet[data-close-visible="true"] .mobile-sheet__grabber {
    opacity: 0;
  }

  .mobile-sheet__close-bar {
    position: absolute;
    width: 14px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
  }

  .mobile-sheet__close-bar:first-child {
    transform: rotate(45deg);
  }

  .mobile-sheet__close-bar:last-child {
    transform: rotate(-45deg);
  }

  .mobile-sheet__article {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 34px 24px 120px;
    scrollbar-color: #000 transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-sheet__article::-webkit-scrollbar {
    width: 3px;
  }

  .mobile-sheet__article::-webkit-scrollbar-track {
    background: transparent;
  }

  .mobile-sheet__article::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 0;
  }

  .mobile-sheet__date {
    margin: 0 0 8px;
    color: #e40046;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
  }

  .mobile-sheet__title {
    margin: 0 0 24px;
    font-size: 23px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
  }

  .mobile-sheet__media {
    display: block;
    width: 100%;
    height: 528px;
    margin: 0 0 18px;
    border-radius: 12px;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
  }

  .mobile-sheet__description {
    margin: 0 0 24px;
    font-size: 16px;
    font-weight: 400;
    line-height: 19px;
    letter-spacing: 0.16px;
  }

  .mobile-sheet__description:last-child {
    margin-bottom: 0;
  }

  .mobile-sheet__cta {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: 226px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #000;
    color: #fff;
    font-size: 15.4px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    cursor: pointer;
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-sheet,
    .mobile-sheet-backdrop {
      transition: none;
    }
  }

  /* 026: reduce transparency on devices that request it. */
  @media (prefers-reduced-transparency: reduce) {
    .mobile-sheet-backdrop {
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
      background: rgba(0, 0, 0, 0.4);
    }
  }
}
