/* Glaze launch (Nov 13, 2026). The themed box launch every Build-A-Box button plays.
   Pairs with /js/glaze-launch.js. Preview only.
   Skins are plain attributes, so a button, a section or the flight layer can all carry them:
     data-glz-product = rolls | matcha | brownies      (what is in the box)
     data-glz-theme   = everyday | prime | thanksgiving | next   (why the person came)
   Flight layers animate transform and opacity; the one carried lid is the only resized element. */

[data-glz-product], [data-glz-product="rolls"] {
  --btn: linear-gradient(180deg, #ecd28a 0%, #d3ae5c 46%, #bb8f2f 100%);
  --btn-ink: #3a2412; --btn-shadow: rgba(140, 96, 20, .9);
  --coin: #5b2a4a; --coin-ink: #f3d98a;
  --lid: linear-gradient(180deg, #f6ead7, #e9d7bc); --lid-line: #d4a843; --lid-under: #fffdf8;
  --tray: #fffdf8; --well: #f3e9d8; --well-r: 50%;
  --glow: 255, 208, 122;
}
[data-glz-product="matcha"] {
  --btn: linear-gradient(180deg, #c9dcab 0%, #9dba77 48%, #7d9d58 100%);
  --btn-ink: #1f2f18; --btn-shadow: rgba(70, 105, 45, .9);
  --coin: #2f4a2a; --coin-ink: #f1f6df;
  --lid: linear-gradient(180deg, #f1f5e4, #dde7cb); --lid-line: #8fae6b; --lid-under: #fbfdf4;
  --tray: #fbfdf4; --well: #e6edd6; --well-r: 50%;
  --glow: 206, 232, 160;
}
[data-glz-product="brownies"] {
  --btn: linear-gradient(180deg, #7a5442 0%, #54352a 48%, #3c241b 100%);
  --btn-ink: #fbe9c6; --btn-shadow: rgba(40, 20, 12, .95);
  --coin: #dcb85e; --coin-ink: #3c241b;
  --lid: linear-gradient(180deg, #6a4737, #4b3024); --lid-line: #dcb85e; --lid-under: #f6ead7;
  --tray: #f8efdf; --well: #ead9bf; --well-r: 12px;
  --glow: 255, 186, 108;
}
/* Themes repaint the button, lid, seal and light. Tray and wells stay with the product. */
[data-glz-theme="prime"] {
  --btn: linear-gradient(180deg, #6f2c62 0%, #4a1942 50%, #33102d 100%);
  --btn-ink: #fbf0d4; --btn-shadow: rgba(51, 16, 45, .95);
  --coin: #e7cf8a; --coin-ink: #4a1942;
  --lid: linear-gradient(180deg, #5d2552, #40183a); --lid-line: #e7cf8a; --lid-under: #f6e9dc; /* warm, so the open lid never reads as a white wash on plum */
  --glow: 255, 214, 120;
}
[data-glz-theme="thanksgiving"] {
  --btn: linear-gradient(180deg, #c1642f 0%, #94401f 50%, #6f2b16 100%);
  --btn-ink: #fff1d6; --btn-shadow: rgba(95, 38, 14, .95);
  /* the lid and seal match the closed Thanksgiving card (the porcelain keepsake box, look 25, Nov 14):
     cream porcelain, a gold hairline, a plum and gold seal, warm gold light */
  --coin: #4a1942; --coin-ink: #f0cf7a;
  --lid: linear-gradient(180deg, #fffaf0, #f1e2c6); --lid-line: #d4a843; --lid-under: #fbf1df;
  --glow: 255, 196, 110;
}
[data-glz-theme="next"] {
  --btn: linear-gradient(180deg, #eef1f6 0%, #d5dbe6 50%, #bcc5d4 100%);
  --btn-ink: #2b2140; --btn-shadow: rgba(80, 90, 120, .8);
  --coin: #3b2a55; --coin-ink: #eef1f6;
  --lid: linear-gradient(180deg, #f3f5f9, #d9dfe9); --lid-line: #a9b4c8; --lid-under: #ffffff;
  --glow: 214, 226, 255;
}

.glz-fx { pointer-events: none; overflow: hidden; contain: layout style; }
.glz-fx * { pointer-events: none; box-sizing: border-box; }
/* a page reset such as `* { max-width: 100% }` would shrink the seal and every flight piece to nothing,
   because they sit inside zero-size positioned wrappers */
.glz-fx *, .glz-nudge, .glz-nudge * { max-width: none !important; max-height: none !important; }
.glz-fx-page { position: fixed; inset: 0; z-index: 1190; }
/* hidden to the eye only: the button keeps its focus and still receives a second tap */
.glz-away { opacity: 0 !important; }
/* the top bar's "Build a box" sinks like the lab button (scale .972) the moment a finger lands: its own :active, and
   the same rule as .gp-down, which /js/glaze-press.js puts on it at pointerdown (that file times it: 90 ms in, the
   lab spring out). The launch's own press (.glz-pressing) then carries on from there. Nov 15. */
a.tb9-order:active, a.tb9-order.gp-down { transform: scale(.972); }
.glz-pressing { transform: translateY(2px) scale(.97) !important; transition: transform .16s cubic-bezier(.3, .7, .4, 1) !important; }
/* sections the carried box passes over (layout kept, nothing moves) */
.glz-pass { opacity: 0 !important; }   /* on the section only: its contents are not restyled (Nov 15) */

.gb-mover { position: absolute; left: 0; top: 0; perspective: 900px; will-change: transform; }
.gb-shadow { position: absolute; inset: 10% 4% -4%; border-radius: 26px; background: rgba(51, 16, 45, .34); filter: blur(14px); opacity: 0; }
.gb-tilt { position: absolute; inset: 0; transform-style: preserve-3d; }
.gb-lid { position: absolute; inset: 0; transform-origin: 50% 0; transform-style: preserve-3d; will-change: transform; }
.gb-face, .gb-under { position: absolute; inset: 0; border-radius: 24px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.gb-face { background: var(--lid); border: 1px solid rgba(74, 25, 66, .16); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -4px 10px rgba(80, 50, 20, .16); }
.gb-face::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--lid-line); border-radius: inherit; opacity: var(--line-o, 0); }
.gb-under { transform: rotateX(180deg); background: var(--lid-under); border: 1px solid rgba(74, 25, 66, .2); box-shadow: inset 0 0 30px rgba(120, 80, 40, .16); }
.gb-skin { position: absolute; inset: 0; border-radius: inherit; display: flex; align-items: center; padding-left: 24px; white-space: nowrap; }
.gb-skin > * { white-space: nowrap; }
.gb-mark { position: absolute; left: 0; right: 0; bottom: 13%; text-align: center; font: 600 22px/1 'Fraunces', 'Glaze Display', Georgia, serif; letter-spacing: -.02em; color: var(--lid-line); opacity: calc(var(--line-o, 0) * .75); text-shadow: 0 1px 0 rgba(255, 255, 255, .25); }
.gb-mark.is-long { font-size: 18px; font-style: italic; }
.gb-band { position: absolute; background: var(--coin); opacity: 0; }
.gb-band.h { left: 0; right: 0; top: 50%; height: 16px; margin-top: -8px; transform-origin: 100% 50%; }
.gb-band.v { top: 0; bottom: 0; left: 50%; width: 16px; margin-left: -8px; transform-origin: 50% 0; }
.gb-coin { position: absolute; left: 0; top: 0; will-change: transform; }
.glz-coin {
  position: absolute; left: -25px; top: -25px; width: 50px; height: 50px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--coin); color: var(--coin-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -2px 3px rgba(0, 0, 0, .25), 0 3px 8px -2px rgba(40, 10, 30, .45);
}
.glz-coin svg { width: 22px; height: 22px; }
.glz-coin .seal { position: absolute; inset: 5px; border-radius: 50%; border: 1.5px dashed currentColor; opacity: 0; }
.gb-glow {
  position: absolute; left: 50%; top: 50%; width: 130%; aspect-ratio: 1; margin: -65% 0 0 -65%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--glow), .95), rgba(var(--glow), .35) 45%, rgba(var(--glow), 0) 72%);
  opacity: 0; will-change: transform, opacity;
}
.gb-bit { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; }
.gb-bit.mote { width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: rgb(var(--glow)); box-shadow: 0 0 8px rgba(var(--glow), .9); }
.gb-bit.fleck { width: 8px; height: 4px; margin: -2px -4px; border-radius: 1px; background: #dcb85e; }
.gb-bit.leaf { width: 14px; height: 9px; margin: -4.5px -7px; border-radius: 0 90% 0 90%; background: #c8742b; }
.gb-bit.leaf:nth-child(3n) { background: #a5401f; }
.gb-bit.leaf:nth-child(3n+1) { background: #e0b04e; }
.gb-ring { position: absolute; left: 0; top: 0; width: 60px; height: 60px; margin: -30px; border-radius: 50%; border: 2px solid rgb(var(--glow)); opacity: 0; }

/* ───────── the nudge ───────── */
.glz-nudge { position: absolute; z-index: 2; width: 0; height: 0; pointer-events: none; transition: opacity .35s; }
.glz-nudge svg { position: absolute; overflow: visible; max-width: none; max-height: none; filter: drop-shadow(0 5px 5px rgba(51, 16, 45, .22)); }
.glz-nudge.is-done { opacity: 0; }
.glz-nudge.is-done svg, .glz-nudge.is-done .glz-nudge-ticks { animation-play-state: paused; }
.glz-nudge-ticks { opacity: 0; animation: glz-nudge-ticks 3.4s linear infinite 1.4s; }
/* mouse: a pointing finger just below the button's right end */
.glz-nudge-finger { width: 54px; height: 62px; left: -64px; top: 8px; transform-origin: 30% 10%; animation: glz-nudge-finger 3.4s cubic-bezier(.45, 0, .3, 1) infinite 1.4s both; }
.glz-nudge-thumb { -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent); mask-image: linear-gradient(180deg, #000 58%, transparent); display: none; width: 76px; height: 120px; left: -62px; top: -8px; transform-origin: 70% 100%; animation: glz-nudge-thumb 3.4s cubic-bezier(.45, 0, .3, 1) infinite 1.4s both; }
/* touch: a thumb reaching in from the lower right, as if the phone is held in the right hand */
@media (hover: none) and (pointer: coarse) {
  .glz-nudge:not(.is-finger) .glz-nudge-finger { display: none; }
  .glz-nudge:not(.is-finger) .glz-nudge-thumb { display: block; }
}
.glz-nudge.is-thumb .glz-nudge-finger { display: none; }
.glz-nudge.is-thumb .glz-nudge-thumb { display: block; }
/* mouse (Nov 14): a hand-drawn arrow cursor glides onto the coin and clicks. The pointing finger stays for .is-finger. */
.glz-nudge-cursor { display: none; width: 40px; height: 51px; left: -40px; top: -6px; transform-origin: 10% 10%; animation: glz-nudge-cursor 3.4s cubic-bezier(.45, 0, .3, 1) infinite 1.4s both; }
@media (hover: hover) and (pointer: fine) {
  .glz-nudge:not(.is-finger):not(.is-thumb) .glz-nudge-finger { display: none; }
  .glz-nudge:not(.is-finger):not(.is-thumb) .glz-nudge-cursor { display: block; }
}
.glz-nudge.is-cursor .glz-nudge-finger, .glz-nudge.is-cursor .glz-nudge-thumb { display: none; }
.glz-nudge.is-cursor .glz-nudge-cursor { display: block; }
@keyframes glz-nudge-cursor {
  0%, 100% { transform: translate(26px, 30px) rotate(-4deg); }
  30% { transform: translate(24px, 26px) rotate(-2deg); }
  56% { transform: translate(26px, 30px) rotate(-4deg); }
  68% { transform: translate(-2px, -2px) rotate(0); }
  74% { transform: translate(-1px, 0) scale(.86); }
  80% { transform: translate(-2px, -2px) scale(1); }
  90% { transform: translate(12px, 14px) rotate(-3deg); }
}
@keyframes glz-nudge-finger {
  0%, 100% { transform: translate(8px, 12px) rotate(-14deg); }
  30% { transform: translate(8px, 7px) rotate(-12deg); }
  56% { transform: translate(8px, 12px) rotate(-14deg); }
  68% { transform: translate(0, 0) rotate(-20deg) scale(.95); }
  74% { transform: translate(-1px, -3px) rotate(-21deg) scale(.9); }
  84% { transform: translate(3px, 5px) rotate(-16deg); }
}
/* the thumb rests off the coin, swings in from its base, presses, and swings back */
@keyframes glz-nudge-thumb {
  0%, 100% { transform: translate(16px, 14px) rotate(-22deg); }
  30% { transform: translate(15px, 11px) rotate(-24deg); }
  56% { transform: translate(16px, 14px) rotate(-22deg); }
  68% { transform: translate(-2px, -9px) rotate(-33deg); }
  74% { transform: translate(-4px, -12px) rotate(-35deg) scale(.97, .95); }
  84% { transform: translate(8px, 4px) rotate(-27deg); }
}
@keyframes glz-nudge-ticks { 0%, 72%, 86%, 100% { opacity: 0; } 75%, 81% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .glz-nudge { display: none; } }

/* On pages that still load the older box overlay, its picker chip and its hint hands step aside. */
html[data-glaze-launch-mode="on"] #bxlChip { display: none !important; }
html[data-glaze-launch-mode="on"] .glz-hint { display: none !important; }

/* while the box flies, the rest of the page holds still (Nov 14) */
/* while the box flies, the page's endless loops pause: js/glaze-launch.js (pauseLoops) does it on the running loops, so the tap and
   the landing never restyle the whole page (Nov 15). A selector rule here used to restyle every element twice per launch. */



/* ───────── on the page (Nov 15) ─────────
   The lid's inside is glazed porcelain, not a blank white card. On the page only the part next to the back hinge
   shows (the rest stands up behind the pinned top bar), so that part carries the depth: a warm crease where the lid
   meets the tray, the gold hairline, a soft glaze sheen, and the far side dissolving into light instead of a flat
   pale panel. The under is turned over (rotateX 180deg), so in its own box the bottom edge is the hinge.
   The mask sits on this small layer only, never on the full-screen effects layer.
   The carried box's shadow is a soft gradient, not a blurred layer: a blur filter on a layer that changes size every
   frame is redrawn every frame on a phone. The lab keeps its own look. */
.glz-fx-page .gb-under {
  background:
    linear-gradient(0deg, rgba(110, 72, 34, .26), rgba(110, 72, 34, .1) 6%, rgba(110, 72, 34, 0) 16%),
    radial-gradient(90% 40% at 50% 78%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 70%),
    linear-gradient(0deg, rgba(214, 178, 116, .34), rgba(214, 178, 116, .1) 40%, rgba(214, 178, 116, 0) 70%),
    var(--lid-under);
  border: 1px solid rgba(74, 25, 66, .14);
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .65), inset 0 0 26px rgba(120, 80, 40, .14);
  -webkit-mask-image: linear-gradient(0deg, #000, #000 22%, rgba(0, 0, 0, .45) 42%, rgba(0, 0, 0, 0) 64%);
  mask-image: linear-gradient(0deg, #000, #000 22%, rgba(0, 0, 0, .45) 42%, rgba(0, 0, 0, 0) 64%);
}
.glz-fx-page .gb-under::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--lid-line); border-radius: 18px; opacity: .55; }
.glz-fx-page .gb-shadow { filter: none; inset: 6% 0 -10%; border-radius: 34px; background: radial-gradient(closest-side, rgba(51, 16, 45, .3), rgba(51, 16, 45, .16) 55%, rgba(51, 16, 45, 0)); }
