:root {
  --coral: #ff5d48;
  --blue: #76a7ff;
  --yellow: #ffd84c;
  --black: #111;
  --surface: #d9d9d1;
  --paper: #f6f1e8;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--black);
  font-family: Arial, Helvetica, sans-serif;
}

button { color: inherit; font: inherit; }

.bento-page { background: var(--surface); }

.bento-shell {
  max-width: 1500px;
  margin: auto;
  padding: 18px;
}

.bento-nav {
  display: flex;
  justify-content: space-between;
  padding: 13px 10px 18px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.bento-grid { display: grid; gap: 10px; }

.bento-grid--hero {
  grid-template-columns: 1.65fr .72fr;
  grid-template-rows: 1fr auto;
  min-height: calc(100svh - 74px);
}

.bento-tile {
  overflow: hidden;
  border: 2px solid var(--black);
  border-radius: 22px;
}

.bento-tile--hero {
  position: relative;
  grid-row: 1 / -1;
  min-height: 660px;
  padding: clamp(30px, 4vw, 70px);
  color: white;
  background: var(--coral);
}

.bento-tile--hero p {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #172a4d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bento-tile--hero h1 {
  position: relative;
  z-index: 2;
  margin: 12vh 0 0;
  font: 900 clamp(74px, 10vw, 158px)/.72 Arial, sans-serif;
  letter-spacing: -.09em;
}

.bento-tile--hero h1 em {
  display: inline-block;
  color: var(--yellow);
  font-style: normal;
  -webkit-text-stroke: 2px var(--black);
  paint-order: stroke fill;
  transform-origin: 50% 65%;
}

.bento-tile--hero h1 em.is-popping {
  animation: hero-pop 2.5s cubic-bezier(.2, .8, .2, 1) infinite;
}

.burst {
  position: absolute;
  top: -70px;
  right: -80px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  opacity: .9;
  background: repeating-conic-gradient(var(--yellow) 0 7deg, transparent 7deg 14deg);
}

.bento-sticker {
  position: absolute;
  z-index: 3;
  right: 9%;
  bottom: 9%;
  display: grid;
  width: 110px;
  height: 110px;
  place-items: center;
  border: 2px solid var(--black);
  border-radius: 50%;
  color: var(--black);
  background: white;
  box-shadow: 6px 6px 0 var(--black);
  font-weight: 900;
  text-align: center;
  transform: rotate(10deg);
}

.bento-tile--date {
  position: relative;
  display: flex;
  min-height: 385px;
  padding: 24px;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 1vw, 14px);
  background: var(--yellow);
}

.bento-tile--date strong {
  display: block;
  font-size: clamp(140px, 18vw, 260px);
  line-height: .8;
  letter-spacing: -.12em;
  text-align: center;
  transform-origin: 50% 55%;
}

.bento-date__month,
.bento-date__year {
  display: block;
  font-size: clamp(16px, 1.35vw, 20px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: .2em;
}

.bento-date__year { text-align: right; }

.bento-date__smile {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 32px;
}

.bento-tile--note {
  position: relative;
  min-height: 200px;
  padding: 28px;
  background: #f7f3ea;
}

.bento-tile--note p {
  margin: 0 0 10px;
  font: italic 19px/1.3 Georgia, serif;
}

.bento-tile--note strong {
  display: block;
  max-width: 400px;
  font-size: clamp(22px, 2.4vw, 36px);
  line-height: 1;
  letter-spacing: -.04em;
  text-transform: uppercase;
}

.bento-tile--note sup {
  position: relative;
  top: -.25em;
  margin-left: 2px;
  font-size: .55em;
}

.bento-note__footnote {
  display: block;
  max-width: calc(100% - 45px);
  margin-top: 16px;
  font: italic 12px/1.35 Georgia, serif;
}

.bento-tile--note > span {
  position: absolute;
  right: 25px;
  bottom: 17px;
  font-size: 45px;
}

.bento-tracking { padding: 120px 0 30px; }

.bento-section-title {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  align-items: start;
  margin-bottom: 45px;
  padding: 0 20px;
}

.black-pill {
  justify-self: start;
  padding: 8px 12px;
  border-radius: 99px;
  color: white;
  background: var(--black);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.bento-section-title h2 {
  margin: 0;
  font-size: clamp(54px, 7vw, 100px);
  line-height: .82;
  letter-spacing: -.075em;
}

.bento-section-title p {
  grid-column: 2;
  margin: 24px 0 0;
  font: italic 20px Georgia, serif;
}

.bento-grid--tracking { grid-template-columns: 1fr 1fr .54fr; }

.bento-grid--tracking > :nth-child(1) { --reveal-delay: 0ms; }
.bento-grid--tracking > :nth-child(2) { --reveal-delay: 120ms; }
.bento-grid--tracking > :nth-child(3) { --reveal-delay: 240ms; }

[data-scroll-reveal].will-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .58s ease, transform .58s cubic-bezier(.2, .8, .2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-scroll-reveal].will-reveal.is-in-view {
  opacity: 1;
  transform: none;
}

.bento-parcel {
  display: flex;
  min-height: 570px;
  padding: 28px;
  flex-direction: column;
}
.bento-parcel--blue { background: var(--blue); }
.bento-parcel--yellow { background: var(--yellow); }

.bento-parcel__head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}

.bento-live { display: flex; align-items: center; gap: 7px; }

.bento-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #198542;
  animation: pulse 1.6s infinite;
}

.bento-live--complete i { animation: none; }

.bento-parcel__icon {
  display: grid;
  width: 100px;
  height: 100px;
  margin: 55px 0 30px;
  place-items: center;
  border: 2px solid;
  border-radius: 50%;
  background: white;
  box-shadow: 5px 5px 0 var(--black);
  font-size: 50px;
}

.bento-parcel__symbol {
  display: inline-block;
  min-width: 1em;
  line-height: 1;
  text-align: center;
}

.bento-parcel > p {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

.bento-parcel h3 {
  margin: 0 0 19px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: .87;
  letter-spacing: -.06em;
}

.bento-parcel > .bento-parcel__meaning {
  max-width: 380px;
  margin: 0 0 34px;
  color: rgba(17, 17, 17, .72);
  font: italic 18px/1.25 Georgia, serif;
  letter-spacing: 0;
}

/* margin-top: auto прижимает низ карточки, чтобы прогресс-бар и дата
   стояли на одной линии в обеих посылках при разной длине заголовка. */
.bento-progress {
  flex: none;
  height: 17px;
  margin-top: auto;
  padding: 2px;
  overflow: hidden;
  border: 2px solid;
  border-radius: 99px;
  background: white;
}

.bento-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--black);
  transition: width 1.05s cubic-bezier(.2, .8, .2, 1);
  transition-delay: calc(var(--reveal-delay, 0ms) + 220ms);
}

.bento-progress.is-active span { width: var(--progress-value, 0%); }

.bento-parcel__eta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 23px;
}

.bento-parcel__eta span { font-size: 9px; font-weight: 900; }

.bento-parcel__eta strong {
  font-size: 49px;
  line-height: 1;
  letter-spacing: -.06em;
}

.bento-tile--legend {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 25px;
  color: white;
  background: var(--black);
}

.bento-tile--legend strong {
  max-width: calc(100% - 20px);
  font-size: clamp(30px, 2.7vw, 44px);
  line-height: .86;
  letter-spacing: -.05em;
}

.legend-arrow {
  position: absolute;
  top: 18px;
  right: 24px;
  color: var(--yellow);
  font-size: 52px;
  line-height: 1;
}

.legend-heart {
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: var(--coral);
  font-size: 70px;
  transform: rotate(-8deg);
}

.bento-constellation { padding: 105px 0 30px; }

.constellation-intro {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  align-items: start;
  margin-bottom: 45px;
  padding: 0 20px;
}

.constellation-intro h2 {
  margin: 0;
  font-size: clamp(54px, 7vw, 100px);
  line-height: .82;
  letter-spacing: -.075em;
}

.constellation-intro p {
  grid-column: 2;
  max-width: 620px;
  margin: 24px 0 0;
  font: italic 20px/1.25 Georgia, serif;
}

.constellation-card {
  display: grid;
  grid-template-columns: minmax(310px, .72fr) minmax(0, 1.45fr);
  min-height: 760px;
  color: white;
  background: var(--black);
}

.constellation-copy {
  display: flex;
  padding: clamp(28px, 4vw, 58px);
  flex-direction: column;
  justify-content: space-between;
  gap: 70px;
  border-right: 2px solid rgba(255, 255, 255, .28);
}

.constellation-kicker {
  display: inline-block;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
}

.constellation-copy h3 {
  margin: 33px 0 22px;
  color: var(--yellow);
  font-size: clamp(59px, 6vw, 92px);
  line-height: .78;
  letter-spacing: -.08em;
}

.constellation-copy > div > p {
  max-width: 390px;
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font: italic 18px/1.3 Georgia, serif;
}

.star-readout {
  min-height: 118px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .28);
}

.star-readout span,
.star-readout small {
  display: block;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.star-readout strong {
  display: block;
  margin: 7px 0 10px;
  color: var(--coral);
  font-size: clamp(24px, 2.4vw, 37px);
  line-height: .92;
  letter-spacing: -.04em;
}

.star-readout small {
  color: rgba(255, 255, 255, .55);
  line-height: 1.35;
}

.constellation-sky {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 26px 28px 22px;
  flex-direction: column;
  background:
    radial-gradient(circle at 78% 16%, rgba(118, 167, 255, .17), transparent 28%),
    radial-gradient(circle at 18% 76%, rgba(255, 93, 72, .09), transparent 30%),
    #0b1321;
}

.constellation-sky__head,
.constellation-help {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
}

.constellation-sky__head { color: rgba(255, 255, 255, .62); }

.constellation-map {
  display: block;
  width: 100%;
  height: auto;
  margin: auto;
  aspect-ratio: 640 / 680;
  overflow: visible;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sky-dust { fill: rgba(255, 255, 255, .58); }

.constellation-lines {
  fill: none;
  stroke: rgba(255, 216, 76, .62);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 6 9;
  vector-effect: non-scaling-stroke;
}

.constellation-card.will-reveal .constellation-lines path {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
}

.constellation-card.is-in-view .constellation-lines path {
  animation: draw-constellation 1.4s .3s cubic-bezier(.2, .8, .2, 1) forwards;
}

.constellation-card.is-in-view .constellation-lines path:nth-child(2) { animation-delay: .65s; }

.constellation-star { cursor: pointer; outline: none; }
.star-hit { fill: transparent; pointer-events: all; }

.star-core,
.star-halo,
.star-focus-ring {
  transform-box: fill-box;
  transform-origin: center;
  vector-effect: non-scaling-stroke;
}

.star-core {
  fill: white;
  stroke: white;
  stroke-width: 2;
  transition: fill .2s ease, stroke .2s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}

.star-halo {
  fill: none;
  stroke: rgba(118, 167, 255, .65);
  stroke-width: 2;
  opacity: .8;
  animation: star-breathe 2.7s ease-in-out infinite;
}

.star-focus-ring {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 2;
  opacity: 0;
  transition: opacity .18s ease, transform .2s ease;
}

.star-label {
  fill: rgba(255, 255, 255, .42);
  font: 900 10px Arial, sans-serif;
  letter-spacing: .09em;
  pointer-events: none;
  transition: fill .18s ease, opacity .18s ease;
}

.constellation-star:focus-visible .star-focus-ring {
  opacity: 1;
  transform: scale(1.08);
}

.constellation-star:focus-visible .star-label,
.constellation-star.is-selected .star-label { fill: white; }

.constellation-star.is-selected .star-core {
  fill: var(--coral);
  stroke: var(--coral);
  transform: scale(1.55);
}

.constellation-star.is-selected .star-focus-ring {
  stroke: var(--coral);
  opacity: .75;
  animation: selected-star 1.3s ease-out infinite;
}

.constellation-map__mark {
  fill: rgba(255, 255, 255, .34);
  font: 900 9px Arial, sans-serif;
  letter-spacing: .14em;
}

.constellation-help {
  margin: 0;
  color: rgba(255, 255, 255, .48);
}

.has-open-dialog { overflow: hidden; }

.has-dialog-fallback::before {
  position: fixed;
  z-index: 999;
  inset: 0;
  content: '';
  background: rgba(11, 19, 33, .84);
  backdrop-filter: blur(8px);
}

.star-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: min(790px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--black);
  background: transparent;
}

.star-dialog::backdrop {
  background: rgba(11, 19, 33, .84);
  backdrop-filter: blur(8px);
}

/* Базовое скрытие и позиционирование нужны браузерам без нативного <dialog>. */
.star-dialog:not([open]) { display: none; }

.star-dialog[open] {
  display: block;
  animation: certificate-in .38s cubic-bezier(.2, .8, .2, 1);
}

.star-dialog__shell {
  position: relative;
  max-height: calc(100dvh - 28px);
  overflow: auto;
  border: 2px solid var(--black);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 12px 12px 0 rgba(0, 0, 0, .38);
  -webkit-overflow-scrolling: touch;
}

.star-dialog__close {
  position: absolute;
  z-index: 4;
  top: 15px;
  right: 15px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  place-items: center;
  cursor: pointer;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: white;
  box-shadow: 3px 3px 0 var(--black);
  font-size: 30px;
  line-height: 1;
}

.star-dialog__close:focus-visible,
.certificate-action:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.star-certificate {
  position: relative;
  min-height: 720px;
  padding: 44px 48px 38px;
  overflow: hidden;
  border-bottom: 2px solid var(--black);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 216, 76, .35), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, .8), transparent 38%),
    var(--paper);
}

.certificate-orbit {
  position: absolute;
  border: 2px solid var(--black);
  border-radius: 50%;
  opacity: .14;
  pointer-events: none;
}

.certificate-orbit--one {
  top: -250px;
  right: -220px;
  width: 560px;
  height: 560px;
}

.certificate-orbit--two {
  top: -185px;
  right: -155px;
  width: 420px;
  height: 420px;
}

.certificate-kicker,
.certificate-number {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
}

.certificate-number {
  margin-top: 8px;
  color: rgba(17, 17, 17, .52);
}

.certificate-copy {
  position: relative;
  z-index: 1;
  max-width: 510px;
  margin-top: 66px;
}

.certificate-copy p {
  max-width: 460px;
  margin: 0;
  font: italic 18px/1.25 Georgia, serif;
}

.certificate-copy strong,
.certificate-copy span { display: block; }

.certificate-copy strong {
  margin-top: 9px;
  color: var(--coral);
  font-size: clamp(28px, 5vw, 44px);
  line-height: .9;
  letter-spacing: -.045em;
}

.certificate-copy span {
  margin: 7px 0 23px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}

.star-certificate h2 {
  position: relative;
  z-index: 1;
  margin: 26px 0 38px;
  font-size: clamp(58px, 9vw, 94px);
  line-height: .72;
  letter-spacing: -.085em;
}

.certificate-facts {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 1fr .7fr;
  margin: 0;
  border-top: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
}

.certificate-facts div { padding: 14px 12px 13px 0; }
.certificate-facts div + div { padding-left: 12px; border-left: 1px solid var(--black); }

.certificate-facts dt {
  margin-bottom: 6px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .11em;
}

.certificate-facts dd {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.certificate-seal {
  position: absolute;
  z-index: 2;
  right: 42px;
  bottom: 92px;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--black);
  text-align: center;
  transform: rotate(8deg);
}

.certificate-seal span { position: absolute; top: 6px; font-size: 24px; }
.certificate-seal small { padding-top: 23px; font-size: 8px; font-weight: 900; line-height: 1; }

.star-certificate footer {
  position: absolute;
  z-index: 1;
  right: 48px;
  bottom: 30px;
  left: 48px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 130px;
}

.star-certificate footer span {
  flex: none;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
}

.star-certificate footer small {
  color: rgba(17, 17, 17, .58);
  font: italic 9px/1.25 Georgia, serif;
  text-align: right;
}

.star-dialog__actions {
  display: flex;
  padding: 18px;
  gap: 10px;
}

.certificate-action {
  min-height: 52px;
  padding: 14px 19px;
  flex: 1;
  cursor: pointer;
  border: 2px solid var(--black);
  border-radius: 99px;
  background: white;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
}

.certificate-action--primary {
  display: flex;
  flex: 1.7;
  justify-content: space-between;
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--black);
}

.certificate-action:disabled { cursor: wait; opacity: .65; }

.bento-final {
  display: flex;
  min-height: 620px;
  margin-top: 90px;
  padding: clamp(35px, 6vw, 90px);
  flex-direction: column;
  justify-content: space-between;
  border: 2px solid var(--black);
  border-radius: 22px;
  background: var(--paper);
}

.bento-final p { font: italic 20px Georgia, serif; }

.bento-final h2 {
  margin: 10px 0;
  overflow-wrap: break-word;
  font-size: clamp(55px, 8vw, 125px);
  line-height: .8;
  letter-spacing: -.08em;
}

.reveal-button {
  position: relative;
  cursor: pointer;
  border: 0;
}

.reveal-button--bento {
  display: flex;
  min-width: 280px;
  padding: 19px 22px;
  align-self: flex-end;
  justify-content: space-between;
  border: 2px solid var(--black);
  border-radius: 99px;
  background: var(--coral);
  box-shadow: 5px 5px 0 var(--black);
  font-size: 12px;
  font-weight: 900;
  transition: transform .2s, box-shadow .2s;
}

.reveal-button--bento:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 4px;
}

.reveal-button__arrow {
  display: inline-block;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.reveal-button--bento.is-open {
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--black);
  transform: translate(3px, 3px);
}

.reveal-button--bento.is-open .reveal-button__arrow { transform: rotate(90deg); }

.hidden-message {
  position: relative;
  overflow: hidden;
  max-width: 580px;
  max-height: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: max-height .6s ease, opacity .5s ease, transform .5s ease, margin .5s ease;
}

.hidden-message.is-visible {
  max-height: 300px;
  margin-top: 30px;
  opacity: 1;
  transform: none;
}

.hidden-message p { margin: 0; }

.hidden-message--bento {
  align-self: flex-end;
  text-align: right;
}

.hidden-message--bento p {
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.hidden-message--bento p span {
  display: block;
  opacity: 0;
  transform: translateY(9px);
  transition: opacity .38s ease, transform .38s ease;
}

.hidden-message--bento.is-visible p span {
  opacity: 1;
  transform: none;
}

.hidden-message--bento.is-visible p span:nth-child(1) { transition-delay: 80ms; }
.hidden-message--bento.is-visible p span:nth-child(2) { transition-delay: 160ms; }
.hidden-message--bento.is-visible p span:nth-child(3) { transition-delay: 240ms; }
.hidden-message--bento.is-visible p span:nth-child(4) { transition-delay: 320ms; }

.bento-footer {
  display: flex;
  justify-content: space-between;
  padding: 32px 12px 15px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}

.star-shower-canvas {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
}

@media (hover: hover) {
  .reveal-button--bento:hover:not(.is-open) {
    box-shadow: 2px 2px 0 var(--black);
    transform: translate(3px, 3px);
  }

  .constellation-star:hover .star-core { transform: scale(1.45); }
  .constellation-star:hover .star-focus-ring { opacity: .7; }
  .constellation-star:hover .star-label { fill: white; }

  .star-dialog__close:hover,
  .certificate-action:hover { background: var(--yellow); }

  .certificate-action--primary:hover { background: var(--blue); }
}

@keyframes hero-pop {
  0% { transform: scale(.98) translateY(2px) rotate(-.35deg); }
  12.5% { transform: scale(1.025) translateY(-1px) rotate(.35deg); }
  27%, 100% { transform: scale(1) translateY(0) rotate(0); }
}

@keyframes pulse {
  50% { opacity: .3; transform: scale(.75); }
}

@keyframes draw-constellation {
  to { stroke-dashoffset: 0; }
}

@keyframes star-breathe {
  50% { opacity: .25; transform: scale(1.45); }
}

@keyframes selected-star {
  0% { opacity: .85; transform: scale(.75); }
  100% { opacity: 0; transform: scale(2); }
}

@keyframes certificate-in {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .bento-grid--hero {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.5fr .7fr;
  }

  .bento-tile--hero {
    grid-row: auto;
    grid-column: 1 / -1;
    min-height: 600px;
  }

  .bento-tile--hero h1 { margin-top: 120px; }
  .bento-tile--date { min-height: 270px; }
  .bento-tile--note { min-height: 270px; }

  .bento-section-title { grid-template-columns: 1fr; gap: 25px; }
  .bento-section-title p { grid-column: auto; }

  .bento-grid--tracking { grid-template-columns: 1fr 1fr; }

  .bento-tile--legend {
    grid-column: 1 / -1;
    min-height: 220px;
  }

  .constellation-intro { grid-template-columns: 1fr; gap: 25px; }
  .constellation-intro p { grid-column: auto; }

  .constellation-card { grid-template-columns: 1fr; }

  .constellation-copy {
    min-height: 480px;
    border-right: 0;
    border-bottom: 2px solid rgba(255, 255, 255, .28);
  }

  .constellation-sky { min-height: 680px; }
}

@media (max-width: 600px) {
  .bento-shell {
    padding-top: max(7px, env(safe-area-inset-top));
    padding-right: max(7px, env(safe-area-inset-right));
    padding-bottom: max(7px, env(safe-area-inset-bottom));
    padding-left: max(7px, env(safe-area-inset-left));
  }

  .bento-nav span:first-child { display: none; }

  .bento-grid--hero {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .bento-tile--hero {
    min-height: 620px;
    padding: 28px 19px;
  }

  .bento-tile--hero h1 {
    margin-top: 155px;
    font-size: 75px;
  }

  .bento-sticker {
    right: 9%;
    bottom: 6%;
    width: 90px;
    height: 90px;
  }

  .bento-tile--date,
  .bento-tile--note { min-height: 250px; }

  .bento-tile--date strong { font-size: 170px; }
  .bento-tracking { padding-top: 90px; }
  .bento-section-title { padding: 0 7px; }
  .bento-section-title h2 { font-size: 53px; }

  .bento-grid--tracking { grid-template-columns: 1fr; }
  .bento-parcel { min-height: 525px; }
  .bento-tile--legend { grid-column: auto; }

  .bento-constellation { padding-top: 90px; }
  .constellation-intro { padding: 0 7px; }
  .constellation-intro h2 { font-size: 53px; }
  .constellation-intro p { font-size: 18px; }

  .constellation-copy {
    min-height: 430px;
    padding: 27px 23px;
    gap: 45px;
  }

  .constellation-copy h3 { font-size: min(67px, 18vw); }
  .constellation-copy > div > p { font-size: 16px; }
  .star-readout { min-height: 104px; }

  .constellation-sky {
    min-height: 0;
    padding: 20px 9px 18px;
  }

  .constellation-sky__head { padding: 0 8px; font-size: 8px; }
  .star-label {
    fill: rgba(255, 255, 255, .7);
    font-size: 15px;
    letter-spacing: .05em;
  }

  .constellation-help {
    padding: 0 8px;
    font-size: 9px;
    line-height: 1.35;
  }

  .star-dialog {
    width: calc(100% - 14px);
    max-height: calc(100dvh - 14px);
  }

  .star-dialog__shell {
    max-height: calc(100dvh - 14px);
    border-radius: 18px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .35);
  }

  .star-dialog__close { top: 10px; right: 10px; }

  .star-certificate {
    min-height: 670px;
    padding: 30px 20px 26px;
  }

  .certificate-kicker,
  .certificate-number { max-width: calc(100% - 48px); font-size: 7px; }
  .certificate-copy { margin-top: 54px; }
  .certificate-copy p { max-width: 290px; font-size: 15px; }
  .certificate-copy strong { font-size: 32px; }
  .certificate-copy span { font-size: 9px; }

  .star-certificate h2 {
    margin: 24px 0 34px;
    font-size: min(58px, 13.5vw);
  }

  .certificate-facts { grid-template-columns: 1.15fr .95fr .65fr; }
  .certificate-facts div { padding: 11px 7px 10px 0; }
  .certificate-facts div + div { padding-left: 7px; }
  .certificate-facts dt { font-size: 6px; }
  .certificate-facts dd { font-size: 11px; }

  .certificate-seal {
    right: 19px;
    bottom: 96px;
    width: 76px;
    height: 76px;
  }

  .star-certificate footer {
    right: 20px;
    bottom: 22px;
    left: 20px;
    display: block;
    padding-right: 88px;
  }

  .star-certificate footer span { display: block; margin-bottom: 6px; font-size: 7px; }
  .star-certificate footer small { display: block; font-size: 8px; text-align: left; }

  .star-dialog__actions { flex-direction: column; padding: 12px; }
  .certificate-action { width: 100%; flex: auto; }
  .bento-final {
    min-height: 690px;
    margin-top: 60px;
    padding: 35px 20px;
  }

  /* «ПОЗДРАВЛЕНИЕ» — самое длинное слово на странице. На 41px оно занимает
     301px и перестаёт помещаться уже на 360px, утаскивая страницу вбок.
     Ниже ~390px кегль едет за вьюпортом, чтобы слово всегда влезало. */
  .bento-final h2 { font-size: min(41px, 10.5vw); }
  .reveal-button--bento { min-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
