/* Erinn's wish list: an open jewellery box in dark red velvet, gold and Christmas greenery. */

@font-face { font-family: "Italiana"; src: url("fonts/italiana-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --velvet: #3e0b15;
  --velvet-deep: #24060b;
  --gold-1: #f3dc9b;
  --gold-2: #c9a04c;
  --gold-3: #8e6a2a;
  --satin: #f2d9d6;
  --lilac: #dcb7ad;
  --text: #f8eee9;
  --pine: #1f4a32;
  --pine-2: #2f6a45;
  --berry: #d3263b;
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0; overflow-x: clip; min-height: 100vh; color: var(--text);
  font: 15px/1.55 "Jost", system-ui, sans-serif;
  background:
    radial-gradient(120% 60% at 50% 0%, #6a1524 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .7 0 0 0 0 .7 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--velvet);
}
.gold-text {
  background:
    linear-gradient(105deg, transparent 42%, rgba(255,250,232,.95) 50%, transparent 58%) 160% 0 / 300% 100% no-repeat,
    linear-gradient(170deg, var(--gold-1) 10%, var(--gold-2) 45%, #fff1c4 55%, var(--gold-3) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* The lid of the box */
header { max-width: 760px; margin: 0 auto; padding: 34px 16px 0; }
.lid {
  position: relative; text-align: center; padding: 58px 22px 34px; border-radius: 18px 18px 6px 6px;
  background: radial-gradient(90% 120% at 50% 0%, #561320, var(--velvet-deep));
  box-shadow: 0 20px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(243,220,155,.25);
}
.lid::before { content: ""; position: absolute; inset: 10px; border-radius: 12px 12px 3px 3px; border: 1px solid rgba(243,220,155,.4); pointer-events: none; }
.fromto { margin: 0; font: italic 500 19px/1.35 "Cormorant Garamond", serif; color: var(--lilac); }
h1 { margin: 8px 0 0; font: 400 clamp(54px, 16vw, 104px)/1 "Italiana", serif; letter-spacing: .04em; }
.sub { margin: 2px 0 0; font: 500 20px "Cormorant Garamond", serif; color: var(--satin); }
.countdown { margin: 16px 0 0; color: var(--lilac); }
.countdown b { font: 600 22px "Cormorant Garamond", serif; color: var(--gold-1); }
.hinge { height: 8px; margin: 0 18px; border-radius: 0 0 6px 6px; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); box-shadow: 0 4px 10px rgba(0,0,0,.4); }

.budget { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 30px 0 0; padding: 0 16px; }
.budget button {
  font: 500 14px "Jost", sans-serif; letter-spacing: .02em; cursor: pointer; color: var(--gold-1);
  padding: 8px 18px; border-radius: 999px; background: transparent; border: 1px solid rgba(243,220,155,.45);
}
.budget button[aria-pressed="true"] { color: var(--velvet-deep); border-color: transparent; background: linear-gradient(170deg, var(--gold-1), var(--gold-2) 60%, var(--gold-3)); }
.budget button:focus-visible, .open:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 3px; }

/* Compartments */
.grid { list-style: none; margin: 0 auto; padding: 34px 16px 30px; max-width: 1100px; display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.slot {
  position: relative; padding: 14px; border-radius: 14px;
  background: linear-gradient(160deg, #4a0f1a, var(--velvet-deep));
  box-shadow: inset 0 2px 3px rgba(255,255,255,.06), inset 0 -10px 24px rgba(0,0,0,.5), 0 1px 0 rgba(243,220,155,.15);
}
.cushion {
  position: relative; aspect-ratio: 4 / 3; border-radius: 10px; display: grid; place-items: center;
  background:
    radial-gradient(60% 50% at 35% 30%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(80% 60% at 70% 85%, rgba(160,100,110,.25), transparent 70%),
    linear-gradient(135deg, #f7e3e0, var(--satin) 50%, #e6c2c0);
  box-shadow: inset 0 6px 14px rgba(110,30,40,.3), inset 0 -2px 6px rgba(255,255,255,.4);
}
.jewel {
  width: 68%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 66px;
  box-shadow: 0 12px 18px rgba(110,30,40,.3), inset 0 -6px 12px rgba(0,0,0,.08), 0 0 0 4px rgba(255,255,255,.6);
}
/* Price on a tiny jewellery tag on a thread */
.tag { position: absolute; right: 46px; top: 0; width: 0; height: 0; z-index: 2; pointer-events: none; }
.pend { position: absolute; left: 0; top: 0; transform-origin: 0 0; rotate: 4deg; will-change: transform; }
.pend::before { content: ""; position: absolute; left: 0; top: 0; height: 30px; border-left: 1px solid rgba(110,30,40,.55); }
.pend span {
  position: absolute; left: 0; top: 28px; transform: translateX(-58%) rotate(-8deg); transform-origin: 58% 0;
  padding: 4px 10px 4px 18px; white-space: nowrap; background: #fffdf9; color: #3e0b15;
  font: 600 17px "Cormorant Garamond", serif;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.size {
  position: absolute; left: 10px; bottom: 10px; padding: 2px 10px; font: 500 12px "Jost", sans-serif; letter-spacing: .03em;
  color: var(--velvet); background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px var(--gold-2), 0 0 0 3px #fff;
}
.crown {
  position: absolute; left: 22px; top: 22px; z-index: 2; padding: 3px 10px; border-radius: 999px;
  font: italic 500 15px "Cormorant Garamond", serif; color: var(--velvet-deep);
  background: linear-gradient(170deg, var(--gold-1), var(--gold-2) 60%, var(--gold-3));
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.plaque { margin-top: 14px; padding: 0 4px; }
.name { margin: 0; font: 600 22px/1.15 "Cormorant Garamond", serif; }
.meta { margin: 4px 0 0; font-size: 13px; color: var(--lilac); }
.note { margin: 8px 0 0; font: italic 500 18px/1.3 "Cormorant Garamond", serif; color: var(--satin); }
.open {
  display: block; margin-top: 14px; padding: 10px; text-align: center; border-radius: 8px; text-decoration: none;
  color: var(--gold-1); border: 1px solid rgba(243,220,155,.5); font-weight: 500;
}
.open:hover { color: var(--velvet-deep); background: linear-gradient(170deg, var(--gold-1), var(--gold-2)); }

.empty { grid-column: 1 / -1; text-align: center; font: italic 500 22px "Cormorant Garamond", serif; color: var(--lilac); }
footer { text-align: center; padding: 10px 16px 44px; color: var(--lilac); font: italic 500 18px "Cormorant Garamond", serif; }

/* Christmas: a pine garland over the lid, holly in its corners, softly falling snow. */
header { position: relative; z-index: 1; }
.garland { position: absolute; left: -6px; right: -6px; top: -16px; height: 84px; width: calc(100% + 12px); z-index: 2; overflow: visible; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
.holly { position: absolute; width: 64px; z-index: 2; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); }
.holly.bl { left: -8px; bottom: -12px; rotate: -20deg; }
.holly.br { right: -8px; bottom: -12px; rotate: 20deg; scale: -1 1; }
.crown svg { width: 18px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.snow i { position: absolute; top: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: var(--o);
  animation: fall var(--d) linear var(--delay) infinite; }
@keyframes fall { to { transform: translate(var(--drift), 105vh); } }
main, nav, footer { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .snow { display: none; } }

/* ---- Animations ---- */
/* 1. The lid swings up on its hinge when the page opens. */
header { perspective: 1100px; }
.intro .lid { transform-origin: 50% 100%; animation: lidOpen 1.5s cubic-bezier(.55,0,.25,1.18) .35s both; }
@keyframes lidOpen { from { transform: rotateX(84deg); filter: brightness(.4); } 75% { filter: brightness(1); } to { transform: none; } }
.intro .budget { animation: fadeIn .6s 1.4s both; }
@keyframes fadeIn { from { opacity: 0; } }

/* 2. Gifts rise out of their satin cushion; on a filter change they sink back in. */
.slot.rise { animation: slotIn .55s var(--delay, 0s) both ease-out; }
.slot.rise .jewel { animation: jewelUp .8s calc(var(--delay, 0s) + .12s) both cubic-bezier(.2,.9,.3,1.35); }
.slot.rise .tag { animation: fadeIn .4s calc(var(--delay, 0s) + .5s) both; }
@keyframes slotIn { from { opacity: 0; transform: translateY(18px); } }
@keyframes jewelUp { from { opacity: 0; transform: translateY(42%) scale(.5); } }
.slot.sink .jewel { animation: jewelDown .42s both ease-in; }
.slot.sink .tag, .slot.sink .crown { animation: fadeOut .25s both; }
.slot.sink { animation: fadeOut .35s .22s both; }
@keyframes jewelDown { to { opacity: 0; transform: translateY(40%) scale(.5); } }
@keyframes fadeOut { to { opacity: 0; } }
.spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; pointer-events: none; z-index: 3;
  background: radial-gradient(circle, #fff8dc, var(--gold-2) 60%, transparent 70%); }

/* 3. Lights in the garland switch on one by one, then twinkle; a sheen glides over the gold name. */
.fl { opacity: .18; transition: opacity .25s; }
.fl.on { opacity: 1; animation: blink var(--t, 3s) ease-in-out var(--d, 0s) infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.sheen { animation: sheen 7s ease-in-out 2.4s infinite; }
@keyframes sheen { 0% { background-position: 160% 0, 0 0; } 22%, 100% { background-position: -60% 0, 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .intro .lid, .intro .budget, .slot.rise, .slot.rise .jewel, .slot.rise .tag, .slot.sink, .slot.sink .jewel, .sheen, .fl.on { animation: none; }
}
.jewel { overflow: hidden; }
.jewel img { width: 74%; height: 74%; object-fit: contain; }

/* Real product photos sit in a white circle; without a photo a gift shows a 🎁. */
.jewel { background: #fff; }
.jewel.missing { font-size: 60px; }
.status { grid-column: 1 / -1; text-align: center; font: italic 500 22px "Cormorant Garamond", serif; color: var(--lilac); }
