:root {
  --pine: #142a24;
  --pine-2: #1d3b32;
  --frost: #dcebe5;
  --snow: #fbfaf6;
  --cream: #f6f0e4;
  --ink: #1f2a26;
  --muted: #6b7a73;
  --line: #e7e0d2;
  --berry: #b8323a;
  --berry-dark: #962830;
  --gold: #d9b26a;
  --claimed: #eef3ef;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--snow);
  font: 16px/1.55 "Nunito Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(217, 178, 106, 0.20), transparent 70%),
    radial-gradient(circle at 100% 40%, rgba(220, 235, 229, 0.08), transparent 40%),
    linear-gradient(180deg, var(--pine-2), var(--pine) 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* --- falling snow (two layers, pure CSS) --- */

.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snow i {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 10%, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 25% 35%, rgba(255,255,255,.9) 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 20%, #fff 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 55% 45%, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 15%, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 85% 40%, rgba(255,255,255,.85) 50%, transparent 51%),
    radial-gradient(2px 2px at 95% 25%, #fff 50%, transparent 51%);
  background-size: 320px 320px;
  opacity: 0.55;
  animation: fall 14s linear infinite;
}
.snow i:nth-child(2) {
  background-size: 210px 210px;
  opacity: 0.3;
  animation-name: fall-far;
  animation-duration: 18s;
  filter: blur(0.5px);
}
@keyframes fall { to { background-position: 0 320px; } }
@keyframes fall-far { to { background-position: 0 210px; } }

/* --- layout --- */

.page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  /* bottom padding keeps the last card clear of the corner badge */
  padding: 34px 16px 104px;
}

/* --- hero --- */

.hero { text-align: center; padding: 8px 0 6px; }

.garland {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 0 auto 22px;
  max-width: 340px;
  position: relative;
}
.garland::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -10px;
  height: 22px;
  border-bottom: 1.5px solid rgba(220, 235, 229, 0.35);
  border-radius: 0 0 50% 50%;
}
.garland span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px 2px rgba(217, 178, 106, 0.6);
  animation: glow 2.4s ease-in-out infinite alternate;
}
.garland span:nth-child(odd) { background: #f06a6f; box-shadow: 0 0 10px 2px rgba(240, 106, 111, 0.55); animation-delay: 0.8s; }
.garland span:nth-child(3n) { background: #9fe0c8; box-shadow: 0 0 10px 2px rgba(159, 224, 200, 0.5); animation-delay: 1.6s; }
.garland span:nth-child(2), .garland span:nth-child(6) { transform: translateY(6px); }
.garland span:nth-child(3), .garland span:nth-child(5) { transform: translateY(10px); }
.garland span:nth-child(4) { transform: translateY(11px); }
@keyframes glow { from { opacity: 0.55; } to { opacity: 1; } }

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: clamp(40px, 11vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
h1 em { font-style: italic; color: var(--gold); }

.lede {
  margin: 16px auto 0;
  max-width: 54ch;
  color: rgba(251, 250, 246, 0.74);
}

.tally {
  display: inline-block;
  margin: 18px 0 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px;
  color: rgba(251, 250, 246, 0.82);
}
.tally strong { color: #fff; }

/* --- notice + toast --- */

.notice { margin: 20px auto 0; max-width: 640px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.notice-error { background: #fdecec; color: #85202a; }
.notice-warn { background: #fff5d8; color: #6a5212; }
.notice a { color: inherit; font-weight: 800; }

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--snow);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.55);
  z-index: 10;
  animation: drop 0.25s ease-out;
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }

/* --- gifts --- */

.gifts {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
@media (min-width: 680px) { .gifts { grid-template-columns: 1fr 1fr; gap: 16px; } }

.gift {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 4px 14px;
  padding: 16px;
  border-radius: 20px;
  background: var(--snow);
  color: var(--ink);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: transform 0.2s, background 0.2s;
}
.gift:not(.is-claimed):hover { transform: translateY(-2px); }

.gift.skeleton { min-height: 132px; background: rgba(255, 255, 255, 0.08); box-shadow: none; animation: shimmer 1.2s ease-in-out infinite alternate; }
@keyframes shimmer { from { opacity: 0.5; } to { opacity: 1; } }

.gift-art {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--cream), #ece2cf);
  font-size: 28px;
  line-height: 1;
}

.gift-body { min-width: 0; align-self: center; }

h2 {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.2;
}

.meta { margin: 4px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.price { font-weight: 800; color: var(--pine-2); }
.meta a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted currentColor; }
.meta a:hover { color: var(--berry); }

.gift-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.free { color: var(--muted); font-size: 14px; }

.btn {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--berry-dark); }
.btn:disabled { opacity: 0.6; cursor: progress; }

.btn-quiet {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn-quiet:hover { color: var(--berry); border-color: var(--berry); }

/* claimed */
.gift.is-claimed { background: var(--claimed); }
.gift.is-claimed .gift-art { filter: grayscale(0.4); opacity: 0.75; }
.gift.is-claimed h2 { color: #4d5b55; }
.gift.is-claimed::after {
  content: "Claimed";
  position: absolute;
  top: 14px;
  right: -6px;
  padding: 3px 12px 3px 10px;
  border-radius: 6px 0 0 6px;
  background: var(--berry);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px -4px rgba(150, 40, 48, 0.6);
}
.gift.is-claimed .gift-body { padding-right: 64px; }
.ribbon { font-size: 14px; font-weight: 700; color: var(--pine-2); overflow-wrap: anywhere; }

/* claim form */
.gift.is-open { box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7), 0 0 0 2px var(--gold); }
.claim { justify-content: flex-start; }
.claim input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.claim input:focus { outline: none; border-color: var(--berry); box-shadow: 0 0 0 3px rgba(184, 50, 58, 0.15); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.foot { margin-top: 32px; text-align: center; color: rgba(251, 250, 246, 0.55); font-size: 13px; }

@media (min-width: 680px) {
  .page { padding-top: 56px; }
  .gift { padding: 18px 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
