@font-face {
  font-family: "Comfortaa";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/comfortaa-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Comfortaa";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/comfortaa-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/nunito-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/nunito-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #2a2428;
  --cream: #fff6ea;
  --pink: #ff8eaf;
  --shadow: 5px 5px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-height: 100%;
  color: var(--ink);
  font-family: "Nunito", "Segoe UI", sans-serif;
  background: #f3b7c6;
}

button {
  font: inherit;
  color: inherit;
}

.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  background: #f7b7d4;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #f7a0c4 0%, #ffc2a2 48%, #ffe0b8 100%);
  transition: background 8s linear;
}

.scene[data-phase="day"] .sky {
  background: linear-gradient(180deg, #f7c4e6 0%, #ffe3f4 40%, #ffe7c4 100%);
}

.scene[data-phase="dusk"] .sky {
  background: linear-gradient(180deg, #5d4b96 0%, #e07aa2 48%, #ffb07a 100%);
}

.scene[data-phase="night"] .sky {
  background: linear-gradient(180deg, #14122e 0%, #2c235c 52%, #4d386c 100%);
}

.stars,
.fireflies,
.pollen {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff8e6;
  opacity: 0;
}

.scene[data-phase="night"] .star {
  animation: twinkle 2.8s ease-in-out infinite;
}

.world {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: filter 8s linear;
}

.scene[data-phase="dusk"] .world {
  filter: brightness(0.74) saturate(0.82);
}

.scene[data-phase="night"] .world {
  filter: brightness(0.46) saturate(0.62);
}

.orb {
  position: absolute;
  z-index: 1;
  width: min(17vw, 158px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  animation: sun-bob 9s ease-in-out infinite;
}

.sun {
  left: 7%;
  top: 40%;
}

.moon {
  left: 12%;
  top: 11%;
  opacity: 0;
}

.orb .rest-face,
.orb .awake-face {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.25s ease;
}

.orb .awake-face {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}

.orb.is-awake .rest-face {
  opacity: 0;
}

.orb.is-awake .awake-face {
  opacity: 1;
}

.sun {
  filter: drop-shadow(0 0 22px rgba(255, 196, 70, 0.72));
}

.moon {
  width: min(13vw, 118px);
  animation-duration: 12s;
  filter: drop-shadow(0 0 16px rgba(255, 244, 214, 0.55));
}

.cloud-track {
  position: absolute;
  top: var(--top);
  left: 0;
  width: var(--w);
  z-index: 0;
  pointer-events: none;
  animation: sail var(--dur) linear infinite;
  animation-delay: var(--delay);
}

.cloud-track img {
  display: block;
  width: 100%;
  height: auto;
  animation: bob 11s ease-in-out infinite;
  transition: filter 8s linear;
}

.scene[data-phase="dusk"] .cloud-track img {
  filter: brightness(0.82) saturate(0.9);
}

.scene[data-phase="night"] .cloud-track img {
  filter: brightness(0.42) saturate(0.55);
}

.land {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
}

.life {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.edge-flower {
  position: absolute;
  bottom: 1%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.edge-flower img,
.sway-flower {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
  animation: sway 3.8s ease-in-out infinite;
  pointer-events: none;
}

.butterfly {
  position: absolute;
  top: 0;
  left: 0;
  width: 88px;
  aspect-ratio: 748 / 541;
  transition: opacity 2s linear;
}

.butterfly img,
.bird img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  animation: wingbeat 0.5s linear infinite;
}

.butterfly img:nth-child(2),
.bird img:nth-child(2) {
  animation-delay: 0.125s;
}

.butterfly img:nth-child(3),
.bird img:nth-child(3) {
  animation-delay: 0.25s;
}

.butterfly img:nth-child(4),
.bird img:nth-child(4) {
  animation-delay: 0.375s;
}

.b1 {
  animation: fly1 28s linear infinite;
}

.b2 {
  width: 54px;
  animation: fly2 36s linear infinite;
  animation-delay: -14s;
}

.b3 {
  width: 46px;
  animation: fly3 31s linear infinite;
  animation-delay: -22s;
}

.scene[data-phase="night"] .butterfly {
  opacity: 0;
}

.edge-flower.secret img,
.bud.secret img {
  animation: secret-glow 0.7s ease;
}

@keyframes secret-glow {
  0%,
  100% {
    filter: none;
  }
  45% {
    filter: brightness(1.4) saturate(1.25);
  }
}

.fireflies {
  z-index: 4;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffe7a0;
  box-shadow: 0 0 10px 4px rgba(255, 214, 110, 0.85);
  opacity: 0;
}

.scene[data-phase="night"] .firefly {
  animation: wander 16s ease-in-out infinite;
}

.pollen i {
  position: absolute;
  bottom: -16px;
  width: 9px;
  height: 13px;
  background: #ffb0cb;
  border: 2px solid var(--ink);
  border-radius: 80% 10% 80% 10%;
  animation: rise linear infinite;
}

.scene[data-phase="night"] .pollen i {
  background: #ddd6ff;
  opacity: 0.45;
}

.wash {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: #ffd0c2;
  opacity: 0.16;
  mix-blend-mode: multiply;
  transition: background 8s linear, opacity 8s linear;
}

.scene[data-phase="day"] .wash {
  opacity: 0;
}

.scene[data-phase="dusk"] .wash {
  background: #e09070;
  opacity: 0.28;
}

.scene[data-phase="night"] .wash {
  opacity: 0;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 50%, rgba(90, 40, 70, 0.16) 100%);
}

.plaque {
  position: absolute;
  z-index: 6;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  width: min(440px, calc(100% - 28px));
  margin: 0;
  padding: 14px 18px 12px;
  text-align: center;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 28px 34px 26px 32px;
  box-shadow: var(--shadow);
  transform: translateX(-50%) rotate(-1.4deg);
}

.kicker,
.how,
.line,
.count,
.mute,
.tune {
  margin: 0;
}

.kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 2px 0 6px;
  font-family: "Comfortaa", "Nunito", sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  font-weight: 700;
  line-height: 1.05;
}

.line {
  min-height: 1.4em;
  font-size: 1.08rem;
  font-weight: 600;
}

.how {
  margin-top: 4px;
  color: #7a5362;
  font-size: 0.86rem;
}

.count,
.mute,
.tune {
  position: absolute;
  z-index: 6;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.count {
  top: 18px;
  right: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  transform: rotate(2deg);
}

.mute,
.tune {
  left: max(16px, env(safe-area-inset-left));
  padding: 8px 12px;
  border-radius: 16px 18px 14px 20px;
  cursor: pointer;
}

.mute {
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: rotate(-2deg);
}

.tune {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  min-width: 46px;
  max-width: 46vw;
  font-size: 0.92rem;
  line-height: 1.2;
  text-align: center;
  transform: rotate(2deg);
}

.mute[aria-pressed="true"] {
  background: #ffd0de;
}

#track {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.player {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.player[hidden],
.music-hint[hidden] {
  display: none;
}

.music-hint,
.volume {
  pointer-events: auto;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.music-hint {
  max-width: min(320px, 100%);
  margin: 0;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.volume {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(260px, 100%);
  min-height: 46px;
  padding: 6px 12px 6px 14px;
  border-radius: 999px;
}

.volume-mark,
.volume-readout {
  flex: 0 0 auto;
  font-weight: 600;
  line-height: 1;
}

.volume-mark {
  font-size: 1.15rem;
}

.volume-readout {
  min-width: 3.1em;
  font-size: 0.92rem;
  text-align: right;
}

.volume input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  touch-action: none;
  cursor: pointer;
}

.volume input[type="range"]:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 999px;
}

.volume input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8eaf var(--vol, 30%), #ffd6e3 var(--vol, 30%));
}

.volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--ink);
}

.volume input[type="range"]::-moz-range-track {
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #ffd6e3;
}

.volume input[type="range"]::-moz-range-progress {
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #ff8eaf;
}

.volume input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--ink);
}

.rose {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 0;
  height: min(74vh, 820px);
  aspect-ratio: 563 / 984;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(-50%);
  -webkit-tap-highlight-color: transparent;
}

.rose:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 6px;
  border-radius: 40px;
}

.rose-sway,
.rose-pop {
  display: block;
  height: 100%;
}

.rose-sway {
  transform-origin: 50% 97%;
  animation: sway 3.8s ease-in-out infinite;
}

.rose-pop {
  position: relative;
}

.rose-pop.burst {
  animation: burst 0.5s cubic-bezier(0.2, 1.45, 0.4, 1);
}

.stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.42s ease;
  user-select: none;
}

.stage.on {
  opacity: 1;
}

.rose::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1.2%;
  z-index: -1;
  width: 38%;
  height: 16px;
  background: rgba(120, 60, 70, 0.2);
  border-radius: 50%;
  transform: translateX(-50%);
  filter: blur(1px);
}

.buds {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.bud {
  position: absolute;
  width: clamp(74px, 12vw, 148px);
  aspect-ratio: 454 / 755;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(var(--rot)) scale(var(--sx), var(--sy));
  animation: sprout 0.72s cubic-bezier(0.18, 1.4, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
}

.bud:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
  border-radius: 24px;
}

.bud img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.35s ease;
}

.bud .open-face {
  opacity: 0;
}

.bud.is-open .closed-face {
  opacity: 0;
}

.bud.is-open .open-face {
  opacity: 1;
}

.bud.pop {
  animation: bud-pop 0.46s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.fx {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.bit {
  position: absolute;
  animation: drift 0.95s ease-out forwards;
}

.bit.fountain {
  animation: heart-fly 1.45s cubic-bezier(0.12, 0.68, 0.28, 1) forwards;
}

.bit.fountain img {
  width: calc(26px * var(--s, 1));
}

.birds {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.bird {
  position: absolute;
  width: 118px;
  aspect-ratio: 666 / 574;
}

.bird.to-right {
  animation: bird-right 13s linear forwards;
}

.bird.to-left {
  animation: bird-left 14s linear forwards;
}

.scene[data-phase="night"] .bird {
  filter: brightness(0.72);
}

.bit-petal {
  width: 13px;
  height: 18px;
  background: var(--petal, #ff8eaf);
  border: 2px solid var(--ink);
  border-radius: 80% 10% 80% 10%;
}

.bit-heart img {
  width: 30px;
  height: auto;
  display: block;
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-1.15deg);
  }
  50% {
    transform: rotate(1.35deg);
  }
}

@keyframes burst {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.055);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes sprout {
  0% {
    transform: translateX(-50%) rotate(var(--rot)) scale(0.15);
  }
  100% {
    transform: translateX(-50%) rotate(var(--rot)) scale(var(--sx), var(--sy));
  }
}

@keyframes bud-pop {
  0% {
    transform: translateX(-50%) rotate(var(--rot)) scale(var(--sx), var(--sy));
  }
  45% {
    transform: translateX(-50%) rotate(var(--rot)) scale(calc(var(--sx) * 1.14), calc(var(--sy) * 1.14));
  }
  100% {
    transform: translateX(-50%) rotate(var(--rot)) scale(var(--sx), var(--sy));
  }
}

@keyframes drift {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(0.7);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--spin)) scale(1);
  }
}

@keyframes heart-fly {
  0% {
    opacity: 0;
    transform: translate(0, 12px) scale(0.35) rotate(0deg);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(var(--s, 1)) rotate(var(--spin));
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(9px) rotate(1.8deg);
  }
}

@keyframes sun-bob {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(-1.5deg);
  }
  50% {
    transform: translate(-50%, 9px) rotate(1.8deg);
  }
}

@keyframes sail {
  from {
    transform: translateX(-45vw);
  }
  to {
    transform: translateX(145vw);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.7);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes wingbeat {
  0%,
  30% {
    opacity: 1;
  }
  36%,
  100% {
    opacity: 0;
  }
}

@keyframes bird-right {
  from {
    transform: translateX(-18vw);
  }
  to {
    transform: translateX(112vw);
  }
}

@keyframes bird-left {
  from {
    transform: translateX(112vw) scaleX(-1);
  }
  to {
    transform: translateX(-18vw) scaleX(-1);
  }
}

@keyframes fly1 {
  0% {
    transform: translate(-12vw, 16vh) scaleX(1);
  }
  50% {
    transform: translate(48vw, 8vh) scaleX(1);
  }
  100% {
    transform: translate(108vw, 18vh) scaleX(1);
  }
}

@keyframes fly2 {
  0% {
    transform: translate(108vw, 24vh) scaleX(-1);
  }
  50% {
    transform: translate(40vw, 12vh) scaleX(-1);
  }
  100% {
    transform: translate(-14vw, 22vh) scaleX(-1);
  }
}

@keyframes fly3 {
  0% {
    transform: translate(-10vw, 30vh) scaleX(1);
  }
  40% {
    transform: translate(36vw, 14vh) scaleX(1);
  }
  100% {
    transform: translate(110vw, 26vh) scaleX(1);
  }
}

@keyframes wander {
  0% {
    opacity: 0.15;
    transform: translate(0, 0);
  }
  25% {
    opacity: 1;
    transform: translate(28px, -36px);
  }
  50% {
    opacity: 0.35;
    transform: translate(-18px, -70px);
  }
  75% {
    opacity: 0.95;
    transform: translate(22px, -28px);
  }
  100% {
    opacity: 0.15;
    transform: translate(0, 0);
  }
}

@keyframes rise {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-105vh) translateX(40px) rotate(50deg);
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .plaque {
    width: min(440px, calc(100% - 16px));
    padding: 10px 12px 8px;
    transform: translateX(-50%);
    top: max(10px, env(safe-area-inset-top));
  }

  .kicker {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  h1 {
    font-size: 1.55rem;
  }

  .line {
    font-size: 1rem;
  }

  .how {
    font-size: 0.82rem;
  }

  .rose {
    height: min(58dvh, 620px);
  }

  .orb {
    width: min(22vw, 108px);
  }

  .count {
    top: auto;
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: rotate(2deg);
  }

  .edge-flower {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .volume {
    width: min(210px, calc(100% - 132px));
  }
}

@media (max-height: 520px) {
  .plaque {
    padding: 6px 12px;
    top: max(6px, env(safe-area-inset-top));
  }

  h1 {
    margin: 0;
    font-size: 1.25rem;
  }

  .how {
    display: none;
  }

  .rose {
    height: min(72dvh, 520px);
  }

  .volume {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rose-sway,
  .rose-pop,
  .bud,
  .bit,
  .orb,
  .cloud-track,
  .cloud-track img,
  .butterfly,
  .butterfly img,
  .bird,
  .edge-flower img,
  .sway-flower,
  .firefly,
  .pollen i,
  .star {
    animation: none !important;
  }

  .stage,
  .bud img,
  .sky,
  .wash,
  .cloud-track img {
    transition: none;
  }
}
