/* Miaunies — landing page */

:root {
  --cocoa: #2a1510;
  --ganache: #4a2418;
  --magenta: #a81669;
  --magenta-deep: #7c0f4c;
  --blush: #f5dde6;
  --milk: #fff7f8;
  --kraft: #ece5d5;
  --ink-soft: #6b4a42;

  --serif: "Young Serif", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;

  --gutter: 20px;
  --max: 1180px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--milk);
  color: var(--cocoa);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
main > section { scroll-margin-top: 64px; }
#montagem { scroll-margin-top: 0; }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border-radius: 999px;
  background: var(--magenta); color: #fff;
  font: 600 1rem/1 var(--sans); text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(124, 15, 76, .7);
  transition: transform .25s var(--ease-out), background-color .25s;
}
.btn:hover { background: var(--magenta-deep); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: .92rem; box-shadow: none; }
.btn-light { background: #fff; color: var(--magenta); box-shadow: 0 14px 30px -14px rgba(0,0,0,.45); }
.btn-light:hover { background: var(--blush); }
.text-link {
  font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  padding-bottom: 2px;
  transition: background-size .3s var(--ease-out);
}
.text-link:hover { background-size: 40% 2px; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--gutter);
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(245, 221, 230, .72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  transition: transform .45s var(--ease-out);
}
.top.is-away { transform: translateY(-110%); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--magenta); }
.brand-mark { width: 38px; height: 30px; fill: currentColor; }
.brand span { font: 700 1.3rem/1 var(--sans); letter-spacing: -.02em; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; gap: 36px;
  padding: 96px var(--gutter) 64px;
  background:
    radial-gradient(120% 70% at 50% 0%, #fbeaf0 0%, transparent 60%),
    var(--blush);
  overflow: hidden;
}
.hero-art {
  position: relative;
  width: min(100%, 420px);
  margin-inline: auto;
  aspect-ratio: 1 / 1.08;
}
.hero-photo {
  position: absolute; right: 0; top: 0; margin: 0;
  width: 68%; aspect-ratio: 3 / 4;
  border-radius: 999px 999px 28px 28px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(42, 21, 16, .55);
  animation: arch-in 1.3s var(--ease-out) .15s both;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; transform: scale(1.12); animation: photo-settle 2.2s var(--ease-out) .15s both; }
@keyframes arch-in { from { clip-path: inset(100% 0 0 0 round 999px 999px 28px 28px); } to { clip-path: inset(0 0 0 0 round 999px 999px 28px 28px); } }
@keyframes photo-settle { from { transform: scale(1.35); } to { transform: scale(1.12); } }

.badge {
  position: absolute; left: 0; bottom: 0;
  width: 66%; aspect-ratio: 1;
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 50%;
  filter: drop-shadow(0 22px 30px rgba(124, 15, 76, .28));
  transform: perspective(800px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform .5s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.badge-svg { width: 100%; height: 100%; display: block; fill: var(--magenta); overflow: visible; }
.badge-disc { fill: #fff; transform-box: fill-box; transform-origin: center; animation: disc-in .7s var(--ease-back) both; }
.ring-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ring-draw 1.4s cubic-bezier(.65, 0, .35, 1) .35s forwards; }
.word > g, .tag > g { transform-box: fill-box; transform-origin: 50% 100%; }
.word > g { animation: letter-pop .7s var(--ease-back) both; animation-delay: calc(.75s + var(--i) * 75ms); }
.tag > g { animation: letter-fade .5s var(--ease-out) both; animation-delay: calc(1.5s + var(--i) * 35ms); }
.cat { transform-box: fill-box; transform-origin: 50% 92%; animation: cat-in .9s var(--ease-back) 1.15s both, cradle 3.6s ease-in-out 2.1s infinite; }
.badge.is-purring .cat { animation: purr .9s ease-in-out; }

@keyframes disc-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
@keyframes letter-pop { from { transform: translateY(70px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes letter-fade { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cat-in { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cradle { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes purr {
  0% { transform: rotate(0); } 15% { transform: rotate(-12deg) scale(1.04); } 35% { transform: rotate(10deg) scale(1.06); }
  55% { transform: rotate(-7deg) scale(1.03); } 75% { transform: rotate(4deg); } 100% { transform: rotate(0); }
}

.hero-copy { max-width: 34rem; margin-inline: auto; text-align: center; animation: copy-in 1s var(--ease-out) .5s both; }
.hero h1 { font-size: clamp(2.1rem, 8.4vw, 4.4rem); line-height: 1.06; letter-spacing: -.015em; }
.lead { margin-top: 18px; font-size: 1.08rem; color: var(--ink-soft); max-width: 32rem; margin-inline: auto; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 26px; margin-top: 30px; }
@keyframes copy-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- build (scroll-driven assembly) ---------- */
.build {
  --S: min(52vw, 36svh, 340px);              /* brownie width = depth */
  --h1: calc(var(--S) * .24);
  --h2: calc(var(--S) * .10);
  --h3: calc(var(--S) * .08);
  --h4: calc(var(--S) * .18);
  --stack: calc(var(--h1) + var(--h2) + var(--h3) + var(--h4));
  position: relative;
  height: 560vh;
  background: var(--cocoa);
  color: var(--milk);
}
.build-sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: max(28px, env(safe-area-inset-top)) var(--gutter) 28px;
  overflow: hidden;
  background:
    radial-gradient(60% 45% at 50% 52%, rgba(168, 22, 105, .30), transparent 70%),
    radial-gradient(90% 60% at 50% 110%, rgba(255, 255, 255, .06), transparent 70%);
}
.build-title { font-size: clamp(1.7rem, 6.4vw, 3rem); line-height: 1.1; text-align: center; }

.stage { position: relative; perspective: 1400px; perspective-origin: 50% 35%; min-height: 0; }
.scene {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: translateY(calc(var(--S) * .05)) rotateX(var(--rx, -26deg)) rotateY(var(--ry, -38deg)) scale(var(--zoom, 1));
}

.box {
  --W: var(--S);
  position: absolute; left: 50%; top: 50%;
  width: var(--W); height: var(--h);
  margin-left: calc(var(--W) / -2);
  margin-top: calc(var(--h) * -1);
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
}
.layer {
  transform:
    translate3d(0, calc(var(--stack) / 2 - var(--below) + var(--drop, 0) * -110svh), 0)
    scale3d(var(--sx, 1), var(--sq, 1), var(--sx, 1));
}
.layer[data-hidden] { visibility: hidden; }
.f { position: absolute; left: 0; top: 0; width: var(--W); height: var(--h); backface-visibility: hidden; }
.f-front { transform: translateZ(calc(var(--W) / 2)); }
.f-back  { transform: rotateY(180deg) translateZ(calc(var(--W) / 2)); }
.f-right { transform: rotateY(90deg) translateZ(calc(var(--W) / 2)); }
.f-left  { transform: rotateY(-90deg) translateZ(calc(var(--W) / 2)); }
.f-top   { height: var(--W); top: calc(var(--h) / 2 - var(--W) / 2); transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }

/* texturas: fotos CC0 do Wikimedia Commons (ver assets-src/textures/CREDITOS.md) */
.brownie .f { background: url("../img/tex-side.webp?v=2") center / cover, #3a1c12; }
.brownie .f-right, .brownie .f-back { filter: brightness(.7); }
.brownie .f-left { filter: brightness(.88); }
.brownie .f-top { background: url("../img/tex-crumb.webp?v=2") center / cover, #3a1c12; }
.crust .f-front, .crust .f-left, .crust .f-right, .crust .f-back {
  background:
    linear-gradient(180deg, rgba(120, 72, 46, .55), transparent 22%),
    url("../img/tex-side.webp?v=2") center 30% / cover,
    #3a1c12;
}
.crust .f-top {
  background: url("../img/tex-crust.webp?v=2") center / cover, #4a2416;
  box-shadow: inset 0 0 calc(var(--S) * .06) rgba(20, 8, 4, .5);
}
.ninho .f { background: url("../img/tex-ninho.webp?v=2") center / cover, #f6ece4; }
.ninho .f-right, .ninho .f-back { filter: brightness(.86); }
.ninho .f-top { background: url("../img/tex-ninho.webp?v=2") center / 60% auto, #f6ece4; }
.nutella .f { background: url("../img/tex-nutella.webp?v=2") center / cover, #5f2b14; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.nutella .f-right, .nutella .f-back { filter: brightness(.75); }
.nutella .f-top {
  background:
    radial-gradient(40% 25% at 32% 30%, rgba(255, 255, 255, .22), transparent 70%),
    url("../img/tex-nutella.webp?v=2") center / cover,
    #5f2b14;
}

/* plastic bag */
.bag {
  --W: calc(var(--S) * 1.1);
  --h: calc(var(--stack) * 1.12);
  transform:
    translate3d(0, calc(var(--stack) / 2 + var(--S) * .006 + var(--drop, 0) * -120svh), 0)
    scale3d(var(--bs, 1), var(--bs, 1), var(--bs, 1));
}
.bag .f {
  background:
    linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, .42) 26%, rgba(255, 255, 255, .06) 33%, transparent 46%, rgba(255, 255, 255, .22) 62%, transparent 72%)
      calc(var(--sh, 0) * 100%) 0 / 260% 100% no-repeat,
    rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 4px;
}
.bag .f-top { transform-style: preserve-3d; backface-visibility: visible; }
.skirt {
  position: absolute;
  left: calc(var(--W) * -.22); top: calc(var(--h) - var(--W) * .72);
  width: calc(var(--W) * 1.44); height: calc(var(--W) * 1.44);
  transform: rotateX(90deg);
  transform-origin: 50% 50%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .35);
  outline: 2px dashed rgba(255, 255, 255, .22); outline-offset: calc(var(--W) * -.05);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .03) 35%, rgba(255, 255, 255, .16) 60%, rgba(255, 255, 255, .03) 80%);
}
.sticker {
  position: absolute; left: 50%; top: 50%;
  width: 66%; aspect-ratio: 1;
  display: grid; grid-template-rows: 1fr auto; place-items: center;
  padding: 7% 7% 8%;
  background: var(--kraft);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 6px 14px rgba(0, 0, 0, .25);
  opacity: var(--lo, 1);
  transform: translate(-50%, -50%) translateZ(calc(2px + var(--lz, 0) * 1px)) rotate(calc(var(--lr, 0) * 1deg)) scale(var(--ls, 1));
}
.sticker svg { width: 70%; aspect-ratio: 1; fill: var(--magenta); }
.sticker-flavor { justify-self: start; font: 700 calc(var(--S) * .052)/1.05 var(--sans); color: var(--cocoa); }
.sticker-flavor small { display: block; font-weight: 500; font-size: .7em; color: var(--magenta); }

.floor {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--S) * 2.2); height: calc(var(--S) * 2.2);
  margin: calc(var(--S) * -1.1) 0 0 calc(var(--S) * -1.1);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, .25) 45%, transparent 75%);
  transform: translateY(calc(var(--stack) / 2 + 1px)) rotateX(90deg);
  opacity: var(--floor, .35);
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li {
  grid-area: 1 / 1;
  display: flex; gap: 14px; align-items: flex-start;
  max-width: 30rem; margin-inline: auto;
  opacity: 0; transform: translateY(12px);
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.steps li.is-active { opacity: 1; transform: none; }
.steps h3 { font-size: 1.3rem; line-height: 1.2; }
.steps p { margin-top: 4px; color: rgba(255, 247, 248, .72); font-size: .98rem; }
.step-n {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid currentColor;
  font: 600 .95rem/1 var(--sans);
}
.steps .step-n { color: #f39cc8; }
.build-progress { height: 3px; margin-top: 20px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.build-progress i { display: block; height: 100%; width: 100%; background: #f39cc8; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- product ---------- */
.product {
  display: grid; gap: 36px;
  padding: 88px var(--gutter);
  max-width: var(--max); margin-inline: auto;
}
.product-photo { margin: 0; border-radius: 28px; overflow: hidden; box-shadow: 0 40px 70px -40px rgba(42, 21, 16, .6); }
.product-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product h2 { font-size: clamp(1.9rem, 6vw, 3.1rem); line-height: 1.1; }
.product-copy > p { margin-top: 18px; color: var(--ink-soft); max-width: 36rem; }
.traits { margin: 32px 0 0; display: grid; gap: 0; }
.traits div { padding: 18px 0; border-top: 1px solid rgba(42, 21, 16, .14); display: grid; gap: 4px; }
.traits div:last-child { border-bottom: 1px solid rgba(42, 21, 16, .14); }
.traits dt { font: 400 1.25rem/1.2 var(--serif); color: var(--magenta); }
.traits dd { margin: 0; color: var(--ink-soft); }

/* ---------- flavors ---------- */
.flavors {
  padding: 88px var(--gutter);
  background: var(--blush);
}
.flavors h2 { font-size: clamp(1.9rem, 6vw, 3.1rem); line-height: 1.1; max-width: var(--max); margin: 0 auto; }
.flavor-list { list-style: none; padding: 0; margin: 36px auto 0; max-width: var(--max); display: grid; }
.flavor-list li {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
  padding: 22px 0;
  border-top: 1px solid rgba(42, 21, 16, .14);
}
.flavor-list li:last-child { border-bottom: 1px solid rgba(42, 21, 16, .14); }
.flavor-list h3 { font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.15; }
.flavor-list p { margin-top: 4px; color: var(--ink-soft); }
.slice {
  width: 64px; height: 52px; border-radius: 6px;
  background: linear-gradient(180deg,
    #6b3a24 0 7%, var(--c4) 7% 32%, var(--c3) 32% 46%, var(--c2) 46% 62%, var(--c1) 62% 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 10px 18px -10px rgba(42, 21, 16, .7);
  transform: rotate(-4deg);
  transition: transform .5s var(--ease-back);
}
.flavor-list li:hover .slice { transform: rotate(3deg) translateY(-3px); }

/* ---------- order ---------- */
.order {
  padding: 96px var(--gutter);
  background:
    radial-gradient(80% 60% at 85% 0%, rgba(255, 255, 255, .14), transparent 60%),
    var(--magenta);
  color: #fff;
}
.order-inner { max-width: 40rem; margin-inline: auto; }
.order h2 { font-size: clamp(2.1rem, 8vw, 3.6rem); line-height: 1.05; }
.order .lead { color: rgba(255, 255, 255, .85); margin-inline: 0; }
.order-steps { list-style: none; padding: 0; margin: 36px 0 40px; display: grid; gap: 18px; }
.order-steps li { display: flex; gap: 16px; align-items: center; }
.order-steps p { font-size: 1.05rem; }

/* ---------- footer ---------- */
.foot {
  display: grid; justify-items: center; gap: 10px;
  padding: 72px var(--gutter) max(40px, env(safe-area-inset-bottom));
  background: var(--cocoa); color: var(--blush); text-align: center;
}
.foot-logo { width: 150px; height: 150px; fill: var(--blush); margin-bottom: 10px; }
.foot-small { font-size: .85rem; opacity: .6; }

/* ---------- larger screens ---------- */
@media (min-width: 720px) {
  :root { --gutter: 40px; }
  .flavor-list { grid-template-columns: 1fr 1fr; column-gap: 56px; }
  .flavor-list li:nth-last-child(2) { border-bottom: 1px solid rgba(42, 21, 16, .14); }
  .order-steps { grid-template-columns: repeat(3, 1fr); }
  .order-steps li { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 960px) {
  .hero {
    min-height: 100svh;
    grid-template-columns: 1.05fr 1fr; align-items: center; gap: 56px;
    padding: 110px max(var(--gutter), calc((100vw - var(--max)) / 2)) 80px;
  }
  .hero-copy { order: -1; text-align: left; margin: 0; }
  .lead { margin-inline: 0; }
  .cta-row { justify-content: flex-start; }
  .hero-art { width: min(100%, 520px); }

  .build { --S: min(26vw, 40svh, 360px); }
  .build-sticky {
    grid-template-columns: minmax(300px, 1fr) 1.4fr;
    grid-template-rows: auto 1fr auto;
    column-gap: 48px;
    padding: 64px max(var(--gutter), calc((100vw - var(--max)) / 2)) 48px;
  }
  .build-title { grid-column: 1; grid-row: 1; text-align: left; align-self: end; }
  .stage { grid-column: 2; grid-row: 1 / 4; }
  .steps { grid-column: 1; grid-row: 2; align-content: center; gap: 6px; }
  .steps li { grid-area: auto; margin: 0; opacity: .32; transform: none; padding: 10px 0; }
  .steps li p { overflow: hidden; max-height: 0; transition: max-height .5s var(--ease-out); }
  .steps li.is-active { opacity: 1; }
  .steps li.is-active p { max-height: 6em; }
  .build-progress { grid-column: 1; grid-row: 3; }

  .product { grid-template-columns: 1fr 1fr; align-items: center; gap: 72px; padding-block: 120px; }
  .flavors, .order { padding-block: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .ring-draw { stroke-dashoffset: 0; }
}
