/* ==========================================================================
   Gifts: /give (the "let them choose the words" landing page), /claim and /gift-card.
   Builds on main.css tokens. The one new object is the gift card (.gcard), drawn at any size
   with container units, so the hero's small card, the claim page's and the printed A5 card are
   the same design. Motion is transform/opacity only, once, and none with reduced motion.
   ========================================================================== */

/* ---------- The gift card ---------- */
.gcard {
  position: relative; width: 100%; aspect-ratio: 148 / 210;
  container-type: inline-size;
  border-radius: 1.6cqw;
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(241, 228, 194, .7), transparent 62%),
    radial-gradient(90% 60% at 100% 100%, rgba(212, 174, 85, .16), transparent 60%),
    var(--card);
  box-shadow: 0 1px 2px rgba(40, 26, 10, .08), 0 18px 40px -18px rgba(40, 26, 10, .45), 0 40px 80px -40px rgba(122, 90, 16, .35);
  overflow: hidden;
  isolation: isolate;
}
/* paper fibre */
.gcard::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .07; pointer-events: none;
  background-image: 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.gcard__frame {
  position: absolute; inset: 4.6cqw;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 6cqw 6cqw 5cqw;
  border: max(1px, .28cqw) solid rgba(191, 148, 48, .8);
  border-radius: 1cqw;
  box-shadow: inset 0 0 0 1.3cqw transparent, inset 0 0 0 calc(1.3cqw + max(1px, .14cqw)) rgba(191, 148, 48, .38);
}
.gcard__top { display: flex; flex-direction: column; align-items: center; gap: 1.4cqw; }
.gcard__mark { width: 8.5cqw; height: auto; }
.gcard__word { font-family: var(--font-word); font-size: 3.1cqw; letter-spacing: .34em; padding-left: .34em; color: var(--gold-deep); }
.gcard__eyebrow { margin-top: 5cqw; font-size: 3.1cqw; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep); }
.gcard__title {
  margin-top: 2.6cqw; max-width: 84%;
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 7.6cqw; line-height: 1.06; letter-spacing: -.02em; text-wrap: balance;
}
.gcard__pendant {
  margin-top: 3.6cqw; display: flex; align-items: center; gap: 3cqw;
  font-family: var(--font-display); font-size: 5.4cqw; line-height: 1.2; letter-spacing: -.01em;
}
.gcard__pendant::before, .gcard__pendant::after { content: ''; width: 7cqw; height: max(1px, .25cqw); background: var(--gold); opacity: .7; }
.gcard__from { margin-top: 1.4cqw; font-family: var(--font-display); font-style: italic; font-size: 4.2cqw; color: var(--ink-2); }
.gcard__message {
  margin-top: 2.4cqw; max-width: 86%;
  font-family: var(--font-display); font-style: italic; font-size: 3.7cqw; line-height: 1.3; color: var(--ink-2);
  overflow-wrap: anywhere;
}
.gcard__message[hidden] { display: none; }
.gcard__code {
  margin-top: auto; display: grid; gap: 1cqw; justify-items: center;
  padding: 2.6cqw 6cqw 3cqw; border-radius: 2cqw;
  background: rgba(255, 252, 246, .85); border: max(1px, .25cqw) solid rgba(191, 148, 48, .7);
}
.gcard__code-label { font-size: 2.7cqw; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.gcard__code-value { font-family: var(--font-mono); font-weight: 700; font-size: 7.6cqw; letter-spacing: .1em; line-height: 1; padding-left: .1em; }
.gcard__code-value--blank { color: var(--line-strong); letter-spacing: .14em; }
.gcard__foot { margin-top: 3.6cqw; width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4cqw; align-items: center; text-align: left; }
.gcard__how { display: grid; gap: 1.2cqw; font-size: 2.75cqw; line-height: 1.35; color: var(--ink-2); counter-reset: h; }
.gcard__how li { counter-increment: h; display: grid; grid-template-columns: 4.2cqw 1fr; gap: 1.2cqw; align-items: baseline; }
.gcard__how li::before { content: counter(h); font-family: var(--font-display); font-weight: 500; font-size: 3.6cqw; color: var(--gold-deep); }
.gcard__how strong { color: var(--ink); white-space: nowrap; }
.gcard__qr { width: 18cqw; height: 18cqw; display: block; }
.gcard__qr svg { width: 100%; height: 100%; display: block; }
/* the small versions (hero, claim page) leave out the footer */
.gcard--small .gcard__frame { padding-bottom: 7cqw; }
.gcard--small .gcard__mark { width: 10cqw; }
.gcard--small .gcard__eyebrow { margin-top: 7cqw; }
.gcard--small .gcard__title { font-size: 8.4cqw; }
.gcard--small .gcard__code { margin-top: auto; }

/* ---------- Shared bits ---------- */
.give-eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: .95rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep);
}
.give-eyebrow::before { content: ''; width: 1.75rem; height: 2px; background: var(--gold); border-radius: 2px; }

/* ---------- /give: hero ---------- */
.give-hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(4.5rem, 9vw, 7rem); position: relative; overflow: hidden; }
.give-hero::before {
  content: ''; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; z-index: -1;
  background: radial-gradient(closest-side, rgba(241, 228, 194, .9), rgba(241, 228, 194, 0));
}
.give-hero__grid { display: grid; gap: clamp(3rem, 6vw, 5rem); align-items: center; }
@media (min-width: 980px) { .give-hero__grid { grid-template-columns: 1.05fr 1fr; } }
.give-hero h1 { margin-top: var(--s2); max-width: 13em; }
.give-hero h1 em { font-style: italic; font-weight: 400; color: var(--gold-deep); white-space: nowrap; }
.give-hero .lead { margin-top: var(--s3); }
.give-hero .btn-row { margin-top: var(--s4); }
.give-facts { display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 1.0625rem; }
.give-facts li { display: flex; align-items: center; gap: .55rem; }
.give-facts svg { color: var(--gold-deep); flex: none; }
.give-hero__media { position: relative; padding-bottom: 3rem; }
.give-hero__photo { aspect-ratio: 4 / 4.7; border-radius: var(--r-l); box-shadow: var(--sh-3); margin-left: auto; width: min(100%, 34rem); }
.give-hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
/* in the gap beside the photo, clear of the pendant in its box */
.give-hero__card { position: absolute; left: -3.75rem; bottom: 0; width: min(42%, 14rem); transform: rotate(-5deg); transform-origin: 30% 80%; }
@media (max-width: 979px) {
  .give-hero__media { padding-bottom: 0; margin-bottom: 5rem; }
  .give-hero__card { left: auto; right: .5rem; bottom: -5rem; width: 44%; transform: rotate(4deg); }
}
@media (max-width: 520px) { .give-hero__card { width: 47%; right: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .give-hero__card.rise { animation: card-in 1.1s var(--ease) .45s both; }
  @media (max-width: 979px) { .give-hero__card.rise { animation-name: card-in-phone; } }
}
@keyframes card-in { from { opacity: 0; transform: translate(-12px, 36px) rotate(-12deg); } to { opacity: 1; transform: rotate(-5deg); } }
@keyframes card-in-phone { from { opacity: 0; transform: translate(12px, 36px) rotate(10deg); } to { opacity: 1; transform: rotate(4deg); } }

/* ---------- /give: how it works ---------- */
.give-steps { display: grid; gap: var(--s3); margin-top: var(--s5); counter-reset: s; }
@media (min-width: 860px) { .give-steps { grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 2.5vw, 2rem); } }
.give-step {
  position: relative; display: grid; gap: .6rem; align-content: start;
  padding: clamp(1.5rem, 3vw, 2rem); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1);
}
.give-step__num {
  width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center; margin-bottom: .5rem;
  font-family: var(--font-display); font-size: 1.75rem; line-height: 1; color: var(--gold-deep);
  background: var(--gold-pale); box-shadow: inset 0 0 0 1px rgba(191, 148, 48, .5);
}
.give-step h3 { font-size: clamp(1.45rem, 1.25rem + .6vw, 1.7rem); }
.give-step p { color: var(--ink-2); }
@media (max-width: 859.98px) {
  /* on phones: the number beside the heading, so the three steps read as one short list */
  .give-steps { gap: 1rem; }
  .give-step { grid-template-columns: 2.75rem minmax(0, 1fr); column-gap: 1rem; row-gap: .35rem; padding: 1.25rem 1.25rem 1.4rem; }
  .give-step__num { width: 2.75rem; height: 2.75rem; font-size: 1.45rem; margin: 0; grid-row: span 2; }
  .give-step h3 { align-self: center; }
}
@media (min-width: 860px) {
  /* a hairline running from one step to the next */
  .give-step:not(:last-child)::after { content: ''; position: absolute; top: calc(clamp(1.5rem, 3vw, 2rem) + 1.6rem); left: calc(100% + 1px); width: clamp(1.25rem, 2.5vw, 2rem); height: 2px; background: var(--gold); opacity: .5; }
}

/* ---------- /give: the pendants ---------- */
.give-collection { margin-top: var(--s5); }
@media (max-width: 759.98px) {
  /* on phones: photo beside the words, so all three fit in a scroll or two */
  .give-collection { gap: 1.75rem; }
  .give-collection .piece { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
  .give-collection .piece__media { border-radius: var(--r); }
  .give-collection .piece__name a::after { border-radius: var(--r); }
  .give-collection .piece__body { padding-top: 0; gap: .25rem; }
  .give-collection .piece__top { flex-direction: column; gap: 0; }
  .give-collection .piece__name { font-size: 1.55rem; }
  .give-collection .piece__price { font-size: 1.35rem; }
  .give-collection .piece__meta { font-size: 1rem; line-height: 1.45; }
  .give-collection .piece__desc { font-size: 1.0625rem; line-height: 1.5; }
}
.give-note { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line); color: var(--ink-2); max-width: 46rem; }

/* ---------- /give: what she receives ---------- */
.give-card-grid { display: grid; gap: clamp(3rem, 6vw, 5rem); align-items: center; }
@media (min-width: 900px) { .give-card-grid { grid-template-columns: 1fr 1.05fr; } }
.give-card-stage { position: relative; width: min(100%, 23rem); margin-inline: auto; padding: 1.5rem 1.5rem 2rem; }
/* the envelope it came in, behind it */
.give-card-stage::before {
  content: ''; position: absolute; inset: 9% -4% 2% 6%; z-index: 0;
  border-radius: var(--r); background: linear-gradient(160deg, var(--paper-3), #DCCDB3);
  box-shadow: var(--sh-2); transform: rotate(5deg);
}
.give-card-stage .gcard { position: relative; z-index: 1; transform: rotate(-2.5deg); }
.give-aside { margin-top: var(--s4); padding: 1rem 1.25rem; border-left: 3px solid var(--gold); background: var(--card); border-radius: 0 var(--r) var(--r) 0; color: var(--ink-2); }

/* ---------- /give: why ---------- */
.give-why__title { max-width: 16em; }
.give-why__grid { display: grid; gap: var(--s4); margin-top: var(--s5); }
@media (min-width: 760px) { .give-why__grid { grid-template-columns: repeat(2, 1fr); gap: var(--s4) var(--s5); } }
@media (min-width: 1100px) { .give-why__grid { grid-template-columns: repeat(4, 1fr); } }
.give-why__item { padding-top: var(--s3); border-top: 2px solid var(--gold); }
.give-why__item h3 { font-family: var(--font-body); font-size: 1.25rem; font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.give-why__item p { margin-top: .5rem; color: var(--ink-2); }

/* ---------- /give: the end ---------- */
.give-end__inner { display: grid; justify-items: center; text-align: center; gap: var(--s3); }
.give-end__inner h2 { max-width: 14em; }
.give-end__inner .lead { margin: 0 auto; }
.give-end__inner .btn-row { justify-content: center; margin-top: var(--s2); }
.give-end__small { color: var(--on-night-2); font-size: 1.0625rem; }

/* ---------- /claim ---------- */
.claim { padding-block: clamp(2.5rem, 6vw, 5rem) var(--section); position: relative; overflow: hidden; }
.claim::before {
  content: ''; position: absolute; left: -15vw; top: -10vw; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px; z-index: -1;
  background: radial-gradient(closest-side, rgba(241, 228, 194, .85), rgba(241, 228, 194, 0));
}
.claim-view[hidden] { display: none !important; }
html[data-claim-view="done"] [data-view="enter"] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .claim-view.is-in > * { animation: rise .7s var(--ease) both; }
  .claim-view.is-in > :nth-child(2) { animation-delay: .08s; }
}
.claim-enter, .claim-found { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 900px) {
  .claim-enter { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .claim-found { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
}
.claim-enter__card { width: min(62%, 18rem); margin-inline: auto; transform: rotate(-4deg); }
@media (min-width: 900px) { .claim-enter__card { width: min(100%, 19rem); } }
.claim-enter__copy h1, .claim-found__copy h1 { margin-top: var(--s2); }
.claim-form { margin-top: var(--s4); }
.claim-form__row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: stretch; }
.claim-form__input {
  flex: 1 1 13rem; max-width: 18rem; min-height: 3.75rem;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.6rem; letter-spacing: .12em; text-transform: uppercase;
}
.claim-form__input::placeholder { letter-spacing: .12em; }
.claim-form__row .btn { flex: 0 0 auto; }
@media (max-width: 520px) { .claim-form__input { max-width: none; } .claim-form__row .btn { flex: 1 1 100%; } }
.claim-help { margin-top: var(--s3); color: var(--muted); font-size: 1.0625rem; }
.claim-help a { color: var(--ink); font-weight: 700; }
.claim-found__photo { aspect-ratio: 4 / 4.8; border-radius: var(--r-l); box-shadow: var(--sh-3); width: min(100%, 30rem); margin-inline: auto; }
.claim-found__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.claim-found__title { font-size: clamp(2.6rem, 1.8rem + 3vw, 4.2rem); }
.claim-found__title:focus { outline: none; }
.claim-done__inner { max-width: 46rem; margin-inline: auto; }
.claim-done__inner h1:focus { outline: none; }
.claim-done__address { margin-top: 1rem; color: var(--ink-2); font-size: 1.0625rem; }
.claim-done__to { font-weight: 700; color: var(--ink); }

/* ---------- /gift-card (printable) ---------- */
.gc-page { padding-block: clamp(2rem, 5vw, 4rem) var(--section); }
.gc-page__grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: start; }
@media (min-width: 960px) { .gc-page__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.gc-tools h1 { margin-top: var(--s2); font-size: clamp(2.3rem, 1.6rem + 2.4vw, 3.4rem); }
.gc-form { margin-top: var(--s4); display: grid; gap: var(--s3); }
.gc-form .field + .field { margin-top: 0; }
.gc-form .btn-row { margin-top: var(--s1); }
.gc-state { margin-top: var(--s3); }
.gc-state[hidden] { display: none; }
.gc-sheet { position: relative; display: grid; place-items: center; padding: clamp(1.5rem, 4vw, 3rem); border-radius: var(--r-l); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.gc-crop { position: relative; width: min(100%, 25rem); }
/* corner marks, to cut along when printed */
.gc-crop::before, .gc-crop::after {
  content: ''; position: absolute; inset: -14px; pointer-events: none;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) left top / 10px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left top / 1px 10px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right top / 10px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right top / 1px 10px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left bottom / 10px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left bottom / 1px 10px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right bottom / 10px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right bottom / 1px 10px no-repeat;
}
.gc-crop::after { display: none; }
.gc-sheet .gcard { box-shadow: var(--sh-2); border-radius: 0; }
.gc-sheet .gcard--placeholder .gcard__code-value { color: var(--line-strong); }

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { background: #fff !important; }
  body.page-giftcard > *:not(main), .page-giftcard .gc-tools, .page-giftcard .skip-link, .page-giftcard .consent { display: none !important; }
  .page-giftcard main, .page-giftcard .gc-page, .page-giftcard .gc-page .wrap, .page-giftcard .gc-page__grid { display: block; padding: 0; margin: 0; max-width: none; }
  .page-giftcard .gc-sheet { width: 210mm; height: 296mm; padding: 0; border-radius: 0; background: #fff; box-shadow: none; display: grid; place-items: center; break-inside: avoid; }
  .page-giftcard .gc-crop { width: 148mm; }
  .page-giftcard .gc-crop::before { inset: -6mm; background-size: auto; background:
    linear-gradient(#999, #999) left top / 4mm .2mm no-repeat, linear-gradient(#999, #999) left top / .2mm 4mm no-repeat,
    linear-gradient(#999, #999) right top / 4mm .2mm no-repeat, linear-gradient(#999, #999) right top / .2mm 4mm no-repeat,
    linear-gradient(#999, #999) left bottom / 4mm .2mm no-repeat, linear-gradient(#999, #999) left bottom / .2mm 4mm no-repeat,
    linear-gradient(#999, #999) right bottom / 4mm .2mm no-repeat, linear-gradient(#999, #999) right bottom / .2mm 4mm no-repeat; }
  .page-giftcard .gcard { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
