:root {
  color-scheme: light;
  --bg: #f6f0e7;
  --card: #ffffff;
  --accent: #b0855b;
  --accent-dark: #8f6a48;
  --text: #2a221b;
  --muted: #7b6d60;
  --line: rgba(176, 133, 91, 0.2);
  --shadow: 0 8px 22px rgba(42, 34, 27, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.75rem;
}

body {
  font-family: "Inter", system-ui, sans-serif;
    background: radial-gradient(circle at top, #fbf7f1 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.6;
}

body.overlay-open {
  overflow: hidden;
}

body.overlay-open .page {
  filter: blur(6px);
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.hero {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.45));
  border-radius: calc(var(--radius) * 1.6);
  padding: 32px 32px 48px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.logo {
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav a:hover {
  color: var(--accent-dark);
}

.hero-content {
  display: grid;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: "Playfair Display", serif;
  margin-top: -2rem;
  font-size: clamp(2.6rem, 5vw, 4rem);
  display: grid;
  gap: 12px;
}

.subtitle {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}

.hero-card {
  background: transparent;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.label {
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.18em;
}

.value {
  font-weight: 600;
  margin-top: 6px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(176, 133, 91, 0.22);
}

.button:hover {
  transform: translateY(-2px);
}

.button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  box-shadow: none;
}

section {
  margin-top: 72px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.section-title {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.section-title h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-family: "Playfair Display", serif;
}

.story-grid,
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.story-card,
.note {
  background: transparent;
  padding: 18px 0;
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid var(--line);
}

.story-card h3,
.note h3 {
  margin-bottom: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.mosaic-col {
  display: grid;
  gap: 12px;
}

.mosaic img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  border: 1px solid var(--line);
}

.photo {
  background: transparent;
  padding: 0 0 16px;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.photo img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 0;
  border: 1px solid var(--line);
}

.photo figcaption {
  color: var(--muted);
  font-size: 0.9rem;
}

.hint {
  margin-top: 16px;
  color: var(--muted);
}

.present-cta {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.present-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: transparent;
  padding: 24px;
  overflow-y: auto;
}

.present-panel.show {
  display: grid;
  place-items: center;
}

.present-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  border: none;
  cursor: default;
}

.present-content {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  width: min(900px, 100%);
  box-shadow: none;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.present-stage {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
  position: relative;
}

.gift-button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.sparkles {
  position: absolute;
  inset: -40px;
  pointer-events: none;
  opacity: 0;
}

.sparkles span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--accent) 60%, transparent 70%);
  opacity: 0;
}

.present-panel.loading .sparkles {
  opacity: 1;
}

.present-panel.loading .sparkles span {
  animation: sparkle 1.4s ease-in-out infinite;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confettiFall 4.5s ease-in-out forwards;
}

.sparkles span:nth-child(1) {
  top: 5%;
  left: 10%;
  animation-delay: 0s;
}
.sparkles span:nth-child(2) {
  top: 15%;
  left: 70%;
  animation-delay: 0.3s;
}
.sparkles span:nth-child(3) {
  top: 35%;
  left: 30%;
  animation-delay: 0.6s;
}
.sparkles span:nth-child(4) {
  top: 50%;
  left: 80%;
  animation-delay: 0.9s;
}
.sparkles span:nth-child(5) {
  top: 70%;
  left: 15%;
  animation-delay: 0.2s;
}
.sparkles span:nth-child(6) {
  top: 75%;
  left: 60%;
  animation-delay: 0.5s;
}
.sparkles span:nth-child(7) {
  top: 25%;
  left: 50%;
  animation-delay: 0.8s;
}
.sparkles span:nth-child(8) {
  top: 60%;
  left: 40%;
  animation-delay: 1.1s;
}
.sparkles span:nth-child(9) {
  top: 10%;
  left: 90%;
  animation-delay: 0.4s;
}
.sparkles span:nth-child(10) {
  top: 85%;
  left: 30%;
  animation-delay: 0.7s;
}
.sparkles span:nth-child(11) {
  top: 40%;
  left: 5%;
  animation-delay: 1s;
}
.sparkles span:nth-child(12) {
  top: 45%;
  left: 95%;
  animation-delay: 1.2s;
}

.present-reveal {
  display: none;
  gap: 16px;
  width: min(900px, 100%);
  position: relative;
}

.present-reveal .close {
  position: absolute;
  top: -6px;
  right: 6px;
  border: 1px solid var(--line);
  background: #fffaf2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.present-panel.opened .present-reveal {
  display: grid;
}

.present-panel.opened .present-stage {
  display: none;
}

.present-content h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.6rem;
}

.close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  color: var(--muted);
  cursor: pointer;
}

.gift {
  width: 200px;
  height: 170px;
  position: relative;
  margin: 0 auto;
  transform-origin: center bottom;
}

.gift-box {
  position: absolute;
  bottom: 0;
  width: 200px;
  height: 120px;
  background: #f2e6d5;
  border: 2px solid var(--line);
  border-radius: 18px;
}

.gift-lid {
  position: absolute;
  top: 10px;
  width: 200px;
  height: 52px;
  background: #f7efe3;
  border: 2px solid var(--line);
  border-radius: 18px;
  transform-origin: bottom center;
}

.gift-ribbon {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 18px;
  height: 120px;
  background: var(--accent);
  transform: translateX(-50%);
  border-radius: 12px;
}

.gift-bow {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 70px;
  height: 36px;
  transform: translateX(-50%);
}

.gift-bow::before,
.gift-bow::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 22px;
  background: var(--accent);
  border-radius: 14px 14px 2px 14px;
}

.gift-bow::before {
  left: 0;
  transform: rotate(-18deg);
}

.gift-bow::after {
  right: 0;
  transform: rotate(18deg) scaleX(-1);
}

.gift.open {
  animation: giftPop 0.9s ease;
}

.gift.open .gift-lid {
  animation: lidOpen 0.9s ease forwards;
}

.gift.open .gift-bow {
  animation: bowPop 0.8s ease forwards;
}

.present-panel.opened .gift.open,
.present-panel.opened .gift.open .gift-lid,
.present-panel.opened .gift.open .gift-bow {
  animation: none;
}

.pdf-wrap {
  border: 1px solid var(--line);
  background: #fffaf2;
  border-radius: 18px;
  padding: 18px;
}

.present-panel.opened .pdf-wrap {
  border: none;
  padding: 0;
  background: transparent;
}

.pdf-wrap iframe {
  width: 100%;
  height: min(70vh, 560px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

@keyframes lidOpen {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  100% {
    transform: rotate(-22deg) translate(-16px, -14px);
  }
}

@keyframes bowPop {
  0% {
    transform: translateX(-50%) scale(1);
  }
  60% {
    transform: translateX(-50%) scale(1.25);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@keyframes giftPop {
  0% {
    transform: scale(0.85);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}


@keyframes confettiFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift), 100vh, 0) rotate(360deg);
    opacity: 0;
  }
}


.timeline {
  display: grid;
  gap: 18px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 16px;
  background: transparent;
  padding: 8px 0 18px;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}

.timeline-item h3 {
  margin-bottom: 6px;
}

.timeline-item span {
  color: var(--muted);
  font-size: 0.85rem;
}

.dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 6px;
  box-shadow: 0 0 0 6px rgba(176, 133, 91, 0.16);
}

.note ul {
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.footer {
  margin-top: 72px;
  text-align: center;
  display: grid;
  gap: 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 900px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    gap: 12px;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 22px 16px 48px;
  }

  .hero {
    padding: 26px 18px 32px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 9vw, 3rem);
  }

  .nav-links {
    gap: 10px;
  }

  .nav a {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
    text-align: center;
  }

  .hero-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 14px;
  }

  .story-grid,
  .notes-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 12px;
  }

  .timeline-item {
    grid-template-columns: 16px 1fr;
    gap: 12px;
  }

  .photo img {
    height: 190px;
  }

  .present-content {
    padding: 22px 18px;
  }

  .gift {
    width: 160px;
    height: 140px;
  }

  .gift-box {
    width: 160px;
    height: 100px;
  }

  .gift-lid {
    width: 160px;
    height: 44px;
  }

  .gift-ribbon {
    height: 100px;
  }

  .pdf-wrap iframe {
    height: 60vh;
  }

  section {
    margin-top: 56px;
  }
}
