/* Cenário de papelão: mesa, título, caixa, contador e decoração. */

/* a faixa de protótipo (quando existe) entra antes da cena sem empurrar o rodapé para fora */
.page-public { display: flex; flex-direction: column; }
.scene {
  position: relative; isolation: isolate; flex: 1 0 auto;
  display: flex; flex-direction: column;
  padding: clamp(24px, 5vw, 52px) clamp(16px, 4vw, 48px) 0;
  overflow: clip;
}
/* Mesa de madeira. Na página pública ela começa logo acima da base da caixa
   (--desk-lip) e desce até o fim da página; nos cartões (.desk) tem altura fixa. */
.scene-grid::before, .desk::after {
  content: ""; position: absolute; z-index: -1;
  background:
    linear-gradient(var(--desk-top), var(--desk-top)) top / 100% 8px no-repeat,
    repeating-linear-gradient(0deg, transparent 0 26px, rgba(0, 0, 0, .07) 26px 28px),
    linear-gradient(var(--desk-1), var(--desk-2) 260px) var(--desk-2);
  box-shadow: inset 0 16px 18px -12px rgba(0, 0, 0, .35);
}
.scene-grid::before { left: -100vw; right: -100vw; top: calc(100% - var(--desk-lip)); height: 200vh; }
.desk::after { left: 0; right: 0; bottom: 0; height: var(--desk-h, 150px); }

.scene-head { max-width: 760px; margin: 0 auto clamp(18px, 3.5vw, 36px); text-align: center; }
.scene-head h1 {
  margin: 0;
  font-family: var(--display); font-weight: 800; font-size: clamp(34px, 6.4vw, 64px); line-height: 1.05;
  transform: rotate(-2deg);
  text-decoration: underline wavy #ff6b5a;
  text-decoration-thickness: 3px; text-underline-offset: 12px; text-decoration-skip-ink: none;
}
.scene-head p { margin: 16px 0 0; font-size: clamp(17px, 2.2vw, 21px); font-weight: 600; color: #5a4a36; }

.scene-grid {
  --desk-lip: min(108px, 24vw);
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; align-items: end;
  width: 100%; max-width: 1000px; margin: 0 auto;
}
@media (min-width: 800px) {
  .scene-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
}

.scene-foot {
  position: relative; display: flex; justify-content: center;
  margin-top: auto; padding: 28px 16px 18px;
}
.scene-foot p {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px;
  margin: 0; padding: 6px 16px 7px; border-radius: 999px;
  background: rgba(38, 32, 25, .62); color: #fff;
  font-size: 14px; line-height: 1.35; text-align: center;
}
.scene-foot .link-btn { color: #fff; }

/* página 404 */
.lost { justify-content: center; }
.lost-card { display: grid; justify-items: center; gap: 10px; margin: auto; padding-bottom: 140px; text-align: center; }
.lost-art { width: 160px; transform: rotate(-8deg); }
.lost h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 76px; line-height: 1; }
.lost p { margin: 0 0 12px; font-size: 19px; font-weight: 600; color: #5a4a36; }

/* caneca e lápis, só em telas largas */
.decor { display: none; }
@media (min-width: 1180px) {
  .decor { display: block; position: absolute; z-index: 0; pointer-events: none; }
  .decor.mug { right: 3%; bottom: 58px; width: 96px; }
  .decor.pencil { left: 7%; bottom: 30px; width: 150px; transform: rotate(-6deg); }
}

/* ---------- caixa ---------- */
.box-col { display: flex; justify-content: center; }
.box-wrap { position: relative; width: min(100%, 430px); container-type: inline-size; }
.box-art { transform-origin: 50% 100%; }
.box-art:empty { aspect-ratio: 420 / 430; }
.box { width: 100%; height: auto; overflow: visible; color: var(--ink); }

.peek {
  opacity: 0; transform: translateY(14px); transform-box: fill-box;
  transition: opacity .35s, transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.peek.on { opacity: 1; transform: none; }

.box-title { font-family: var(--display); font-weight: 800; font-size: 34px; fill: #222; }

.box .tape-curl { transform-box: fill-box; transform-origin: 50% 0; animation: flutter 2.6s ease-in-out infinite; }
.box .doodle-star { transform-box: fill-box; transform-origin: center; animation: twinkle 3s ease-in-out infinite; }
@keyframes flutter { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-10deg) skewX(-6deg); } }
@keyframes twinkle {
  0%, 70%, 100% { transform: scale(1) rotate(0deg); }
  80% { transform: scale(1.25) rotate(18deg); }
  90% { transform: scale(.95) rotate(-6deg); }
}

/* contador: adesivo redondo colado na frente da caixa */
.count-badge {
  position: absolute; z-index: 3; left: 57%; top: 80%;
  transform: translate(-50%, -50%) rotate(9deg); pointer-events: none;
}
.count-badge .bi {
  display: grid; place-content: center; width: 23cqi; aspect-ratio: 1; text-align: center;
  background: var(--sticker); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25); color: var(--ink);
}
.count-badge strong { display: block; font-family: var(--display); font-weight: 800; font-size: 10cqi; line-height: .9; }
.count-badge span { display: block; font-size: max(12px, 3.6cqi); font-weight: 700; line-height: 1.1; }
.count-badge.is-empty .bi { background: #fff; }
