:root {
  --bg: #ede3d9;
  --paper: #f8f3ec;
  --paper-2: #f2e8dd;
  --ink: #3f342d;
  --muted: #7f6f63;
  --line: rgba(92, 71, 56, 0.12);
  --shadow: 0 20px 45px rgba(67, 45, 29, 0.10);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: linear-gradient(180deg, #e9ddd1 0%, #efe7df 100%);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.7) 0, transparent 24%),
    radial-gradient(circle at 80% 0%, rgba(255,255,255,.45) 0, transparent 20%),
    linear-gradient(rgba(255,255,255,.07), rgba(255,255,255,.07));
}

.paper-bg {
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 31px,
    rgba(100, 74, 56, 0.03) 32px
  );
  pointer-events: none;
}

main, header {
  width: min(980px, calc(100% - 28px));
  margin: 18px auto;
}

.section { margin-bottom: 18px; }
.card {
  position: relative;
  background: rgba(248, 243, 236, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(67, 45, 29, 0.14);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.textured-card::before,
.glow-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.textured-card::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.26), transparent 24%),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,.18), transparent 22%);
  opacity: .75;
}

.glow-card::before {
  background: radial-gradient(circle at top right, rgba(255, 252, 239, 0.9), transparent 35%);
}

.card-hero {
  padding: 28px;
  background: linear-gradient(180deg, rgba(248,243,236,.96), rgba(242,232,221,.95));
}

.eyebrow, .tiny {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--muted);
}

.hero-grid,
.split,
.letter-layout,
.gallery-grid,
.count-grid {
  display: grid;
  gap: 18px;
}

.hero-grid { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
.split { grid-template-columns: 1fr 1fr; }
.split.reverse { align-items: stretch; }
.letter-layout { grid-template-columns: 1.3fr 0.7fr; }
.gallery-grid { grid-template-columns: repeat(4, 1fr); }
.count-grid { grid-template-columns: repeat(4, 1fr); margin-top: 16px; }

h1, h2 {
  margin: 10px 0 12px;
  font-weight: 500;
  line-height: 1;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
}

h1 span, h2 {
  font-family: "Brush Script MT", "Segoe Script", cursive;
}

h2 { font-size: clamp(2rem, 5vw, 3rem); }

.lead, p, li {
  line-height: 1.7;
  font-size: 1rem;
}

.hero-actions,
.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  text-decoration: none;
  color: var(--ink);
  background: #fff8f1;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0,0,0,.08);
}

.btn.primary {
  background: #3f342d;
  color: #fffaf5;
}

.btn.accent {
  background: #ead6c2;
}

.polaroid {
  background: white;
  padding: 12px 12px 18px;
  border-radius: 6px;
  box-shadow: 0 15px 35px rgba(60, 41, 28, 0.16);
  transform: rotate(-2deg);
  transition: transform .35s ease, box-shadow .35s ease;
}
.polaroid.large { transform: rotate(2deg); }
.polaroid:hover {
  box-shadow: 0 18px 40px rgba(60, 41, 28, 0.22);
}
.polaroid img {
  width: 100%;
  display: block;
  border-radius: 4px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.polaroid p {
  margin: 10px 2px 0;
  text-align: center;
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: 1.4rem;
}

.note-card, .mini-stack, .letter-card, .countdown-card, .details-card, .gallery-card, .closing-card {
  padding: 24px;
}

.details-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}
.details-list li {
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.stamp-box {
  display: grid;
  gap: 16px;
  align-content: start;
}
.stamp {
  justify-self: start;
  padding: 10px 14px;
  border: 1px dashed rgba(90, 61, 42, 0.35);
  border-radius: 999px;
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: 1.6rem;
}
.mini-polaroid { transform: rotate(3deg); }

.count-grid div {
  text-align: center;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 10px;
  transition: transform .25s ease, background .25s ease;
}
.count-grid div:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.72);
}
.count-grid span {
  display: block;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
}
.count-grid small {
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.count-note { margin-top: 16px; color: var(--muted); }

.section-head { margin-bottom: 14px; }
.footer-note { padding-bottom: 36px; }

.tape {
  position: absolute;
  width: 88px;
  height: 24px;
  background: rgba(251, 241, 211, 0.7);
  top: 14px;
  border: 1px solid rgba(150, 136, 104, 0.14);
  transform: rotate(-10deg);
  backdrop-filter: blur(1px);
  animation: tapeWobble 4s ease-in-out infinite;
}
.tape-left { left: 28px; }
.tape-right { right: 28px; transform: rotate(10deg); animation-delay: .8s; }

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.22,1,.36,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left { transform: translateX(-48px); }
.reveal-right { transform: translateX(48px); }
.reveal-pop { transform: scale(.96) translateY(24px); }
.reveal.visible.reveal-left,
.reveal.visible.reveal-right,
.reveal.visible.reveal-pop { transform: translateX(0) translateY(0) scale(1); }

.delay-1 { transition-delay: .08s; }
.delay-2 { transition-delay: .16s; }
.delay-3 { transition-delay: .24s; }

.floaty { animation: floaty 5.5s ease-in-out infinite; }
.delay-float { animation-delay: 1.2s; }
.pulse-soft { animation: pulseSoft 3.2s ease-in-out infinite; }
.swing-on-hover:hover { transform: rotate(-1deg) translateY(-4px); }
.tilt-a { transform: rotate(-3deg); }
.tilt-b { transform: rotate(2deg); }
.tilt-c { transform: rotate(-1.5deg); }
.tilt-d { transform: rotate(3deg); }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes pulseSoft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: .82; }
}

@keyframes tapeWobble {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(-7deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 820px) {
  .hero-grid, .split, .letter-layout, .gallery-grid { grid-template-columns: 1fr; }
  .count-grid { grid-template-columns: repeat(2, 1fr); }
  .card-hero { padding: 22px; }
}

@media (max-width: 480px) {
  main, header { width: min(100% - 16px, 980px); margin: 8px auto; }
  .card-hero, .note-card, .mini-stack, .letter-card, .countdown-card, .details-card, .gallery-card, .closing-card { padding: 18px; }
  .btn { width: 100%; text-align: center; }
  .hero-actions, .detail-actions { flex-direction: column; }
  .count-grid { grid-template-columns: repeat(2, 1fr); }
}
