:root {
  --sky-top: #c6e4f9;
  --sky-mid: #e3f2fd;
  --sky-bottom: #f1f8fe;
  --blue-50: #f3f9fe;
  --blue-100: #e1f0fb;
  --blue-200: #c2e1f5;
  --blue-300: #93c6e8;
  --blue-400: #6aaedb;
  --blue-500: #4592c6;
  --blue-600: #2f78ab;
  --navy: #1f3a56;
  --muted: #4f6b87;
  --silver: #dfe7ef;
  --cream: #fffaf3;
  --white: #ffffff;
  --star: #ffd77a;
  --cheek: #ffc9d4;
  --danger: #b4435a;

  --glass-bg: rgba(255, 255, 255, 0.30);
  --glass-bg-strong: rgba(255, 255, 255, 0.50);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-blur: 18px;
  --glass-outline: linear-gradient(135deg, #5b9fd6 0%, #e9eff5 18%, #a9c4dc 32%, #3f8ccc 50%, #f2f6fa 66%, #9db7cf 80%, #4f95cf 100%);

  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-lg: 32px;
  --radius-md: 24px;
  --shadow-card: 0 18px 44px rgba(31, 58, 86, 0.14);
  --shadow-soft: 0 8px 26px rgba(31, 58, 86, 0.09);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--navy);
  background-color: var(--sky-bottom);
  background-image: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 520px, var(--sky-bottom) 1100px);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--blue-600); }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

.page { flex: 1; position: relative; z-index: 1; }

/* ---------- Sky: glows, planes, clouds, stars ---------- */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Soft colour behind the glass so it has something to bend. Static, so cheap. */
.glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; }
.glow-1 { width: 46vmax; height: 46vmax; top: -12vmax; left: -14vmax; background: #a8d3f2; }
.glow-2 { width: 38vmax; height: 38vmax; top: 34%; right: -16vmax; background: #c9d9ea; }
.glow-3 { width: 42vmax; height: 42vmax; bottom: -18vmax; left: 18%; background: #b5dcf5; }

.cloud {
  position: absolute;
  overflow: visible;
  opacity: 0.9;
  animation: breeze 40s ease-in-out infinite alternate;
  will-change: transform;
}
/* Each cloud's own soft sway on top of the slow drift. */
.cloud-puff {
  transform-box: fill-box;
  transform-origin: 50% 80%;
  animation: sway 6s ease-in-out infinite;
}
.cloud-shadow { fill: #a9cde8; opacity: 0.22; }
.cloud-shine { fill: #ffffff; opacity: 0.85; }
.cloud-1 { width: 220px; top: 6%;  left: -4%; animation-duration: 42s; }
.cloud-2 { width: 150px; top: 18%; left: 72%; opacity: 0.75; animation-duration: 32s; animation-delay: -20s; }
.cloud-3 { width: 260px; top: 46%; left: 84%; opacity: 0.6;  animation-duration: 50s; animation-delay: -35s; }
.cloud-4 { width: 120px; top: 62%; left: 4%;  opacity: 0.7;  animation-duration: 30s; animation-delay: -10s; }
.cloud-5 { width: 180px; top: 80%; left: 50%; opacity: 0.55; animation-duration: 46s; animation-delay: -50s; }
.cloud-6 { width: 100px; top: 30%; left: 30%; opacity: 0.5;  animation-duration: 27s; animation-delay: -5s; }
.cloud-2 .cloud-puff { animation-duration: 5s; animation-delay: -2s; }
.cloud-3 .cloud-puff { animation-duration: 7.5s; animation-delay: -5s; }
.cloud-4 .cloud-puff { animation-duration: 5.5s; animation-delay: -1s; }
.cloud-5 .cloud-puff { animation-duration: 6.5s; animation-delay: -7s; }
.cloud-6 .cloud-puff { animation-duration: 4.5s; animation-delay: -3s; }

.star { position: absolute; width: 18px; fill: var(--star); animation: twinkle 3.6s ease-in-out infinite; }
.star-1 { top: 9%;  left: 18%; }
.star-2 { top: 14%; left: 86%; width: 14px; animation-delay: -1s; }
.star-3 { top: 34%; left: 7%;  width: 12px; animation-delay: -2s; }
.star-4 { top: 40%; left: 93%; animation-delay: -0.5s; }
.star-5 { top: 58%; left: 22%; width: 10px; animation-delay: -2.6s; }
.star-6 { top: 70%; left: 78%; width: 15px; animation-delay: -1.6s; }
.star-7 { top: 86%; left: 12%; width: 13px; animation-delay: -3s; }
.star-8 { top: 24%; left: 58%; width: 11px; animation-delay: -0.2s; }

@keyframes breeze {
  0%   { transform: translate(0, 0); }
  30%  { transform: translate(38px, -6px); }
  60%  { transform: translate(70px, 3px); }
  100% { transform: translate(110px, -2px); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85) rotate(0deg); }
  50%      { opacity: 1;    transform: scale(1.1) rotate(12deg); }
}

/* Planes fly right across the sky; one goes the other way. */
.plane {
  position: absolute;
  left: 0;
  will-change: transform;
  animation: fly 34s linear infinite;
}
.plane svg { display: block; width: 100%; height: auto; overflow: visible; }
.plane-bob { animation: bob 3.2s ease-in-out infinite; will-change: transform; }
.plane-1 { top: 10%; width: 300px; animation-duration: 38s; animation-delay: -9s; }
.plane-2 { top: 44%; width: 104px; animation-duration: 75s; animation-delay: -30s; }
.plane-2 .plane-bob { animation-name: sway; animation-duration: 6s; }
.plane-3 { top: 32%; width: 96px;  animation-duration: 46s; animation-delay: -4s; opacity: 0.8; animation-name: fly-back; }
.plane-3 .plane-bob { animation-duration: 4s; }
.plane-3 svg { transform: scaleX(-1); }

.plane-defs { position: absolute; width: 0; height: 0; }
.pl-line-teal { stroke: #4b8099; stroke-width: 1.4; stroke-opacity: 0.55; }
.pl-line-wing { stroke: #9dbccb; stroke-width: 1.3; stroke-opacity: 0.7; }
.pl-fur-line { stroke: #a8733f; stroke-width: 1.2; stroke-opacity: 0.35; }
.pl-shine { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; opacity: 0.45; }
.pl-rim { fill: none; stroke: #4b8099; stroke-width: 3; stroke-linecap: round; opacity: 0.7; }
.pl-panel-teal { fill: none; stroke: #4b8099; stroke-width: 1.2; opacity: 0.55; }
.pl-rivet { fill: #4b8099; opacity: 0.6; }
.pl-star { fill: #f2c46d; stroke: #d9a548; stroke-width: 0.8; }
.pl-glass { fill: rgba(255, 255, 255, 0.55); stroke: #b8c8d2; stroke-width: 1.4; }
.pl-cowl-teal { fill: #5d93aa; stroke: #4b8099; stroke-width: 1; }
.pl-spinner-silver { fill: #dfe5ea; stroke: #9aa6b0; stroke-width: 1; }
.pl-prop {
  fill: #6b5244;
  opacity: 0.8;
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 0.18s linear infinite;
}
.pl-ear-in { fill: #edc49a; }
.pl-muzzle { fill: #f4e0c6; }
.pl-nose { fill: #4a3328; }
.pl-eye { fill: #3a2a22; }
.pl-smile { fill: none; stroke: #4a3328; stroke-width: 1.6; stroke-linecap: round; }
.pl-blush { fill: #f2a7a7; opacity: 0.45; }
.pl-arm { fill: none; stroke: #c99262; stroke-width: 9; stroke-linecap: round; }
.pl-wave { transform-box: fill-box; transform-origin: 0% 100%; animation: wave 1.6s ease-in-out infinite; }
.pl-band { fill: #5d93aa; }
.pl-balloon-shine { fill: #fff; opacity: 0.3; }
.pl-throat { fill: #4b8099; }
.pl-ropes { fill: none; stroke: #8a7a6a; stroke-width: 1.1; opacity: 0.75; }
.pl-basket { fill: #c9965f; stroke: #9c6a3a; stroke-width: 1.2; }
.pl-weave { fill: none; stroke: #9c6a3a; stroke-width: 1; opacity: 0.55; }
.pl-basket-rim { fill: #a8743f; }
.pl-sandbag { fill: #ecdcc2; stroke: #c9b79f; stroke-width: 1; }
.pl-arm-sm { stroke-width: 7; }
.pl-smile-sm { stroke-width: 1.3; }
.pl-puff { fill: var(--white); opacity: 0.85; }
.pl-rope { fill: none; stroke: #8a7a6a; stroke-width: 1.3; opacity: 0.8; }
.pl-bridle { fill: none; stroke: #8a7a6a; stroke-width: 1; opacity: 0.75; }
.pl-hook { fill: #6f8a9c; }
.pl-pole { stroke: #a8845f; stroke-width: 2.4; stroke-linecap: round; }
.pl-banner-text { transform-box: fill-box; transform-origin: center; animation: banner-text 1.5s ease-in-out infinite; }
@keyframes banner-text {
  0%, 100% { transform: translateY(0) skewY(0deg); }
  50%      { transform: translateY(0.6px) skewY(-1.5deg); }
}

/* Clouds stay behind the planes and the balloon. */
.cloud, .star { z-index: 0; }
.plane { z-index: 1; }

/* The hot air balloon drifts slowly across, just below the main card (on the
   code page and the gift list), looping like the planes. Only the sides are
   clipped, so the balloon is never cut off above or below. */
.hero-card, .gate .peek-card { z-index: 1; }
.gate { position: relative; padding-bottom: 145px; }
.balloon-lane {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: 140px;
  margin-left: -50vw;
  z-index: 0;
  overflow-x: clip;
  pointer-events: none;
}
.balloon-lane .plane-2 {
  top: auto;
  bottom: 4px;
  left: 0;
  width: 86px;
  animation: fly 75s linear -19s infinite;
}
.balloon-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.balloon-btn:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 4px; border-radius: 40%; }
.plane-balloon .pl-wave { animation: none; }
.pl-teddy { transform-box: view-box; }
.pl-heart { fill: var(--blue-600); stroke: #ffffff; stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; }
.is-cheering .pl-teddy { animation: teddy-jump 0.55s cubic-bezier(.34, 1.56, .64, 1) 2; }
.is-cheering .pl-wave { animation: wave 0.32s ease-in-out 6; }
.is-cheering .pl-heart { animation: heart-float 1.4s ease-out forwards; }
.is-cheering .pl-heart-2 { animation-delay: 0.15s; }
.is-cheering .pl-heart-3 { animation-delay: 0.3s; }
@keyframes teddy-jump {
  0%, 100% { transform: translateY(0); }
  45%      { transform: translateY(-11px); }
}
@keyframes heart-float {
  0%   { opacity: 0; transform: translateY(4px) scale(0.6); }
  25%  { opacity: 1; transform: translateY(-4px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-26px) scale(0.9); }
}
.pl-banner { fill: #fffdf8; stroke: #c9b79f; stroke-width: 1.3; }
.pl-banner-text { font-family: var(--font-display); font-weight: 600; font-size: 14px; fill: var(--blue-600); }

@keyframes wave {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(14deg); }
}

@keyframes fly {
  from { transform: translateX(-320px); }
  to   { transform: translateX(calc(100vw + 40px)); }
}
@keyframes fly-back {
  from { transform: translateX(calc(100vw + 40px)); }
  to   { transform: translateX(-320px); }
}
@keyframes bob {
  0%, 100% { transform: translateY(-7px) rotate(-2.5deg); }
  50%      { transform: translateY(7px) rotate(2deg); }
}
@keyframes sway {
  0%, 100% { transform: translateY(-10px) rotate(-3deg); }
  50%      { transform: translateY(10px) rotate(3deg); }
}
@keyframes spin {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(0.15); }
}

/* ---------- Liquid glass ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.12) 40%, rgba(255, 255, 255, 0.28) 100%),
    var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  border: 1px solid var(--glass-edge);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -10px 24px rgba(255, 255, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
/* Shiny highlight along the top edge. */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(120% 60% at 20% 0%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}
/* Blue and silver outline, shown on hover (or when centred on a phone). */
.glass::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 2.5px;
  background: var(--glass-outline);
  background-size: 220% 220%;
  background-position: 0% 50%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.35s ease, background-position 1.2s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .glass:hover::after { opacity: 1; background-position: 100% 50%; }
  .glass:hover {
    box-shadow:
      var(--shadow-card),
      0 0 0 4px rgba(147, 198, 232, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      inset 0 -10px 24px rgba(255, 255, 255, 0.3);
  }
}
.glass.is-centred::after { opacity: 1; background-position: 100% 50%; }
.glass.is-centred { box-shadow: var(--shadow-card), 0 0 0 4px rgba(147, 198, 232, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.95); }

/* ---------- Peeking bear card ---------- */
.peek-card {
  max-width: 680px;
  margin: 150px auto 0;
  padding: 40px 40px 36px;
  border-radius: var(--radius-lg);
  text-align: center;
}
.peek-card.glass { --glass-bg: var(--glass-bg-strong); }
.bear {
  position: absolute;
  left: 50%;
  top: -122px;
  z-index: 2;
  width: 210px;
  transform: translateX(-50%);
  overflow: visible;
}
.bear .fur { fill: var(--blue-300); }
.bear .fur-inner { fill: var(--blue-100); }
.bear .snout { fill: var(--cream); }
.bear .eye, .bear .nose { fill: var(--navy); }
.bear .glint { fill: var(--white); }
.bear .cheek { fill: var(--cheek); opacity: 0.75; }
.bear .mouth { fill: none; stroke: var(--navy); stroke-width: 4; stroke-linecap: round; }
.bear .toe { stroke: var(--blue-500); stroke-width: 3; stroke-linecap: round; opacity: 0.5; }
.bear-head { animation: peek 1.1s cubic-bezier(.34,1.56,.64,1) both; }
.eyes { transform-origin: 110px 84px; animation: blink 5s infinite; }

@keyframes peek {
  from { transform: translateY(70px); }
  to   { transform: translateY(0); }
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(0.1); }
}

.eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-500);
}
.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.08;
  color: var(--navy);
}
.subtitle {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(18px, 3vw, 22px);
  color: var(--blue-600);
}
.due {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(225, 240, 251, 0.8);
  font-weight: 700;
}
.due span {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-600);
}
.message {
  max-width: 540px;
  margin: 18px auto 0;
  color: var(--muted);
}

/* ---------- Progress ---------- */
.progress { max-width: 420px; margin: 26px auto 0; }
.progress-label {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-500);
}
.progress-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(194, 225, 245, 0.55);
  box-shadow: inset 0 1px 2px rgba(31, 58, 86, 0.08);
  overflow: hidden;
}
.progress-bar span {
  display: block;
  min-width: 14px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-300), var(--blue-500));
  transition: width 0.6s ease;
}
.progress-text { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.progress-text strong { color: var(--navy); font-size: 17px; }

/* ---------- Hero + wave ---------- */
.hero { position: relative; display: flow-root; padding: 0 16px 90px; }

/* ---------- "See the gift list" cue under the header card ---------- */
.scroll-cue {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: max-content;
  margin: 26px auto -40px;
  text-decoration: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.scroll-cue.is-gone { opacity: 0; transform: translateY(10px); pointer-events: none; }
.cue-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: linear-gradient(180deg, #58a2d4 0%, var(--blue-500) 100%);
  box-shadow: 0 4px 0 var(--blue-600), 0 10px 24px rgba(47, 120, 171, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--white);
  transition: transform 0.15s ease;
}
.scroll-cue:active .cue-pill { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-600); }
.scroll-cue:focus-visible { outline: none; }
.gifts:focus { outline: none; }
.scroll-cue:focus-visible .cue-pill { outline: 3px solid var(--blue-400); outline-offset: 3px; }
.cue-pill svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cue-arrow {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--blue-500);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: cue-bounce 1.8s ease-in-out infinite;
}
.cue-arrow-2 { opacity: 0.45; }
.cue-balloons { position: absolute; inset: -46px -64px auto; height: 80px; pointer-events: none; }
.cue-balloon { position: absolute; width: 24px; height: auto; animation: cue-float 4.5s ease-in-out infinite; }
.cue-balloon-1 { left: 4px;  top: 18px; animation-delay: -1.2s; }
.cue-balloon-2 { right: 10px; top: 4px; width: 28px; animation-delay: -2.6s; animation-duration: 5.2s; }
.cue-balloon-3 { right: -6px; top: 34px; width: 20px; animation-delay: -0.4s; animation-duration: 4s; }
.cue-balloon-1 .cue-skin { fill: var(--blue-300); }
.cue-balloon-2 .cue-skin { fill: var(--blue-500); }
.cue-balloon-3 .cue-skin { fill: #dfe9f2; stroke: var(--blue-200); stroke-width: 1; }
.cue-balloon-1 .cue-knot { fill: var(--blue-400); }
.cue-balloon-2 .cue-knot { fill: var(--blue-600); }
.cue-balloon-3 .cue-knot { fill: var(--blue-200); }
.cue-shine { fill: #fff; opacity: 0.45; }
.cue-string { fill: none; stroke: #8fa9bf; stroke-width: 1; }

@keyframes cue-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}
@keyframes cue-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-9px) rotate(5deg); }
}
.wave {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 70px;
  fill: rgba(255, 255, 255, 0.22);
}

.lock-form { position: absolute; top: 16px; right: 16px; z-index: 3; margin: 0; }
.lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.lock-btn:hover { background: rgba(255, 255, 255, 0.85); }
.lock-btn:active { transform: scale(0.96); }
.lock-btn:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 3px; }
.lock-btn svg { width: 16px; height: 16px; fill: none; stroke: var(--blue-500); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- List / Carousel switch ---------- */
.view-toggle {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.view-toggle button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s ease;
}
.view-toggle button[aria-pressed="true"] { color: var(--white); }
.view-toggle button:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; }
.view-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.view-toggle svg circle { fill: currentColor; stroke: none; }
.view-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(180deg, #58a2d4 0%, var(--blue-500) 100%);
  box-shadow: 0 2px 6px rgba(47, 120, 171, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.35s cubic-bezier(.34, 1.3, .64, 1);
}
.view-toggle[data-mode="carousel"] .view-thumb { transform: translateX(100%); }

/* ---------- Gift grid ---------- */
.gifts {
  position: relative;
  padding: 20px 16px 64px;
  background-color: rgba(255, 255, 255, 0.22);
  background-image: radial-gradient(rgba(147, 198, 232, 0.45) 1.5px, transparent 1.6px);
  background-size: 26px 26px;
}
.grid {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 26px;
}

.gift {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease;
}
.gift > * { position: relative; }
@media (hover: hover) and (pointer: fine) {
  .gift:not(.is-purchased):hover { transform: translateY(-4px); }
}

.gift-pic {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  margin: 10px 10px 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(31, 58, 86, 0.05);
  overflow: hidden;
}
.gift-pic { min-width: 0; }
.gift-pic img {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}
.gift-placeholder { width: 38%; fill: var(--blue-200); }
.gift-placeholder .ribbon { fill: var(--blue-400); }

.gift-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 20px;
}
.gift-shop {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-500);
}
.gift-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.2;
}
.gift-desc { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.gift-price {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--blue-600);
}

.gift-others { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.other-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(225, 240, 251, 0.7);
  font-size: 14px;
  color: var(--navy);
  text-decoration: none;
  transition: background-color 0.2s ease, opacity 0.6s ease;
}
.other-link:hover { background: rgba(194, 225, 245, 0.85); }
.other-link:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; }
.other-price { margin-left: auto; font-family: var(--font-display); font-weight: 600; color: var(--blue-600); }
.is-purchased .other-link { opacity: 0.4; pointer-events: none; }

.gift-actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.gift-actions .btn, .act { flex: 1 1 auto; }
.act { display: flex; margin: 0; }
.act .btn { width: 100%; }

.confirm {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(225, 240, 251, 0.85);
}
.confirm p { flex-basis: 100%; margin: 0; font-weight: 700; }
.confirm .btn { flex: 1 1 auto; }

.bought-note {
  display: none;
  flex-basis: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(225, 240, 251, 0.85);
  font-weight: 700;
  color: var(--blue-600);
}
.bought-note .act { flex: 0 0 auto; }
.gift-error { flex-basis: 100%; margin: 0; font-size: 14px; font-weight: 700; color: var(--danger); }

/* ---------- Carousel ---------- */
.gifts.is-carousel { padding-left: 0; padding-right: 0; }
.grid.is-carousel {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 18px;
  max-width: none;
  padding: 10px 0 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.grid.is-carousel::-webkit-scrollbar { display: none; }
.grid.is-carousel .gift {
  flex: 0 0 min(82vw, 340px);
  /* Without these, Safari sizes each card to its (1500px) photo, so cards
     grew as each photo loaded. */
  width: min(82vw, 340px);
  min-width: 0;
  max-width: min(82vw, 340px);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.grid.is-carousel .gift:hover { transform: none; }
.grid.is-carousel .glass.is-centred:not(.is-active)::after { opacity: 0; }
.grid.is-carousel .gift.is-active::after { opacity: 1; background-position: 100% 50%; }
.grid.is-carousel .gift.is-purchased.is-active::after { opacity: 0; }

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
}
.carousel-count { margin: 0; min-width: 72px; text-align: center; font-weight: 700; color: var(--muted); }
.carousel-count strong { font-family: var(--font-display); font-size: 19px; color: var(--navy); }
.nav-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--blue-600);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.nav-btn:hover { background: var(--white); }
.nav-btn:active { transform: scale(0.92); }
.nav-btn:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 3px; }
.nav-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Purchased state ---------- */
.gift-pic img, .gift-placeholder, .gift-shop, .gift-name, .gift-desc, .gift-price, [data-view] {
  transition: opacity 0.6s ease, filter 0.6s ease;
}
.gift.is-purchased { --glass-bg: rgba(255, 255, 255, 0.22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.gift.is-purchased::after { opacity: 0 !important; }
.is-purchased .gift-pic img,
.is-purchased .gift-placeholder { opacity: 0.35; filter: grayscale(1); }
.is-purchased .gift-shop,
.is-purchased .gift-name,
.is-purchased .gift-desc,
.is-purchased .gift-price { opacity: 0.45; }
.is-purchased [data-view] { opacity: 0.4; pointer-events: none; cursor: default; }
.is-purchased .act-buy, .is-purchased .confirm { display: none !important; }
.is-purchased .bought-note { display: flex; }

.gift-pic { position: relative; }
.stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 6px 16px;
  border: 3px solid var(--blue-600);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-600);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-12deg) scale(1.6);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.34,1.56,.64,1);
}
.is-purchased .stamp { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.15s ease;
}
.btn:focus-visible, .link-btn:focus-visible, .gate-input:focus-visible {
  outline: 3px solid var(--blue-400);
  outline-offset: 3px;
}
.btn-primary {
  background: linear-gradient(180deg, #58a2d4 0%, var(--blue-500) 100%);
  color: var(--white);
  box-shadow: 0 4px 0 var(--blue-600), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { background: var(--blue-600); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-600); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--blue-200);
  color: var(--navy);
}
.btn-ghost:hover { border-color: var(--blue-400); background: var(--white); }
.btn-ghost:active { transform: scale(0.97); }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.btn-wide { width: 100%; }

.link-btn {
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  color: var(--blue-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Gate ---------- */
.is-gate .page { display: grid; place-items: center; padding: 0 16px; }
.gate { width: 100%; }
.gate .peek-card { max-width: 460px; margin-top: 140px; }
.gate-form { margin-top: 28px; text-align: left; }
.gate-label { display: block; margin-bottom: 8px; font-weight: 700; text-align: center; }
.gate-input {
  width: 100%;
  min-height: 56px;
  margin-bottom: 14px;
  padding: 12px 18px;
  border: 2px solid var(--blue-200);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-family: var(--font-display);
  font-size: 22px; /* 16px+ stops iPhones zooming in on focus */
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  color: var(--navy);
}
.gate-input-name { font-size: 20px; letter-spacing: 0.02em; text-transform: none; }
.gate-input::placeholder { letter-spacing: 0.04em; text-transform: none; color: var(--blue-300); }
.gate-input[aria-invalid="true"] { border-color: var(--danger); }
.gate-error { margin: -4px 0 14px; text-align: center; font-weight: 700; color: var(--danger); }

/* ---------- Empty + footer ---------- */
.empty {
  max-width: 480px;
  margin: 0 auto;
  padding: 36px 24px;
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--muted);
}
.footer {
  position: relative;
  z-index: 1;
  padding: 22px 16px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.22);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.is-gate .footer { background: transparent; }

/* ---------- Phones ---------- */
@media (max-width: 560px) {
  :root { --glass-blur: 14px; }
  body { font-size: 16px; }
  .peek-card { padding: 32px 20px 28px; margin-top: 132px; border-radius: 26px; }
  .bear { width: 180px; top: -105px; }
  .hero { padding-bottom: 70px; }
  .wave { height: 44px; }
  .grid { gap: 18px; }
  /* Compact cards on phones: about two per screen. */
  .gift-pic { aspect-ratio: auto; height: 170px; margin: 8px 8px 0; border-radius: 16px; }
  .gift-pic img { height: 170px; padding: 8px; }
  .gift-placeholder { width: 30%; }
  .stamp { font-size: 19px; }
  .gift-body { padding: 12px 16px 16px; }
  .gift-name { font-size: 19px; }
  .gift-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    margin-top: 6px;
    font-size: 14.5px;
  }
  .gift-price { margin-top: 6px; font-size: 18px; }
  .gift-others { margin-top: 8px; }
  .gift-actions { padding-top: 12px; gap: 8px; }
  .lock-form { top: 12px; right: 12px; }
  .view-toggle { top: 12px; left: 12px; padding: 3px; }
  .view-toggle button { width: 42px; min-height: 36px; padding: 0; }
  .view-thumb { top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); }
  .view-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .lock-btn { min-height: 40px; padding: 6px 14px; font-size: 14px; }
  .plane-1 { width: 220px; }
  /* Below the card on phones, where people can actually see it. */
  .plane-2 { top: auto; bottom: 7%; width: 80px; }
  .gate { padding-bottom: 130px; }
  .balloon-lane { height: 124px; }
  .balloon-lane .plane-2 { width: 64px; bottom: 6px; animation-duration: 60s; animation-delay: -27s; }
  .plane-3 { display: none; }
  .cloud-3, .cloud-6 { display: none; }
  .glow { filter: blur(40px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .plane { display: none; }
}
