/* Shared styles for the Christmas gift pages: /gift/, /gift/send/ and /gift/open/.
   Built on the start page's tokens, with a Christmas palette on top. */
:root {
  --primary:      #009fe4;
  --primary-dark: #0579ca;
  --bg:           #f5fbff;
  --text:         #022f49;
  --cinema:       #090f1a;
  --border:       #d6eef9;
  --muted:        rgba(2,47,73,.62);

  --xmas-red:      #c8102e;
  --xmas-red-dark: #9b0c23;
  --xmas-green:    #1f7a4d;
  --xmas-gold:     #e0a526;
  --xmas-cream:    #fff8e7;
  --snow:          #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "filson-pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--primary-dark); }
:focus-visible { outline: 3px solid var(--xmas-gold); outline-offset: 2px; border-radius: 4px; }

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===================== Night sky hero ===================== */
.night {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #14284a 0%, var(--cinema) 65%);
  color: #fff;
  isolation: isolate;
}
.night-photo {
  position: absolute;
  inset: -20% 0;
  background: url('/gang.jpg') center 40% / cover no-repeat;
  filter: brightness(0.25) saturate(0.55) hue-rotate(-8deg);
  z-index: -3;
  will-change: transform;
}
.night::after {
  /* Fades the photo into the page and leaves a snowdrift at the bottom */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(9,15,26,.5) 0%, rgba(9,15,26,.15) 45%, rgba(9,15,26,.85) 100%);
  z-index: -2;
  pointer-events: none;
}
.snow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.snowdrift {
  display: block;
  width: 100%;
  height: 46px;
  margin-top: -1px;
  margin-bottom: -1px;
  color: var(--bg);
}

/* ===================== String lights ===================== */
.lights {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  pointer-events: none;
  z-index: 3;
}
.lights svg { width: 100%; height: 100%; display: block; }
.lights .bulb { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center top; }
.lights .bulb:nth-child(3n)   { animation-delay: .8s; }
.lights .bulb:nth-child(3n+1) { animation-delay: 1.6s; }
@keyframes twinkle {
  0%, 100% { opacity: 1;   filter: drop-shadow(0 0 6px currentColor); }
  50%      { opacity: .45; filter: none; }
}

/* ===================== Header ===================== */
.site-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.9rem 1.25rem 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.site-logo { height: 32px; width: auto; display: block; }
.header-link {
  color: rgba(255,255,255,.85);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  transition: background .15s;
}
.header-link:hover { background: rgba(255,255,255,.16); color: #fff; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0 3px rgba(255,77,77,.25); animation: dot-blink 1.6s ease-in-out infinite; }
@keyframes dot-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 1rem 1.6rem;
  border-radius: .85rem;
  border: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-gift {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--xmas-red) 0%, #e63950 100%);
  box-shadow: 0 10px 30px rgba(200,16,46,.45), 0 1px 0 rgba(255,255,255,.3) inset;
}
.btn-gift:hover { box-shadow: 0 14px 40px rgba(200,16,46,.6), 0 1px 0 rgba(255,255,255,.3) inset; }
.btn-gift::after {
  /* Shine sweeping across the button */
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn-gift[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-gift[aria-disabled="true"]::after { display: none; }
.btn-ghost {
  color: #fff;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
}
.btn-ghost:hover { background: rgba(255,255,255,.18); }
.btn-light { color: var(--primary-dark); background: var(--border); }
.btn-light:hover { opacity: .88; }
.btn-blue { color: #fff; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: 0 8px 24px rgba(5,121,202,.35); }
.btn-small { padding: .65rem 1rem; font-size: .8rem; border-radius: .65rem; }
.btn .icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }

/* ===================== Sections ===================== */
.section { padding: 4rem 1.25rem; max-width: 1040px; margin: 0 auto; }
.section-narrow { max-width: 760px; }
.eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--xmas-red);
  margin-bottom: .6rem;
}
.section h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.2;
  margin-bottom: .8rem;
}
.lede { font-size: 1.05rem; color: var(--muted); max-width: 620px; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.6rem 1.5rem;
  box-shadow: 0 2px 14px rgba(0,159,228,.07);
}

/* Scroll-in */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===================== Gift card (preview of what is sent) ===================== */
.giftcard {
  position: relative;
  background: linear-gradient(160deg, #fff 0%, var(--xmas-cream) 100%);
  border-radius: 1.2rem;
  padding: 2.1rem 4.2rem 1.6rem 1.6rem;
  box-shadow: 0 18px 50px rgba(2,47,73,.16);
  overflow: hidden;
  border: 1px solid #f1e3c0;
}
.giftcard::before, .giftcard::after {
  /* Ribbon crossing the corner */
  content: '';
  position: absolute;
  background: var(--xmas-red);
}
.giftcard::before { top: 0; bottom: 0; right: 2.2rem; width: 14px; }
.giftcard::after  { left: 0; right: 0; top: 2.2rem; height: 14px; opacity: 0; }
.giftcard-bow { position: absolute; top: -.2rem; right: .9rem; width: 64px; height: 48px; }
.giftcard-label { font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--xmas-red); }
.giftcard-to { font-size: 1.45rem; font-weight: 800; line-height: 1.25; margin: .25rem 0 .8rem; word-break: break-word; }
.giftcard-message {
  font-style: italic;
  color: var(--text);
  white-space: pre-line;
  word-break: break-word;
  border-left: 3px solid var(--xmas-gold);
  padding-left: .85rem;
  margin-bottom: .9rem;
  min-height: 1.6em;
}
.giftcard-from { font-size: .9rem; color: var(--muted); }
.giftcard-what {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed #e8d5a6;
  font-size: .88rem;
  color: var(--muted);
}
.giftcard-what span:first-child { font-size: 1.6rem; }

/* ===================== Code box ===================== */
.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--bg);
  border: 2px dashed var(--primary);
  border-radius: .8rem;
  padding: .75rem .75rem .75rem 1.1rem;
}
.code-box code { font-family: "SFMono-Regular", Menlo, Consolas, "Courier New", monospace; font-size: 1.25rem; font-weight: 700; color: var(--text); letter-spacing: .04em; }

/* ===================== Footer (same as the start page) ===================== */
footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.83rem;
  color: rgba(2,47,73,.38);
}
footer a { color: rgba(2,47,73,.45); text-decoration: underline; }
footer a:hover { color: var(--muted); }
footer .footer-icons { margin-top: 0.6rem; display: flex; justify-content: center; gap: 0.75rem; }
footer .footer-icon-link { display: inline-flex; align-items: center; text-decoration: none; color: rgba(2,47,73,.45); }
footer .footer-icon-link:hover { color: var(--muted); }
footer .footer-icon-link svg { width: 1.35rem; height: 1.35rem; }

/* ===================== Terms modal (same as start page) ===================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(9,15,26,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 1000; }
.modal { background: #fff; border-radius: 1rem; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 1.75rem 1.5rem 2rem; position: relative; box-shadow: 0 24px 64px rgba(9,15,26,.3); }
.modal h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.modal h3 { font-size: .95rem; margin: 1.25rem 0 .4rem; font-weight: 800; }
.modal p  { font-size: .875rem; color: var(--muted); margin-bottom: .7rem; line-height: 1.7; }
.modal-close { position: absolute; top: 1.1rem; right: 1.1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: rgba(2,47,73,.07); border: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.link-button { background: none; border: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ===================== Popcorn burst ===================== */
.burst-piece {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  font-size: 1.6rem;
  line-height: 1;
  will-change: transform, opacity;
}

/* ===================== Toast ===================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 150%);
  background: var(--text);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: .7rem;
  font-size: .9rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(2,47,73,.3);
  transition: transform .25s ease;
  z-index: 2100;
}
.toast.show { transform: translate(-50%, 0); }

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