@font-face { font-family: "Nexa"; src: url("fonts/NexaBook.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nexa"; src: url("fonts/NexaXBold.otf") format("opentype"); font-weight: 800; font-display: swap; }

/* Layout: quiet centered intro, then a responsive grid of gift cards like a registry shelf */
:root {
  /* Brand: purple, red, gold main; blue, white, black accents */
  --purple: #79345D;
  --red: #B70D12;
  --gold: #CC9C22;
  --blue: #1473BC;

  --bg: #FFFFFF;
  --surface: #FAF6F8;
  --band: #79345D;
  --fg: #1B1118;
  --muted: #6E5A66;
  --line: #E8DDE3;
  --heading: #79345D;
  --price: #79345D;
  --button-bg: #79345D;
  --button-fg: #FFFFFF;
  --seal: #B70D12;

  --font: "Nexa", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #150D12; --surface: #21151D; --band: #4E2140; --fg: #F4ECF1; --muted: #B9A5B1; --line: #3A2833;
    --heading: #E7B8D2; --price: #E9C46A; --button-bg: #CC9C22; --button-fg: #150D12; --seal: #E2453F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #150D12; --surface: #21151D; --band: #4E2140; --fg: #F4ECF1; --muted: #B9A5B1; --line: #3A2833;
  --heading: #E7B8D2; --price: #E9C46A; --button-bg: #CC9C22; --button-fg: #150D12; --seal: #E2453F;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
}
.wrap {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Intro */
.intro { padding-block: 88px 56px; text-align: center; }
/* Full-bleed dark purple band behind the intro (text reversed out to white), continuing partway down the first card */
.intro, .registry::before { background: var(--band); box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); }
.intro h1 {
  margin: 0; color: #FFFFFF; font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1.08; text-wrap: balance;
}
.intro p.lede { max-width: 44ch; margin: 24px auto 0; line-height: 1.65; color: #FFFFFF; font-size: clamp(1rem, 2.6vw, 1.3rem); }
.rule { display: flex; justify-content: center; gap: 6px; margin-top: 28px; }
.rule span { width: 96px; height: 4px; border-radius: 2px; background: var(--gold); }

/* Grid */
.registry {
  position: relative; display: grid; gap: 28px; padding-block: 8px 72px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.registry::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: var(--band-h, 200px); /* set by the script at the bottom of index.html */
}

/* Card */
.gift {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
/* Every photo sits on the same soft blurred altar background */
.gift-photo { position: relative; aspect-ratio: 4 / 5; max-width: 100%; background: #F3EDEA url("images/background.jpg") center / cover; }
.gift-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Real product photos: show the whole item on a white ground */
.gift-photo.has-photo img { object-fit: contain; padding: 16px; }
.gift-photo.has-photo.fill img { object-fit: cover; padding: 0; }
.gift-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 20px 20px 22px; min-width: 0; }
.gift-name { margin: 0; font-weight: 800; font-size: 1.12rem; line-height: 1.3; text-wrap: balance; }
.gift-note { margin: 0; color: var(--muted); font-size: 0.92rem; }
.gift-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; }
.gift-price { color: var(--price); font-weight: 800; font-size: 1.35rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.gift-price small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.gift-price.tbd { font-size: 1rem; color: var(--muted); }
.gift-btn {
  flex-shrink: 0; padding: 10px 16px; border-radius: 4px;
  background: var(--button-bg); color: var(--button-fg);
  font: 800 0.88rem/1 var(--font); letter-spacing: 0.04em; text-decoration: none;
}
.gift-btn:hover { filter: brightness(1.12); }
.gift-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ===== Purchased state =====
   Add class="gift purchased" to any card once it has been given.
   Greys out the photo and text, strikes through the price, and swaps the button for a red thank-you line. */
.gift.purchased .gift-photo img { filter: grayscale(1); opacity: 0.45; }
.gift.purchased .gift-name,
.gift.purchased .gift-note,
.gift.purchased .gift-price { color: var(--muted); }
.gift.purchased .gift-btn { display: none; }
.gift .gift-thanks { display: none; }
.gift.purchased .gift-price { text-decoration: line-through; text-decoration-thickness: 2px; }
.gift.purchased .gift-thanks { display: block; color: var(--seal); font-weight: 800; font-size: 0.88rem; }

footer { padding-block: 0 56px; text-align: center; color: var(--muted); font-size: 0.9rem; }

@media (prefers-reduced-motion: no-preference) {
  .gift { transition: transform 160ms ease, box-shadow 160ms ease; }
  .gift:not(.purchased):hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(121, 52, 93, 0.14); }
}
