:root {
  --pink-light: #f8e9eb;
  --pink-soft: #f3d9df;
  --pink-dusty: #d48f9d;
  --ink: #332c30;
  --muted: #776c70;
  --paper: rgba(255, 252, 250, 0.82);
  --line: rgba(115, 75, 84, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--pink-light);
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1.7;
}

body.opening-active {
  overflow: hidden;
}

button {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.opening-screen {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100dvh;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #f8e9eb 0%, #f5dfe4 52%, #efd2da 100%);
  animation: appear 0.8s ease both;
}

.opening-content {
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(3.1rem, 9vw, 5.8rem);
  line-height: 1.05;
}

.button {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.button-primary {
  margin-top: 30px;
  padding: 10px 27px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-size: 0.9rem;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #4d3d42;
  box-shadow: 0 7px 18px rgba(51, 44, 48, 0.15);
  transform: translateY(-2px);
}

.button:focus-visible,
.music-button:focus-visible {
  outline: 3px solid rgba(212, 143, 157, 0.5);
  outline-offset: 3px;
}

.opening-screen.is-closing {
  animation: disappear 0.45s ease forwards;
  pointer-events: none;
}

.birthday-page {
  min-height: 100vh;
  padding: 8vh 24px;
  background: radial-gradient(circle at 85% 5%, #f5d9df 0, transparent 33%), var(--pink-light);
}

.birthday-page.is-visible {
  animation: rise 0.7s ease both;
}

.birthday-card {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(30px, 6vw, 66px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 20px 60px rgba(121, 76, 87, 0.09);
}

.card-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

h2 {
  max-width: 600px;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.12;
}

.age-label {
  margin: 13px 0 0;
  color: var(--pink-dusty);
  font-size: 1rem;
  font-weight: 600;
}

.message {
  max-width: 625px;
  margin: 27px 0 34px;
  color: #54484d;
  font-size: clamp(0.95rem, 2vw, 1.04rem);
}

.message p {
  margin: 0 0 15px;
}

.message p:last-child {
  margin-bottom: 0;
}

.photo-grid {
  display: grid;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1.7;
  grid-template-columns: 1.25fr 0.75fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.photo {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--pink-soft);
}

.photo-main {
  grid-row: span 2;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}

.photo:hover img {
  transform: scale(1.04);
}

.closing {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.music-control {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2;
}

.music-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(115, 75, 84, 0.15);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 252, 250, 0.9);
  box-shadow: 0 5px 18px rgba(121, 76, 87, 0.1);
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.music-button:hover {
  color: var(--ink);
  transform: translateY(-2px);
}

.music-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.music-button:disabled:hover {
  color: var(--muted);
  transform: none;
}

.music-icon {
  color: var(--pink-dusty);
  font-size: 1rem;
  line-height: 1;
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes disappear {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

@media (max-width: 560px) {
  .birthday-page {
    padding: 28px 14px 80px;
  }

  .birthday-card {
    padding: 28px 20px 25px;
    border-radius: 18px;
  }

  .photo-grid {
    grid-template-columns: 1fr 1fr;
    aspect-ratio: 0.95;
    grid-template-rows: 1.15fr 0.75fr;
  }

  .photo-main {
    grid-column: span 2;
    grid-row: auto;
  }

  .music-control {
    right: 14px;
    bottom: 14px;
  }
}

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