/* Caramello Cookies: creme de massa crua, caramelo e as molduras coloridas do cardápio dela */
:root {
  --creme: #FFF4E3;
  --caramelo: #8F4A0E;
  --cacau: #3A2014;
  --cacau-2: #65402A;
  --papel: #FFFBF4;
  --f-nome: "Bagel Fat One", "Arial Rounded MT Bold", sans-serif;
  --f-txt: "Karla", system-ui, sans-serif;
  --ease-enter: cubic-bezier(.2, .8, .25, 1);
  --ease-dente: cubic-bezier(.2, 1.5, .4, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--cacau); background: var(--creme); font: 500 17px/1.5 var(--f-txt); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--caramelo); outline-offset: 3px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 30; padding: 10px 14px; color: #fff; background: var(--cacau); }
.skip:focus { top: 8px; }
.marco { position: absolute; top: 170px; left: 0; width: 1px; height: 1px; }
.page { max-width: 560px; margin: 0 auto; padding-bottom: calc(26px + env(safe-area-inset-bottom)); overflow-x: clip; }
main { padding: 0 20px; }
h2 { font: 400 clamp(33px, 9.6vw, 42px)/1.08 var(--f-nome); margin: 0 0 14px; color: var(--caramelo); }
h3 { font: 400 22px/1.1 var(--f-nome); margin: 0 0 4px; }
p { margin: 0; }
section { margin-top: 56px; }

/* Cena 1 */
.hero { position: relative; padding: calc(14px + env(safe-area-inset-top)) 20px 4px; overflow: hidden; }
.hero__bar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero__bar img { width: 66px; height: 66px; border-radius: 50%; }
.hero__bar a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-weight: 700; font-size: 15.5px; text-decoration: none; }
.biscoito { position: relative; width: min(92%, 420px); margin: -22px -9% 0 auto; }
.biscoito svg { display: block; width: 100%; height: auto; overflow: visible; }
.mordida { transform-box: fill-box; transform-origin: center; }
.farelos { position: absolute; inset: 0; pointer-events: none; }
.farelos i { position: absolute; left: var(--x); top: var(--y); width: var(--t); height: calc(var(--t) * .8); background: var(--c); border-radius: 45% 58% 50% 40%; transform: rotate(var(--r)); }
.nome { position: relative; z-index: 2; margin: -22px 0 0; font: 400 clamp(54px, 18vw, 90px)/.92 var(--f-nome); color: var(--cacau); }
.nome span { display: block; }
.nome .nome__2 { color: var(--caramelo); }
.hero__lead { margin-top: 16px; max-width: 32ch; font-size: 20px; line-height: 1.3; }
.ancora { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin-top: 6px; font-weight: 700; color: var(--caramelo); }

/* Abertura: três mordidas, os farelos caem e o nome chega */
.js .hero:not(.pronto) .mordida { transform: scale(0); animation: seguro-mordida 0s 2.6s forwards; }
.js .hero:not(.pronto) .nome span { clip-path: inset(0 0 100% 0); animation: seguro-nome 0s 2.6s forwards; }
.js .hero:not(.pronto) .farelos i { opacity: 0; animation: seguro-farelo 0s 2.6s forwards; }
@keyframes seguro-mordida { to { transform: scale(1); } }
@keyframes seguro-nome { to { clip-path: inset(0); } }
@keyframes seguro-farelo { to { opacity: 1; } }

.hero.abertura .biscoito { animation: mastiga 1060ms ease-out both; }
.js .hero.abertura:not(.pronto) .mordida--1 { animation: dente 170ms 180ms var(--ease-dente) both; }
.js .hero.abertura:not(.pronto) .mordida--2 { animation: dente 170ms 470ms var(--ease-dente) both; }
.js .hero.abertura:not(.pronto) .mordida--3 { animation: dente 170ms 760ms var(--ease-dente) both; }
.js .hero.abertura:not(.pronto) .farelos i { animation: cai 420ms calc(240ms + var(--d)) cubic-bezier(.45, .05, .9, .55) both; }
.js .hero.abertura:not(.pronto) .nome span { animation: chega 420ms 520ms var(--ease-enter) both; }
.js .hero.abertura:not(.pronto) .nome .nome__2 { animation-delay: 680ms; }
@keyframes dente { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes mastiga {
  17%, 45%, 72% { transform: none; }
  22% { transform: rotate(-1.4deg) scale(.985); }
  50% { transform: rotate(1.1deg) scale(.985); }
  77% { transform: rotate(-.9deg) scale(.985); }
  32%, 60%, 88%, 100% { transform: none; }
}
@keyframes cai { from { opacity: 0; transform: translateY(-64px) rotate(0deg); } 20% { opacity: 1; } to { opacity: 1; transform: rotate(var(--r)); } }
@keyframes chega { from { clip-path: inset(0 0 100% 0); transform: translateY(-16px); } to { clip-path: inset(0 0 -10% 0); transform: none; } }
.js .hero.sem-abertura:not(.pronto) .mordida { transform: scale(1); animation: none; }
.js .hero.sem-abertura:not(.pronto) .nome span { clip-path: none; animation: fade 240ms both; }
.js .hero.sem-abertura:not(.pronto) .farelos i { opacity: 1; animation: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.biscoito.is-treme { animation: treme 300ms var(--ease-enter); }
@keyframes treme { 35% { transform: rotate(-1.2deg) scale(.985); } }

/* Botões */
.links { display: grid; gap: 10px; margin-top: 26px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 12px 16px; font: 700 17.5px var(--f-txt); color: var(--cacau); text-decoration: none; background: var(--papel); border: 2px solid var(--cacau); border-radius: 30px; cursor: pointer; transition: transform 130ms var(--ease-enter), background 130ms; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); background: #F7E6CD; }
.btn--acao { color: #fff; background: var(--caramelo); border-color: var(--caramelo); }
.btn--acao:active { background: #743C0B; }

/* Sabores: as molduras coloridas do cardápio dela */
.sabores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sabor { display: flex; flex-direction: column; color: #fff; background: var(--cor); border-radius: 18px; overflow: hidden; }
.sabor img { width: 100%; aspect-ratio: 1 / .92; object-fit: cover; }
.sabor__txt { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 12px 12px 14px; }
.sabor p { font-size: 15.5px; line-height: 1.3; }
.sabor--nutella { --cor: #5A2C13; grid-column: 1 / -1; display: grid; grid-template-columns: 50% 1fr; }
.sabor--nutella img { height: 100%; aspect-ratio: auto; }
.sabor--red { --cor: #9E2228; }
.sabor--double { --cor: #24656A; }
.sabor--black { --cor: #1E1714; }
.sabor--kinder { --cor: #A04C0B; }
.selo-q { align-self: flex-start; padding: 2px 10px; color: var(--cacau); background: #F8DDB0; border-radius: 12px; font-weight: 700; font-size: 14px !important; }
.pede { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; min-height: 44px; margin-top: auto; padding: 0 16px; color: var(--cacau); background: var(--papel); border-radius: 22px; font-weight: 700; text-decoration: none; transition: transform 130ms var(--ease-enter); -webkit-tap-highlight-color: transparent; }
.sabor__txt p + .pede { margin-top: 8px; }
.pede:active { transform: scale(.96); }

.forno img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; margin-bottom: 14px; }
.forno h2 { margin-bottom: 4px; }
.ajuda { margin-bottom: 8px; color: var(--cacau-2); }
form { display: grid; gap: 6px; }
label { margin-top: 8px; font-weight: 700; font-size: 15.5px; }
select, input { width: 100%; min-height: 50px; padding: 10px 12px; font: 500 17px var(--f-txt); color: var(--cacau); background: var(--papel); border: 2px solid #CDA87C; border-radius: 12px; }
form .btn { margin-top: 14px; }

.final { text-align: center; }
.final img { width: 74%; aspect-ratio: 1; object-fit: cover; margin: 0 auto 14px; border-radius: 50%; }
.flutuante { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20; display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 24px; color: #fff; background: var(--caramelo); border-radius: 28px; font-weight: 700; text-decoration: none; white-space: nowrap; box-shadow: 0 8px 22px rgba(58, 32, 20, .28); visibility: hidden; opacity: 0; transform: translate(-50%, 16px); transition: opacity 240ms var(--ease-enter), transform 240ms var(--ease-enter), visibility 0s 240ms; }
.flutuante.is-visivel { visibility: visible; opacity: 1; transform: translate(-50%, 0); transition-delay: 0s; }

.rodape { margin-top: 44px; padding: 0 20px; text-align: center; font-size: 14px; color: var(--cacau-2); }
.credito { display: flex; width: fit-content; align-items: center; gap: 14px; min-height: 44px; margin: 18px auto 0; text-align: left; font-size: 13px; line-height: 1.35; color: var(--cacau); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.credito-txt strong { display: block; font-size: 15px; font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.selo-b2 { --seal-ink: currentColor; --seal-accent: var(--caramelo); --seal-ring: 0.4 1.4; --seal-font: var(--f-txt); flex: none; width: 72px; height: 72px; overflow: visible; transition: rotate 320ms cubic-bezier(.22, 1, .36, 1); }
.selo-borda, .selo-anel { fill: none; stroke: var(--seal-ink); }
.selo-borda { stroke-width: 1; }
.selo-anel { stroke-width: .7; stroke-dasharray: var(--seal-ring); opacity: .75; }
.selo-texto { fill: var(--seal-ink); font-family: var(--seal-font); font-size: 6.3px; font-weight: 700; letter-spacing: .8px; }
.selo-b { fill: var(--seal-ink); }
.selo-acento { fill: var(--seal-accent); }
.credito:active .selo-b2 { rotate: -10deg; }
.selo-giro { transform-box: view-box; transform-origin: 50px 50px; }
@keyframes selo-gira { to { transform: rotate(360deg); } }
@keyframes selo-flutua { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@media (prefers-reduced-motion: no-preference) {
  .selo-giro { animation: selo-gira 24s linear infinite; }
  .selo-b2 { animation: selo-flutua 4.8s ease-in-out infinite; }
  .selo-b2.is-still, .selo-b2.is-still .selo-giro, .is-page-hidden .selo-b2, .is-page-hidden .selo-giro { animation-play-state: paused; }
}
/* Reduced motion: cookie já mordido, farelos no lugar e nome com fade curto */
@media (prefers-reduced-motion: reduce) {
  .js .hero:not(.pronto) .mordida { transform: scale(1); animation: none; }
  .js .hero:not(.pronto) .farelos i { opacity: 1; animation: none; }
  .js .hero:not(.pronto) .nome span, .hero .nome span { clip-path: none; animation: fade 200ms both; }
  .biscoito.is-treme { animation: none; }
  .flutuante { transform: translate(-50%, 0); transition: opacity 200ms, visibility 0s 200ms; }
  .btn, .pede { transition: none; }
  .credito:active .selo-b2 { rotate: none; }
}
