@import url("https://fonts.googleapis.com/css2?family=ZCOOL+XiaoWei&family=Noto+Serif+SC:wght@500;700;900&display=swap");

:root {
  --ink: #251821;
  --muted: #766471;
  --paper: #fff8fb;
  --rose: #e94473;
  --coral: #ff7a68;
  --mint: #4fc3a1;
  --gold: #f5b83b;
  --blue: #5267c9;
  --line: rgba(37, 24, 33, 0.14);
  --shadow: 0 24px 70px rgba(109, 42, 73, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 226, 129, 0.35), transparent 26rem),
    linear-gradient(135deg, #fff9f1 0%, #ffe5ed 46%, #e8f7ff 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

#sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

#fireworks {
  position: fixed;
  inset: 0;
  z-index: 18;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  filter: saturate(1.25) drop-shadow(0 0 12px rgba(255, 255, 255, 0.75));
  opacity: 0;
  transition: opacity 240ms ease;
}

#fireworks.is-active {
  opacity: 1;
}

#flowerField {
  position: fixed;
  inset: 0;
  z-index: 17;
  overflow: hidden;
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 5vw, 68px);
  background: rgba(255, 248, 251, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(22px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  border-radius: 50%;
  box-shadow: 0 12px 25px rgba(233, 68, 115, 0.32);
}

.nav {
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav a,
.upload-link {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
}

.nav a:hover,
.upload-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.9);
}

.icon-button,
.close-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(64, 31, 51, 0.12);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  gap: clamp(28px, 7vw, 92px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(38px, 8vw, 92px) clamp(20px, 6vw, 82px) 72px;
}

.hero::after {
  position: absolute;
  right: 8%;
  bottom: 18px;
  left: 8%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(37, 24, 33, 0.18), transparent);
}

.hero-copy {
  max-width: 790px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rose);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", "Songti SC", "STSong", "Kaiti SC", "KaiTi", serif;
  font-size: clamp(42px, 7.4vw, 88px);
  font-weight: 500;
  line-height: 1.1;
  text-shadow: 0 12px 34px rgba(139, 55, 91, 0.13);
}

h2 {
  font-family: "Noto Serif SC", "Songti SC", "STSong", "PingFang SC", serif;
  font-weight: 700;
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 48px);
  line-height: 1.05;
}

.typing {
  min-height: 62px;
  max-width: 650px;
  color: #5e4858;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.55;
}

.typing::after {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -2px;
  content: "";
  background: var(--rose);
  animation: blink 0.8s steps(1) infinite;
}

.hero-actions,
.dialog-actions,
.gallery-head,
.section-heading {
  display: flex;
  align-items: center;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.primary-action,
.secondary-action,
.upload-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  cursor: pointer;
  border-radius: 999px;
}

.primary-action {
  min-width: 148px;
  padding: 12px 18px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  border: 0;
  box-shadow: 0 18px 36px rgba(233, 68, 115, 0.32);
}

.secondary-action {
  padding: 12px 18px;
  color: var(--ink);
  font-weight: 850;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.secondary-action:disabled {
  cursor: wait;
  opacity: 0.78;
}

.flower-action {
  color: #315f4b;
  background: rgba(245, 255, 249, 0.78);
}

.love-orbit {
  position: relative;
  width: min(32vw, 390px);
  aspect-ratio: 1;
  min-width: 250px;
  border-radius: 50%;
  filter: drop-shadow(0 30px 48px rgba(151, 44, 102, 0.24));
}

.love-orbit::before,
.love-orbit::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.love-orbit::before {
  inset: 9% -8%;
  background:
    radial-gradient(ellipse at 22% 45%, rgba(255, 255, 255, 0.72), transparent 4%),
    radial-gradient(ellipse at 54% 52%, rgba(255, 151, 199, 0.28), transparent 11%),
    radial-gradient(ellipse at 70% 45%, rgba(255, 217, 142, 0.3), transparent 12%),
    linear-gradient(90deg, transparent 4%, rgba(222, 91, 151, 0.12), rgba(255, 255, 255, 0.48), rgba(255, 177, 211, 0.2), transparent 96%);
  opacity: 0.84;
  pointer-events: none;
  filter: blur(0.4px);
  transform: rotate(-15deg);
}

.love-orbit::after {
  top: 16%;
  right: 8%;
  width: 44px;
  height: 44px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 70% 72%, rgba(89, 18, 67, 0.44), transparent 34%),
    linear-gradient(135deg, #ffd69a, #ef79ad 48%, #7d285f);
  box-shadow: 0 0 30px rgba(239, 121, 173, 0.34);
  animation: satellite 8s ease-in-out infinite;
}

.love-orbit span {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(236, 117, 170, 0.24);
  border-radius: 50%;
  transform: rotateX(68deg) rotateZ(0deg);
  animation: orbit 16s linear infinite;
}

.love-orbit span:nth-child(2) {
  inset: 17%;
  border-color: rgba(232, 204, 142, 0.42);
  animation-duration: 12s;
  animation-direction: reverse;
}

.love-orbit span:nth-child(3) {
  inset: 25%;
  border-color: rgba(255, 169, 212, 0.34);
  animation-duration: 9s;
}

.heart-core {
  position: absolute;
  inset: 29%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.82), transparent 13%),
    radial-gradient(ellipse at 22% 65%, rgba(255, 137, 190, 0.84), transparent 20%),
    radial-gradient(ellipse at 70% 34%, rgba(255, 205, 142, 0.56), transparent 21%),
    radial-gradient(ellipse at 62% 78%, rgba(133, 47, 118, 0.78), transparent 24%),
    radial-gradient(circle at 74% 76%, rgba(46, 13, 56, 0.58), transparent 38%),
    linear-gradient(145deg, #ff9cc7 0%, #e9549c 46%, #c13f86 72%, #641842 100%);
  border: 1px solid rgba(255, 221, 239, 0.48);
  border-radius: 50%;
  box-shadow:
    inset -30px -26px 44px rgba(54, 10, 63, 0.44),
    inset 17px 13px 26px rgba(255, 255, 255, 0.22),
    0 0 34px rgba(255, 123, 181, 0.36),
    0 26px 70px rgba(126, 39, 102, 0.3);
  animation: planetFloat 6s ease-in-out infinite;
  overflow: visible;
}

.heart-core::before {
  position: absolute;
  inset: 33% -42%;
  content: "";
  border: 8px solid rgba(255, 196, 220, 0.36);
  border-top-color: rgba(255, 234, 187, 0.7);
  border-bottom-color: rgba(191, 63, 134, 0.18);
  border-radius: 50%;
  filter: blur(0.2px);
  transform: rotate(-15deg);
}

.heart-core::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(165deg, transparent 22%, rgba(255, 255, 255, 0.12) 28%, transparent 36%),
    linear-gradient(18deg, transparent 38%, rgba(255, 220, 237, 0.16) 45%, transparent 53%),
    radial-gradient(circle at 68% 68%, rgba(0, 0, 0, 0.18), transparent 32%);
  border-radius: 50%;
}

.timer-band,
.gallery-band,
.letter-band {
  padding: 76px clamp(20px, 6vw, 82px);
}

.timer-band {
  background: rgba(255, 255, 255, 0.42);
}

.section-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(128px, 1fr));
  gap: 16px;
}

.time-tile {
  min-height: 156px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.time-tile strong {
  display: block;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1;
}

.time-tile span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.letter-band {
  display: flex;
  justify-content: center;
}

.letter {
  max-width: 920px;
  padding-left: 24px;
  border-left: 4px solid var(--rose);
}

.letter p {
  margin-bottom: 12px;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "PingFang SC", serif;
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.32;
}

.gallery-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.upload-link {
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.95);
}

.upload-link svg {
  width: 18px;
  height: 18px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.photo-card {
  position: relative;
  min-height: 286px;
  overflow: hidden;
  background: #fbe5ec;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(81, 39, 63, 0.18);
  transform: translateY(18px);
  opacity: 0;
  animation: rise 0.7s ease forwards;
}

.photo-card img {
  width: 100%;
  height: 100%;
  min-height: 286px;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.photo-card:hover img {
  transform: scale(1.06);
}

.delete-photo {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  cursor: pointer;
  background: rgba(37, 24, 33, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(37, 24, 33, 0.18);
  opacity: 0;
  backdrop-filter: blur(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.delete-photo svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.photo-card:hover .delete-photo,
.delete-photo:focus-visible {
  opacity: 1;
}

.delete-photo:hover {
  background: rgba(233, 68, 115, 0.86);
  transform: translateY(-1px);
}

.photo-meta {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 12px;
  color: white;
  background: linear-gradient(180deg, rgba(37, 24, 33, 0.1), rgba(37, 24, 33, 0.72));
  border-radius: 8px;
}

.photo-meta p {
  margin: 0;
  font-weight: 850;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 320px;
  place-items: center;
  padding: 32px;
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(233, 68, 115, 0.38);
  border-radius: 8px;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
}

.empty-state span {
  color: var(--muted);
}

.upload-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  background: transparent;
  border: 0;
}

.upload-dialog::backdrop {
  background: rgba(37, 24, 33, 0.36);
  backdrop-filter: blur(12px);
}

.upload-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: clamp(22px, 5vw, 34px);
  background: rgba(255, 250, 252, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
}

.upload-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.upload-card input[type="password"],
.upload-card input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.upload-card input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(233, 68, 115, 0.13);
}

.drop-zone {
  min-height: 164px;
  place-items: center;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(233, 68, 115, 0.44);
  border-radius: 8px;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-zone strong {
  color: var(--ink);
  font-size: 20px;
}

.drop-zone small {
  color: var(--muted);
}

.drop-zone.is-over {
  background: rgba(255, 230, 237, 0.78);
  border-color: var(--rose);
}

.dialog-actions {
  justify-content: space-between;
  gap: 16px;
}

#uploadStatus {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

#deleteStatus {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.danger-action {
  background: linear-gradient(135deg, #d9365f, #ff6f61);
}

.burst {
  position: fixed;
  z-index: 20;
  width: 10px;
  height: 10px;
  pointer-events: none;
  background: var(--rose);
  border-radius: 50%;
  animation: burst 820ms ease-out forwards;
}

.flower {
  position: fixed;
  z-index: 19;
  width: var(--size);
  height: var(--size);
  pointer-events: none;
  perspective: 680px;
  filter: drop-shadow(0 18px 30px rgba(148, 48, 105, 0.22));
  transform: translate(-50%, -50%) rotate(var(--turn)) scale(0.16);
  transform-style: preserve-3d;
  animation: flowerLife 8400ms ease-in-out forwards;
}

.flower::before {
  position: absolute;
  inset: 30% 22% 18%;
  content: "";
  background: radial-gradient(ellipse at center, rgba(77, 49, 64, 0.22), transparent 70%);
  border-radius: 50%;
  filter: blur(10px);
  transform: translateZ(-24px) rotateX(72deg);
}

.flower-petal {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: var(--z);
  width: var(--petal-w);
  height: var(--petal-h);
  background:
    radial-gradient(ellipse at 38% 18%, rgba(255, 255, 255, 0.9), transparent 28%),
    radial-gradient(ellipse at 68% 72%, var(--petal-deep), transparent 62%),
    linear-gradient(180deg, var(--petal-light) 0%, var(--petal) 62%, var(--petal-deep) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 78% 22% 72% 28% / 72% 30% 70% 28%;
  box-shadow:
    inset -7px -12px 16px rgba(110, 26, 72, 0.2),
    inset 6px 8px 14px rgba(255, 255, 255, 0.28),
    0 8px 14px rgba(128, 48, 92, 0.14);
  opacity: 0;
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translateY(4%)
    rotateX(86deg)
    rotateY(0deg)
    scale(0.16);
  transform-origin: 50% 88%;
  animation: flowerPetalOpen 1850ms cubic-bezier(0.16, 0.86, 0.18, 1.04) forwards;
  animation-delay: var(--delay);
}

.flower-petal.layer-0 {
  filter: saturate(1.05);
}

.flower-petal.layer-1 {
  filter: brightness(1.05) saturate(1.08);
}

.flower-petal.layer-2,
.flower-petal.layer-3,
.flower-petal.layer-4 {
  filter: brightness(1.1) saturate(1.12);
}

.flower-petal.curl {
  border-radius: 88% 12% 80% 20% / 84% 22% 78% 18%;
  filter: brightness(1.12) saturate(1.2);
}

.flower-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 60;
  width: 18%;
  height: 18%;
  background:
    radial-gradient(circle at 32% 28%, #fffbe6 0 12%, transparent 13%),
    radial-gradient(circle at 50% 50%, #ffd958 0 34%, #f1a842 58%, #b55a2d 100%);
  border-radius: 50%;
  box-shadow:
    0 0 18px rgba(255, 218, 93, 0.5),
    0 6px 14px rgba(175, 57, 112, 0.22),
    inset -3px -5px 10px rgba(127, 61, 22, 0.24),
    inset 3px 3px 8px rgba(255, 255, 255, 0.42);
  opacity: 0;
  transform: translate(-50%, -50%) rotateX(58deg) scale(0.35);
  animation: coreGlow 1700ms 620ms ease forwards;
}

.flower-core::before {
  position: absolute;
  inset: -42%;
  content: "";
  background:
    radial-gradient(circle at 50% 0%, #fff9c7 0 6%, transparent 7%),
    radial-gradient(circle at 86% 18%, #ffe575 0 5%, transparent 6%),
    radial-gradient(circle at 100% 52%, #fff2a6 0 6%, transparent 7%),
    radial-gradient(circle at 80% 86%, #ffd66d 0 5%, transparent 6%),
    radial-gradient(circle at 48% 100%, #fff1a0 0 6%, transparent 7%),
    radial-gradient(circle at 12% 82%, #ffd66d 0 5%, transparent 6%),
    radial-gradient(circle at 0% 48%, #fff4ad 0 6%, transparent 7%),
    radial-gradient(circle at 16% 14%, #ffe575 0 5%, transparent 6%);
  border-radius: 50%;
  opacity: 0.88;
  filter: drop-shadow(0 0 5px rgba(255, 227, 103, 0.56));
}

.flower-core::after {
  position: absolute;
  inset: -48%;
  z-index: -1;
  content: "";
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 214, 109, 0.62) 0 24%, rgba(255, 143, 186, 0.38) 42%, transparent 72%),
    conic-gradient(from 18deg, rgba(255, 177, 209, 0.42), rgba(255, 235, 149, 0.35), rgba(255, 142, 193, 0.44), rgba(255, 177, 209, 0.42));
  border-radius: 50%;
  filter: blur(0.4px);
  transform: rotateX(6deg);
}

.flower-stamen {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 61;
  width: var(--stamen-size);
  height: var(--stamen-size);
  background:
    radial-gradient(circle at 32% 28%, #fffdf0 0 20%, transparent 21%),
    radial-gradient(circle, #ffe871 0 45%, #d8753a 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 220, 92, 0.62);
  opacity: 0;
  transform: translate(-50%, -50%) translate(0, 0) rotateX(58deg) scale(0.28);
  animation: stamenPop 1200ms ease forwards;
  animation-delay: var(--stamen-delay);
}

.floating-petal {
  position: fixed;
  z-index: 18;
  width: var(--w);
  height: calc(var(--w) * 1.45);
  pointer-events: none;
  background:
    radial-gradient(ellipse at 38% 20%, rgba(255, 255, 255, 0.82), transparent 38%),
    linear-gradient(180deg, var(--float-light), var(--float-petal));
  border-radius: 70% 70% 58% 58% / 86% 86% 30% 30%;
  opacity: 0;
  animation: petalDrift var(--duration) linear forwards;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes orbit {
  to {
    transform: rotateX(68deg) rotateZ(360deg);
  }
}

@keyframes pulse {
  50% {
    transform: scale(1.04) rotate(-2deg);
  }
}

@keyframes planetFloat {
  50% {
    transform: translateY(-8px) scale(1.015);
  }
}

@keyframes satellite {
  50% {
    transform: translate(-14px, 16px) scale(0.82);
  }
}

@keyframes rise {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes burst {
  to {
    transform: translate(var(--x), var(--y)) scale(0);
    opacity: 0;
  }
}

@keyframes flowerLife {
  14% {
    transform: translate(-50%, -50%) rotate(var(--turn)) scale(1);
    opacity: 1;
  }

  78% {
    transform: translate(-50%, -50%) rotate(var(--turn)) scale(1.04);
    opacity: 1;
  }

  to {
    transform: translate(-50%, -50%) rotate(var(--turn)) scale(0.84) translateY(30px);
    opacity: 0;
  }
}

@keyframes flowerPetalOpen {
  18% {
    opacity: 1;
  }

  58% {
    transform:
      translate(-50%, -50%)
      rotate(var(--angle-open))
      translateY(calc(var(--open) * 0.72))
      rotateX(calc(var(--tilt) + 18deg))
      rotateY(13deg)
      scale(0.94);
  }

  to {
    opacity: 0.98;
    transform:
      translate(-50%, -50%)
      rotate(var(--angle-open))
      translateY(var(--open))
      rotateX(var(--tilt))
      rotateY(var(--sway, -9deg))
      scale(1);
  }
}

@keyframes coreGlow {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotateX(58deg) scale(1);
  }
}

@keyframes stamenPop {
  58% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(calc(var(--sx) * 0.72), calc(var(--sy) * 0.72)) rotateX(58deg) scale(1.08);
  }

  to {
    opacity: 0.96;
    transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) rotateX(58deg) scale(1);
  }
}

@keyframes petalDrift {
  8% {
    opacity: 0.88;
  }

  to {
    transform: translate(var(--dx), var(--dy)) rotate(var(--spin));
    opacity: 0;
  }
}

@media (hover: none) {
  .delete-photo {
    opacity: 1;
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 52px;
  }

  .love-orbit {
    width: min(72vw, 360px);
    justify-self: center;
  }

  .timer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-head,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding-inline: 14px;
  }

  .nav {
    gap: 4px;
  }

  .nav a {
    padding-inline: 8px;
  }

  h1 {
    font-size: 38px;
    line-height: 1.13;
  }

  .timer-grid {
    gap: 10px;
  }

  .time-tile {
    min-height: 126px;
    padding: 18px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
