/* =====================================================================
   GIFTIE BADGE MAKER — LAYOUT & COMPONENTS
   (Colours/fonts/textures live in theme.css)
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body, "Hello Headline", system-ui, sans-serif);
  color: var(--c-ink);
  background: var(--c-white);
  min-height: 100vh;
  /* room for mobile bottom nav */
  padding-bottom: 0;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 48px); }
.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; }
/* file input: hidden but still focusable/clickable on iOS (don't use display:none) */
.visually-hidden { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; clip:rect(0 0 0 0); }

/* ---- LOGO IMAGES (swap the SVGs in /assets/img) --------------------- */
.logo-giftie    { height: clamp(50px, 6.2vw, 76px); width: auto; }
.logo-badgemaker{ height: clamp(50px, 7.4vw, 90px); width: auto; flex: 0 0 auto; }

/* ---- BUBBLE TYPE (Super Comic headings) ----------------------------- */
.comic { font-family: "Super Comic", cursive; line-height: .95; letter-spacing: .5px; }
/* pink bubble logo lettering with white outline */
.bubble-pink {
  font-family: "Super Comic", cursive;
  color: var(--c-pink);
  -webkit-text-stroke: 6px var(--c-white);
  paint-order: stroke fill;
  text-shadow:
    0 6px 0 rgba(176,22,108,.35),
    0 0 2px var(--c-white);
  line-height: .9;
}

/* page titles: layered so pink fill -> white inner -> purple outer all show */
.title3d {
  display: inline-grid;
  font-family: var(--font-head);
  font-weight: 400;
  line-height: .98; margin: 0;
  --tw-out: 16px; --tw-in: 9px;          /* outer / inner stroke widths */
  filter: drop-shadow(0 6px 6px rgba(74,31,102,.28));
}
.title3d > span { grid-area: 1 / 1; }                 /* stack all layers */
.title3d .t-out {                                      /* outer purple */
  color: var(--title-outer);
  -webkit-text-stroke: var(--tw-out) var(--title-outer);
  paint-order: stroke fill;
}
.title3d .t-mid {                                      /* inner white */
  color: var(--title-inner);
  -webkit-text-stroke: var(--tw-in) var(--title-inner);
  paint-order: stroke fill;
}
.title3d .t-top { color: var(--title-fill); }          /* pink fill on top */

/* =====================================================================
   HEADER  (shared)
   ===================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: stretch;
  background: var(--c-blue);          /* blue so the skewed brand box never reveals yellow */
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.brand-box {
  flex: 0 0 auto;
  background: var(--c-blue);
  display: flex; align-items: center; justify-content: center;
  padding: 14px clamp(16px, 2.2vw, 30px) 14px 90px;
  margin-left: -44px;                 /* bleed the left side off the screen edge */
  transform: skewX(-7deg);
  margin-right: -14px;
}
.brand-box > * { transform: skewX(7deg); }
.brand-giftie {
  font-family: "Super Comic", cursive;
  color: var(--c-white);
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  text-shadow: 0 3px 0 rgba(0,0,0,.35);
  display: inline-flex; align-items: center; gap: .25em;
}
.brand-giftie .gift { color: var(--c-pink); }

.header-band {
  flex: 1;
  background-image: var(--tex-header);
  background-size: cover;
  background-position: center;
  background-color: var(--c-yellow);
  display: flex; align-items: center; gap: clamp(10px, 2vw, 28px);
  padding: 12px clamp(14px, 2.5vw, 32px) 12px 26px;
}
.brand-badgemaker {
  font-family: "Super Comic", cursive;
  font-size: clamp(1.1rem, 2.2vw, 2rem);
  line-height: .82;
  text-align: center;
  color: var(--c-pink);
  -webkit-text-stroke: 4px var(--c-white);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(176,22,108,.4);
  flex: 0 0 auto;
}

/* primary nav (desktop) */
.main-nav { display: flex; gap: clamp(8px, 1.4vw, 18px); margin-left: auto; }
.nav-pill {
  font-family: var(--font-play);
  font-size: clamp(1.05rem, 1.75vw, 1.75rem);
  color: var(--c-purple);
  background: var(--c-white);
  border-radius: var(--radius-pill);
  padding: .5em 1.6em;
  box-shadow: 0 4px 0 rgba(0,0,0,.12);
  transition: transform .12s ease, color .12s ease;
  white-space: nowrap;
}
.nav-pill:hover { transform: translateY(-2px); }
.nav-pill[aria-current="page"] { color: var(--c-pink); }

/* socials */
.socials { display: flex; gap: clamp(7px,0.8vw,11px); align-items: center; margin-left: clamp(8px,1.5vw,20px); }
.social {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-white);
  border: 3px solid var(--c-pink);
  color: var(--c-pink);
  transition: transform .12s ease;
}
.social:hover { transform: scale(1.08); }
.social svg { width: 22px; height: 22px; }

/* =====================================================================
   PAGE SHELL
   ===================================================================== */
main { display: block; }
.page { min-height: 60vh; }

/* decorative bottom wave strip (mobile content pages) */
.foot-strip { display: none; }

/* =====================================================================
   HOME PAGE
   ===================================================================== */
.hero {
  background: var(--c-white) var(--hero-bg) top center / 100% 100% no-repeat;
  position: relative; overflow: hidden;
  padding: clamp(20px, 3vw, 40px) 0 0;
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  width: 100%; gap: clamp(12px,2vw,32px);
}
/* left column: padded so the video never touches the screen edge,
   and its left edge lines up with the rest of the site's content   */
.hero-left {
  --pad: clamp(16px, 4vw, 48px);
  padding: clamp(22px,3vw,42px) clamp(14px,2vw,28px) clamp(22px,3vw,42px)
           max(var(--pad), calc((100vw - var(--maxw)) / 2 + var(--pad)));
}
/* right column: product anchored to the right, bleeding off the screen edge */
.hero-right { display: flex; align-items: center; justify-content: flex-end; }
.video-card { width: 100%; }
.hero-media {
  position: relative;                     /* anchor for the play overlay */
  border: 7px solid var(--c-pink);
  border-radius: 22px;                    /* fully rounded now the tabs are gone */
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 11;
  box-shadow: var(--shadow-soft);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-video { width: 100%; height: 100%; display: block; object-fit: cover; background: #000; }

/* large play button over the start frame */
.video-play {
  position: absolute; inset: 0; margin: auto; z-index: 3;
  width: clamp(74px, 12vw, 104px); height: clamp(74px, 12vw, 104px);
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: var(--c-pink);
  border: 5px solid #fff; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: video-play-pulse 2.4s ease-in-out infinite;
  transition: transform .15s ease, background .15s ease;
}
.video-play svg { width: 46%; height: 46%; margin-left: 8%; }  /* optically centre the triangle */
.video-play:hover { transform: scale(1.07); background: var(--c-pink-hot); }
.video-play.is-hidden { display: none; }
@keyframes video-play-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 0 rgba(237,28,142,.5); }
  50%      { box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 16px rgba(237,28,142,0); }
}

.hero-copy { margin-top: clamp(18px, 2.5vw, 30px); text-align: center; }
.hero-copy-lead {
  font-family: var(--font-head); font-weight: 700;
  color: var(--c-pink);
  -webkit-text-stroke: 3px var(--c-white); paint-order: stroke fill;
  font-size: clamp(1.25rem, 2.1vw, 1.9rem); line-height: 1.2;
  margin: 0 0 .55em;
}
.hero-copy-body {
  font-family: var(--font-body);
  color: var(--c-purple);
  -webkit-text-stroke: 1.4px var(--c-white); paint-order: stroke fill;
  font-size: clamp(1rem, 1.35vw, 1.18rem); line-height: 1.5;
  margin: 0 auto; max-width: 56ch;
}

.hero-pic { display: contents; }       /* let the <img> be the flex item */
/* product fills the right column and bleeds off the right screen edge */
.hero-product {
  width: min(56vw, 860px); height: auto; max-width: none;
  margin-right: -3vw;                 /* cut off the right edge */
}

/* =====================================================================
   CREATE PAGE
   ===================================================================== */
.create {
  background: var(--c-white) var(--tex-scatter) bottom center / contain no-repeat;
  padding: clamp(20px,4vw,56px) 0;
}
.create-grid {
  display: grid; grid-template-columns: minmax(260px, .8fr) 1.4fr;
  gap: clamp(20px,3vw,48px); align-items: stretch;
}
/* left column: heading + steps spread evenly down the full column height */
.create-info { display: flex; flex-direction: column; justify-content: space-evenly; }
.create-head { display: flex; align-items: center; gap: 16px; margin-bottom: 0; }
.create-head .pencil {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--c-purple-btn); color: var(--c-white);
  display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: var(--shadow-soft);
}
.create-head .pencil svg { width: 36px; height: 36px; }
.create-head h1 { font-size: var(--fs-h1); margin: 0; }

/* steps become direct children of the column so they distribute evenly */
.steps { display: contents; }
.step { display: flex; align-items: center; gap: 0; position: relative; }
.step .num {
  width: 58px; height: 58px; flex: 0 0 auto; z-index: 2;
  background: var(--c-purple-btn); color: var(--c-white);
  font-family: "Super Comic", cursive; font-size: 1.6rem;
  display: grid; place-items: center;
  /* heart shape */
  clip-path: path("M29 54 C10 38 0 28 0 17 C0 7 8 0 17 0 C23 0 27 3 29 8 C31 3 35 0 41 0 C50 0 58 7 58 17 C58 28 48 38 29 54 Z");
}
.step .label {
  background: var(--c-yellow);
  color: var(--c-purple-dark);
  font-family: "Super Comic", cursive;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  line-height: 1.05; text-transform: uppercase;
  padding: .7em 1.4em .7em 2.2em; margin-left: -22px;
  border-radius: var(--radius-pill); flex: 1;
  box-shadow: var(--shadow-pop);
}
.step:nth-child(2) { flex-direction: row-reverse; }
.step:nth-child(2) .label { padding: .7em 2.2em .7em 1.4em; margin-left: 0; margin-right: -22px; text-align: right; }

/* right column: editor panel */
.editor {
  background: var(--c-purple-deep);
  border-radius: var(--radius-panel);
  padding: clamp(20px,3vw,40px);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-soft);
  color: var(--c-white);
}
.editor::before { content: none; }
.editor-watermark {
  position: absolute; top: 22px; left: 26px; width: 120px; height: auto;
  opacity: .12; pointer-events: none; z-index: 0;
}
.drag-hint {
  position: absolute; top: 22px; right: 26px; text-align: center;
  font-family: "Super Comic", cursive; font-size: .8rem; color: var(--c-white);
  opacity: .9;
}
.drag-hint svg { width: 40px; height: 40px; margin: 0 auto 4px; display: block; }

/* circular crop stage */
.stage-wrap { display: grid; place-items: center; padding: 30px 0 8px; }
.stage {
  position: relative; width: min(58vw, 440px); aspect-ratio: 1;
  border-radius: 50%;
  border: 4px dashed rgba(255,255,255,.85);
  overflow: hidden;
  touch-action: none;
  background: rgba(0,0,0,.12);
  display: grid; place-items: center;
}
.stage.has-image { cursor: grab; }
.stage.dragging { cursor: grabbing; }
.stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; user-select: none;
}
.upload-cta {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: "Super Comic", cursive; font-size: clamp(1.3rem,3vw,2.4rem);
  color: var(--c-pink); background: var(--c-white);
  border-radius: var(--radius-pill); padding: .5em 1.4em;
  box-shadow: var(--shadow-soft); z-index: 3;
}
.upload-cta svg { width: 1.2em; height: 1.2em; }
.stage.has-image .upload-cta { display: none; }

/* controls row */
.controls {
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end;
  margin-top: 18px;
}
.resize label {
  display: flex; align-items: center; gap: 8px;
  font-family: "Super Comic", cursive; font-size: clamp(1.1rem,2vw,1.6rem);
  margin-bottom: 8px;
}
.resize input[type="range"] {
  -webkit-appearance: none; appearance: none; width: min(46vw,340px);
  height: 16px; border-radius: 999px; background: var(--c-white);
}
.resize input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 30px; border-radius: 8px;
  background: var(--c-pink-hot); border: 3px solid var(--c-white); cursor: pointer;
}
.resize input[type="range"]::-moz-range-thumb {
  width: 26px; height: 30px; border-radius: 8px;
  background: var(--c-pink-hot); border: 3px solid var(--c-white); cursor: pointer;
}
.ready { text-align: center; }
.ready .label {
  font-family: "Super Comic", cursive; color: var(--c-pink-hot);
  font-size: clamp(1.1rem,2vw,1.6rem); display: block; margin-bottom: 6px;
}
.btn-download {
  width: clamp(78px, 11vw, 104px); height: auto; padding: 0;
  background: none; box-shadow: none; border-radius: 18px;
  position: relative; overflow: hidden;          /* clip the sheen to the button */
  transition: transform .12s ease;
}
.btn-download img { width: 100%; height: auto; display: block; }
.btn-download:hover { transform: translateY(-2px); }
.btn-download:disabled { filter: grayscale(.55) opacity(.55); cursor: not-allowed; transform: none; }
/* sheen sweep — only while the button is active, to entice a press */
.btn-download:not(:disabled)::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -75%; width: 55%;
  background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,.7) 50%, transparent 100%);
  transform: skewX(-20deg);
  animation: btn-sheen 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btn-sheen {
  0%   { left: -75%; }
  16%  { left: 130%; }   /* quick sweep... */
  100% { left: 130%; }   /* ...then rest until the next 4s cycle */
}

.editor-note {
  margin-top: 14px; font-size: .85rem; color: rgba(255,255,255,.7);
  text-align: center;
}

/* =====================================================================
   TEMPLATES PAGE
   ===================================================================== */
.templates {
  background: var(--c-template-pink);
  padding: clamp(24px,4vw,56px) 0 clamp(40px,6vw,90px);
  clip-path: polygon(0 28px, 50% 0, 100% 28px, 100% 100%, 0 100%);
  margin-top: 26px;
}
.tpl-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 18px 0 26px; }
.tpl-head .grid-ico {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--c-purple-btn); color: var(--c-white);
  display: grid; place-items: center; flex: 0 0 auto;
}
.tpl-head .grid-ico svg { width: 32px; height: 32px; }
.tpl-head h1 { font-size: var(--fs-h1); }

.tpl-filter { display: grid; place-items: center; margin-bottom: 34px; }
.select-wrap { position: relative; width: min(90vw, 460px); }
.select-wrap select {
  width: 100%; font-family: "Super Comic", cursive; font-size: 1.3rem;
  color: var(--c-purple-dark); background: var(--c-cream);
  border: 3px solid var(--c-purple-btn); border-radius: 16px;
  padding: .6em 3em .6em 1em; appearance: none; -webkit-appearance: none;
  text-transform: uppercase; box-shadow: var(--shadow-pop);
}
.select-wrap .chev {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 10px; background: var(--c-purple-btn);
  color: var(--c-white); display: grid; place-items: center; pointer-events: none;
}

.tpl-grid {
  display: grid;
  gap: clamp(44px, 4vw, 62px) clamp(18px, 2.5vw, 36px);  /* row gap clears the download button */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.tpl-card {
  background: var(--c-white); border-radius: 18px; padding: 14px;
  box-shadow: var(--shadow-soft); position: relative;
  display: flex; flex-direction: column;
}
.tpl-card .sheet { aspect-ratio: 210 / 297; border: 1px solid #d8d8d8; border-radius: 8px; overflow: hidden; background:#fff; }
.tpl-card .sheet img { width: 100%; height: 100%; object-fit: cover; }
.tpl-card .dl {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--c-purple-btn); color: var(--c-white);
  display: grid; place-items: center; box-shadow: var(--shadow-soft);
  border: 4px solid var(--c-white); transition: transform .12s ease;
}
.tpl-card .dl:hover { transform: translateX(-50%) translateY(-3px); }
.tpl-card .dl svg { width: 28px; height: 28px; }

/* =====================================================================
   FOOTER  (shared)
   ===================================================================== */
.metal-strip {
  height: 46px;
  background-image: var(--tex-divider),
    linear-gradient(180deg,
      #ffffff 0%, #efe2ef 5%,
      #7a3d8e 7%, #c4a7c7 9%, #8f3c96 15%, #5e2b80 26%, #2f1a48 33%, #0e101b 37%,
      #fafafa 41%, #dadada 45%, #444041 50%, #4a4748 57%,
      #c2bfbb 63%, #6a655f 67%, #fefefe 72%, #efeeec 78%,
      #cdc9c4 88%, #99948a 96%);
  background-size: 100% 100%, 100% 100%;
  background-repeat: no-repeat;
}
/* ---- Footer content (border/metal-strip above is unchanged) -------- */
.site-footer {
  font-family: var(--font-sans);          /* plain sans-serif, not the display face */
  background: var(--c-footer-blue); color: var(--c-footer-ink);
  padding: 0 0 clamp(30px,4vw,52px);
  margin-top: clamp(28px,5vw,64px);
}
.footer-inner { padding-top: clamp(30px,4vw,52px); text-align: center; }

.footer-blurb {
  max-width: 78ch; margin: 0 auto;
  font-size: clamp(.95rem, 1.1vw, 1.05rem); line-height: 1.65;
}
.footer-blurb a {
  color: var(--c-footer-ink); text-decoration: underline;
  text-underline-offset: 2px; word-break: break-word;
}
.footer-blurb a:hover { opacity: .75; }

.footer-policy { margin: clamp(18px,2.4vw,28px) auto 0; }
.footer-policy a {
  display: inline-block;
  color: var(--c-footer-ink); font-weight: 700; font-size: .95rem;
  text-decoration: underline; text-underline-offset: 3px;
}
.footer-policy a:hover { opacity: .75; }

/* trash / reset button above the RESIZE control */
.btn-reset {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff;
  border: 2px solid rgba(255,255,255,.6);
  margin-bottom: 12px;
  transition: transform .12s ease, background .12s ease;
}
.btn-reset[hidden] { display: none; }
.btn-reset:hover { background: var(--c-pink-hot); border-color: #fff; transform: translateY(-2px); }
.btn-reset svg { width: 22px; height: 22px; }

/* =====================================================================
   MOBILE BOTTOM NAV  (hidden on desktop)
   ===================================================================== */
.bottom-nav { display: none; }
.foot-strip { display: none; }

/* =====================================================================
   INSTALL APP (floating button + iOS instructions)
   ===================================================================== */
.install-fab {
  position: fixed; right: 16px; bottom: 100px; z-index: 300;
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  letter-spacing: 1px; text-transform: uppercase; color: #fff;
  background: var(--c-pink); border: 3px solid #fff; border-radius: 999px;
  padding: .8em 1.5em; box-shadow: 0 8px 24px rgba(0,0,0,.3); cursor: pointer;
  overflow: hidden;                       /* clip the sheen */
}
.install-fab::after {                      /* same enticing sheen as DOWNLOAD */
  content: ""; position: absolute; top: 0; bottom: 0; left: -75%; width: 55%;
  background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,.6) 50%, transparent 100%);
  transform: skewX(-20deg);
  animation: btn-sheen 4s ease-in-out infinite; pointer-events: none;
}
.install-fab:hover { transform: translateY(-2px); }

.ios-install-tip {
  position: fixed; left: 16px; right: 16px; bottom: 170px; z-index: 301;
  max-width: 380px; margin-inline: auto;
  background: var(--c-purple-btn); color: #fff;
  border: 2px solid #fff; border-radius: 18px; padding: 16px 18px 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,.34);
  font-family: var(--font-body);
}
.ios-tip-title {
  font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; margin: 0 0 12px; font-size: 1.05rem;
}
.ios-tip-x {
  position: absolute; top: 8px; right: 10px; color: #fff; font-weight: 700;
  font-size: 1rem; line-height: 1; padding: 4px;
}
.ios-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 11px; }
.ios-steps li { font-size: .98rem; line-height: 1.5; }
.ios-steps li::marker { font-weight: 700; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: -2px;
  background: #fff; color: #2A2433; border: 1px solid #d6d6dd; border-radius: 8px;
  padding: 1px 7px; font-weight: 700; font-size: .9em; white-space: nowrap;
}

/* =====================================================================
   BADGE CONFETTI (intro animation)
   ===================================================================== */
.confetti-layer {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -14vh;
  width: var(--sz); height: var(--sz);
  animation: confetti-fall var(--dur) cubic-bezier(.45,.06,.55,.95) var(--delay) forwards;
  will-change: transform;
}
.confetti-spin {                         /* in-plane rotation as it falls */
  position: relative; width: 100%; height: 100%;
  perspective: 520px;                    /* gives the flip real depth */
  animation: confetti-rotate var(--rot) linear var(--delay) infinite;
  will-change: transform;
}
.confetti-face {                          /* slow, heavy metal flip */
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: confetti-flip var(--flip) linear var(--delay) infinite;
  will-change: transform;
}
.confetti-face img {
  width: 100%; height: 100%; display: block; border-radius: 50%;
  backface-visibility: visible;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.28));
}
/* metallic glint (shine reduced ~50%) */
.confetti-gloss {
  position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(115deg,
    rgba(255,255,255,0) 36%, rgba(255,255,255,.42) 50%, rgba(255,255,255,0) 64%);
  mix-blend-mode: screen;
}
@keyframes confetti-fall {
  0%   { transform: translate3d(0, -14vh, 0); opacity: 0; }
  6%   { opacity: 1; }
  100% { transform: translate3d(var(--drift), 118vh, 0); opacity: 1; }
}
@keyframes confetti-rotate {              /* much less in-plane rotation */
  0%   { transform: rotateZ(0deg); }
  100% { transform: rotateZ(calc(var(--rdir) * 360deg)); }
}
@keyframes confetti-flip {                /* frequent heavy flips */
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(calc(var(--fdir) * 360deg)); }
}

/* =====================================================================
   CREATE — badge tray (up to 8 uploaded images)
   ===================================================================== */
.tray-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 18px 0 8px;
}
.tray-title {
  font-family: var(--font-play);
  color: var(--c-purple-deep); letter-spacing: .04em;
  font-size: 1rem;
}
.tray-count {
  font-family: var(--font-play);
  background: var(--c-purple-btn); color: var(--c-white);
  border-radius: 999px; padding: .2em .7em; font-size: .82rem;
}
.badge-tray {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
}
.tray-item { position: relative; aspect-ratio: 1; }
.tray-thumb {
  width: 100%; height: 100%; border-radius: 50%; cursor: pointer;
  background-size: cover; background-position: center;
  border: 3px solid var(--c-white);
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
  padding: 0; transition: transform .15s ease, border-color .15s ease;
}
.tray-thumb:hover { transform: translateY(-2px); }
.tray-item.is-active .tray-thumb {
  border-color: var(--c-pink);
  box-shadow: 0 0 0 3px rgba(237,28,142,.28), 0 2px 6px rgba(0,0,0,.22);
}
.tray-del {
  position: absolute; top: -4px; right: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--c-white); background: var(--c-purple-btn);
  color: var(--c-white); cursor: pointer;
  font-size: 14px; line-height: 1; display: grid; place-items: center;
  padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.tray-del:hover { background: var(--c-pink); }
/* "add another" tile */
.tray-add {
  aspect-ratio: 1; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; align-content: center; gap: 0;
  border: 3px dashed var(--c-purple-btn);
  color: var(--c-purple-btn); background: rgba(255,255,255,.65);
  font-family: var(--font-play); transition: background .15s ease;
}
.tray-add:hover { background: var(--c-white); }
.tray-add span { font-size: 1.35rem; line-height: 1; }
.tray-add em { font-style: normal; font-size: .6rem; letter-spacing: .06em; }

/* =====================================================================
   DATA / KID-SAFETY POLICY PAGE
   ===================================================================== */
.policy-page {
  background: var(--c-blue) var(--tex-scatter) center / 620px repeat;
  padding: clamp(24px,4vw,52px) 0 clamp(40px,6vw,80px);
}
.policy-title { text-align: center; margin: 0 0 clamp(20px,3vw,34px); }
.policy-card {
  background: var(--c-white); border-radius: 22px;
  box-shadow: var(--shadow-soft);
  max-width: 860px; margin: 0 auto;
  padding: clamp(22px,3.4vw,48px);
  font-family: var(--font-sans);
  color: var(--c-ink); line-height: 1.65;
}
.policy-card h2 {
  font-family: var(--font-head);
  color: var(--c-purple-deep);
  font-size: clamp(1.15rem,1.9vw,1.45rem);
  margin: 1.6em 0 .4em; letter-spacing: .01em;
}
.policy-card h2:first-of-type { margin-top: 0; }
.policy-card p, .policy-card li { font-size: clamp(.96rem,1.1vw,1.04rem); margin: 0 0 .9em; }
.policy-card ul { margin: 0 0 1em; padding-left: 1.3em; }
.policy-card li { margin-bottom: .5em; }
.policy-card a { color: var(--c-purple-btn); text-decoration: underline; word-break: break-word; }
.policy-card a:hover { color: var(--c-pink); }
.policy-back { margin-top: 2em; font-weight: 700; }
.policy-back a { text-decoration: none; }
.policy-back a:hover { text-decoration: underline; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  /* mobile sky bg: thin sky strip up top, white below — product sits high
     (no empty band above it) with the sky behind its upper area */
  .hero { background: var(--c-white) var(--hero-bg-mobile) top center / 100% auto no-repeat; }
  .hero-left { padding: clamp(16px,4vw,32px); }
  .hero-right { order: -1; justify-content: center; }
  .hero-product { width: min(88%, 480px); margin: 0 auto; }
  .create-grid { grid-template-columns: 1fr; }
  .create-info { display: block; }
  .create-info .steps { display: grid; gap: 16px; max-width: 460px; }
  .create-head { margin-bottom: 22px; }
  .editor { order: -1; }
}

/* ---- PHONE PORTRAIT: matches Mobile-layout.jpg --------------------- */
@media (max-width: 680px) {
  body { padding-bottom: var(--mobile-nav-h); }

  /* raise the install button so it clears the protruding nav buttons */
  .install-fab { bottom: 138px; }
  .ios-install-tip { bottom: 206px; }

  /* simplified header: Giftie + BADGE MAKER only */
  .header-band { padding: 6px 12px; }
  .main-nav, .socials { display: none; }
  .logo-badgemaker { margin-left: auto; margin-right: auto; }

  /* stack everything single column */
  .hero-grid { gap: 18px; }

  /* bottom nav bar — curved top like the crown of a large circle */
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    justify-content: space-around; align-items: center;
    height: var(--mobile-nav-h); padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
    background: var(--c-yellow);
    border-top-left-radius: 50% 34px;
    border-top-right-radius: 50% 34px;
    box-shadow: 0 -4px 14px rgba(0,0,0,.18);
  }
  .bn-item {
    width: 84px; height: 84px; flex: 0 0 auto;
    margin-top: -30px;                       /* protrude above the bar's edge */
    transition: transform .12s ease;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,.25));
  }
  .bn-item img { width: 100%; height: 100%; display: block; }
  .bn-item[aria-current="page"] { transform: translateY(-4px) scale(1.06); }

  /* templates: 2-up like mockup */
  .tpl-grid { grid-template-columns: 1fr 1fr; gap: 42px 16px; }

  /* create: editor first, steps below (matches mobile mock) */
  .editor-watermark { display: none; }
  .stage { width: min(78vw, 360px); }
  .title3d { --tw-out: 11px; --tw-in: 6px; }
  .drag-hint { top: 12px; right: 12px; font-size: .58rem; max-width: 70px; }

  .metal-strip { height: 30px; }
}

@media (max-width: 380px) {
  .tpl-grid { grid-template-columns: 1fr; }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
