/* ─────────────────────────────────────────────────────────────
   Evelyn is 1 — a party table, not a mood board.
   Candy palette, rounded display type, and every present is a
   parcel whose ribbon ties itself as people chip in.
   ───────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  --ink: #2b1b4d;
  --ink-soft: #6b5b8a;
  --paper: #fff4fa;
  --card: #ffffff;

  --grape: #7b3fe4;
  --bubble: #ff3d8b;
  --tangerine: #ff8a29;
  --lemon: #ffd23d;
  --mint: #00ce9b;
  --sky: #35b4ff;

  /* Two companions per accent: what text sits ON it, and a darkened version
     for accent-coloured text on white — the bright candy tones fail contrast
     as small text, so they never carry any. */
  --accent: var(--grape);
  --on-accent: #fff;
  --accent-ink: var(--grape);
  /* Bubblegum is the one accent too light for white text at button size, so
     that card alone sets --accent-btn to a deeper tone. It is deliberately not
     declared here: a :root `var(--accent)` would resolve to grape at :root and
     inherit that literal colour into every card. */
  --mint-ink: #04815f;
  --radius: 24px;
  --lift: 0 12px 28px rgba(43, 27, 77, 0.1);

  --display: 'Baloo 2', 'Trebuchet MS', sans-serif;
  --novelty: 'Bagel Fat One', 'Baloo 2', cursive;
  --body: 'Nunito', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--paper);
  /* Confetti already on the tablecloth. */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(123, 63, 228, 0.1) 0 6px, transparent 6px),
    radial-gradient(circle at 82% 12%, rgba(255, 61, 139, 0.1) 0 5px, transparent 5px),
    radial-gradient(circle at 68% 62%, rgba(0, 206, 155, 0.1) 0 7px, transparent 7px),
    radial-gradient(circle at 24% 78%, rgba(255, 210, 61, 0.14) 0 6px, transparent 6px);
  background-size: 420px 420px, 380px 380px, 460px 460px, 340px 340px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2 { font-family: var(--display); line-height: 1.1; margin: 0; }

.page { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }

.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

/* ── Bunting ─────────────────────────────────────────────── */

.bunting { width: 100%; line-height: 0; }
.bunting svg { width: 100%; height: 44px; display: block; }

/* ── Hero ────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) 1fr;
  gap: clamp(16px, 4vw, 56px);
  align-items: center;
  padding: clamp(24px, 5vw, 56px) 0 clamp(28px, 5vw, 48px);
}

.hero-mark { position: relative; display: flex; justify-content: center; }

.numeral {
  font-family: var(--novelty);
  font-size: clamp(150px, 22vw, 260px);
  line-height: 0.82;
  background: linear-gradient(160deg, var(--bubble) 0%, var(--grape) 48%, var(--sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(6px 8px 0 rgba(43, 27, 77, 0.12));
}

.numeral.small { font-size: 84px; display: block; margin-bottom: 4px; }

/* The photo leans on the numeral rather than sitting beside it. */
.hero-photo {
  position: absolute;
  right: 4%;
  bottom: -6%;
  width: clamp(120px, 34%, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 7px solid var(--card);
  box-shadow: var(--lift);
  rotate: -4deg;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bubble);
  margin: 0 0 8px;
}

.hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -0.01em; }
.lede { color: var(--ink-soft); max-width: 46ch; margin: 14px 0 0; }

/* ── Tally ───────────────────────────────────────────────── */

.tally {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.tally-count {
  font-size: 20px;
  font-weight: 800;
  color: var(--card);
  background: var(--grape);
  border-radius: 999px;
  padding: 2px 14px;
}

/* ── Cards ───────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(43, 27, 77, 0.14); }

.card[data-accent='grape']     { --accent: var(--grape);     --on-accent: #fff;       --accent-ink: #6a2fd0; }
.card[data-accent='bubble']    { --accent: var(--bubble);    --on-accent: #fff;       --accent-ink: #d1276f; --accent-btn: #cf2069; }
.card[data-accent='tangerine'] { --accent: var(--tangerine); --on-accent: var(--ink); --accent-ink: #a85600; }
.card[data-accent='mint']      { --accent: var(--mint);      --on-accent: var(--ink); --accent-ink: var(--mint-ink); }
.card[data-accent='sky']       { --accent: var(--sky);       --on-accent: var(--ink); --accent-ink: #0a6da6; }
.card[data-accent='lemon']     { --accent: var(--lemon);     --on-accent: var(--ink); --accent-ink: #8a6500; }

/* The parcel: photo, a ribbon down it, a bow once it is covered. */
.parcel { position: relative; }

.card-media {
  aspect-ratio: 4 / 3;
  background: color-mix(in srgb, var(--accent) 14%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media .placeholder {
  position: relative;
  z-index: 2;
  font-size: 40px;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(43, 27, 77, 0.18);
}

.ribbon-down {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30%;
  width: 20px;
  margin-left: -10px;
  background: var(--accent);
  opacity: 0.92;
}

.bow {
  position: absolute;
  left: 30%;
  bottom: -18px;
  transform: translateX(-50%);
  font-size: 34px;
  filter: drop-shadow(0 3px 4px rgba(43, 27, 77, 0.25));
  z-index: 2;
}

.heart {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--body);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(43, 27, 77, 0.16);
  transition: transform 140ms ease;
}
.heart:hover { transform: scale(1.06); }
.heart.on { color: var(--bubble); }

.card-body { padding: 20px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-title { font-size: 20px; font-weight: 700; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline wavy var(--accent); text-underline-offset: 4px; }
.shop {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-top: -8px;
}
.note { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* The cross-ribbon: funding literally ties the parcel. */
.progress { margin-top: auto; }
.ribbon-track {
  height: 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, white);
  overflow: hidden;
}
.ribbon-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background-image: repeating-linear-gradient(
    115deg,
    var(--accent) 0 12px,
    color-mix(in srgb, var(--accent) 72%, white) 12px 24px
  );
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.amounts {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  font-size: 15px;
}
.amounts strong { font-family: var(--display); font-size: 21px; font-weight: 800; }
.amounts .left { color: var(--ink-soft); }
.amounts .covered { font-family: var(--display); font-weight: 700; color: var(--mint-ink); }

.card.wrapped { background: color-mix(in srgb, var(--mint) 7%, white); }
.card.wrapped .card-media { filter: saturate(0.75); }

/* ── Buttons ─────────────────────────────────────────────── */

button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.btn {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 90ms ease, box-shadow 90ms ease, background 120ms ease;
}
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 12%, white); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }

.btn.primary { background: var(--accent-btn, var(--accent)); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-btn, var(--accent)) 86%, black);
}
.btn.big { width: 100%; padding: 12px 18px; font-size: 17px; margin-top: 4px; }
.btn.ghost { box-shadow: none; border-color: color-mix(in srgb, var(--ink) 25%, white); }

.btn.link {
  border: none;
  background: none;
  box-shadow: none;
  padding: 2px 0;
  font-family: var(--body);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.link:hover:not(:disabled) { background: none; color: var(--accent-ink); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.quiet { gap: 16px; }

:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; border-radius: 6px; }

/* ── Pledges and forms ───────────────────────────────────── */

.pledgers {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 9%, white);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}
.pledgers li { display: flex; justify-content: space-between; gap: 10px; }
.pledgers a { color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.pledgers a:hover { text-decoration: underline; }

.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 2px dashed color-mix(in srgb, var(--ink) 18%, white);
}
.form label { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--ink-soft); }

input[type='text'], input[type='password'] {
  font: inherit;
  width: 100%;
  padding: 11px 14px;
  border: 2px solid color-mix(in srgb, var(--ink) 20%, white);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}
input:focus { border-color: var(--accent); }

.error {
  color: #d11d63;
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}
.hint, .note-line { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* ── Photo slots ─────────────────────────────────────────── */

.photo-empty {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: repeating-linear-gradient(
    45deg,
    color-mix(in srgb, var(--grape) 8%, white) 0 10px,
    color-mix(in srgb, var(--bubble) 8%, white) 10px 20px
  );
  color: var(--ink-soft);
  font-size: 22px;
}
.photo-empty code {
  font-size: 10px;
  letter-spacing: 0.02em;
  max-width: 86%;
  text-align: center;
  word-break: break-all;
}

.garland {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 3vw, 28px);
  margin: 64px 0 8px;
}
.polaroid {
  background: var(--card);
  padding: 10px 10px 6px;
  border-radius: 6px;
  box-shadow: var(--lift);
  width: 190px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.polaroid:nth-child(1) { rotate: -3deg; }
.polaroid:nth-child(2) { rotate: 1.5deg; }
.polaroid:nth-child(3) { rotate: 4deg; }
.polaroid img,
.polaroid .photo-empty { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
.polaroid .caption {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
}

.footer { text-align: center; color: var(--ink-soft); font-size: 14px; margin-top: 40px; }

/* ── Splash ──────────────────────────────────────────────── */

.splash {
  min-height: calc(100dvh - 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.invite {
  background: var(--card);
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(43, 27, 77, 0.16);
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.invite h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.invite .lede { margin: 0 auto 22px; }
.invite form { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.invite .error { text-align: center; }

.shake { animation: shake 380ms ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-9px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

/* ── Small screens ───────────────────────────────────────── */

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; text-align: center; }

  /* Side by side rather than stacked: at this width the photo sat on top of
     the numeral and swallowed it. */
  .hero-mark { align-items: flex-end; gap: 0; margin-bottom: 22px; }
  .numeral { font-size: clamp(140px, 38vw, 200px); }
  .hero-photo {
    position: static;
    width: clamp(96px, 27vw, 124px);
    margin-left: -16px;
    margin-bottom: 10px;
  }

  .lede { margin-inline: auto; }
  .tally { justify-content: center; }
  .card-media { aspect-ratio: 3 / 2; }
  .card-media .placeholder { width: 72px; height: 72px; font-size: 34px; }
}

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

/* ── Category chapters ───────────────────────────────────── */

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}
.jump a {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  text-transform: lowercase;
  padding: 6px 15px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(43, 27, 77, 0.08);
  transition: transform 120ms ease;
}
.jump a::before { content: '↓ '; opacity: 0.5; }
.jump a:hover { transform: translateY(-2px); }
.jump a[data-accent='bubble']    { color: #d1276f; }
.jump a[data-accent='grape']     { color: #6a2fd0; }
.jump a[data-accent='tangerine'] { color: #a85600; }
.jump a[data-accent='sky']       { color: #0a6da6; }
.jump a[data-accent='mint']      { color: var(--mint-ink); }

.chapter { scroll-margin-top: 20px; }
/* A lone present in a three-column grid looks stranded; give it one column and
   let it sit under the band's copy. */
.chapter.single .grid { grid-template-columns: minmax(0, 420px); }
.chapter + .chapter { margin-top: 72px; }

.band {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  margin-bottom: 28px;
  min-height: clamp(240px, 34vw, 380px);
  display: flex;
  align-items: flex-end;
  scroll-margin-top: 16px;
  background: color-mix(in srgb, var(--accent) 16%, white);
}
.band[data-accent='bubble']    { --accent: var(--bubble);    --accent-ink: #d1276f; }
.band[data-accent='grape']     { --accent: var(--grape);     --accent-ink: #6a2fd0; }
.band[data-accent='tangerine'] { --accent: var(--tangerine); --accent-ink: #a85600; }
.band[data-accent='sky']       { --accent: var(--sky);       --accent-ink: #0a6da6; }
.band[data-accent='mint']      { --accent: var(--mint);      --accent-ink: var(--mint-ink); }

.band-media { position: absolute; inset: 0; }
.band-media video,
.band-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Enough shade under the copy to keep it readable over any clip. */
.band::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 16, 52, 0.82) 0%, rgba(28, 16, 52, 0.24) 46%, transparent 78%);
}

.band-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: repeating-linear-gradient(
    45deg,
    color-mix(in srgb, var(--accent) 14%, white) 0 14px,
    color-mix(in srgb, var(--accent) 24%, white) 14px 28px
  );
  color: var(--ink);
  font-size: 30px;
}
.band-empty code { font-size: 11px; opacity: 0.75; }

.band-copy {
  position: relative;
  z-index: 1;
  padding: clamp(20px, 4vw, 34px);
  color: #fff;
}
.band-line {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(20px, 3.4vw, 30px);
  margin: 0;
  text-shadow: 0 2px 12px rgba(28, 16, 52, 0.5);
}
.band-word {
  display: inline-block;
  font-family: var(--novelty);
  font-weight: 400;
  font-size: clamp(34px, 7vw, 66px);
  text-transform: uppercase;
  line-height: 1;
  margin-left: 6px;
  vertical-align: -0.12em;
  color: #fff;
  -webkit-text-stroke: 0;
}
.band-blurb {
  margin: 8px 0 0;
  max-width: 44ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  text-shadow: 0 1px 8px rgba(28, 16, 52, 0.6);
}

/* The drum roll: the word lands a beat after the band scrolls into view.
   The word is visible by default and the animation starts it from nothing —
   so if the observer never fires (or the browser has no IntersectionObserver)
   the headline simply appears instead of staying invisible forever. */
.band.in .band-word {
  animation: land 620ms cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
@keyframes land {
  0%, 22% { opacity: 0; transform: translateY(14px) scale(0.82) rotate(-4deg); }
  70% { opacity: 1; transform: translateY(0) scale(1.08) rotate(1.5deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .band.in .band-word { animation: none; }
}

@media (max-width: 720px) {
  .band { min-height: 260px; }
  .chapter + .chapter { margin-top: 48px; }
}

/* Open wishes: no price, no bar, just "I'm bringing this". Slimmer than a
   present card so the two read as different kinds of thing. */
.card.wish .card-media { aspect-ratio: 5 / 2; }
.card.wish .card-media .placeholder {
  width: 60px;
  height: 60px;
  font-size: 28px;
}
.card.wish .card-body { gap: 10px; }
.card.wish .note { margin-bottom: 2px; }
.card.wish .row:first-of-type { margin-top: auto; }
