/* ============ Camada de movimento e efeitos ============ */

/* Abertura: a tapioca doura e a cortina sobe */
.abertura {
  position: fixed; inset: 0; z-index: 200; background: var(--ouro); display: grid; place-content: center; justify-items: center; gap: 1.4rem;
  animation: abertura-sai .01s 4s forwards; /* garantia caso o JS não rode */
}
.abertura__lua { width: 180px; height: 90px; border-radius: 0 0 180px 180px; background: #f6f0e2; position: relative; overflow: hidden; box-shadow: inset 0 -8px 0 rgba(0,0,0,.06); }
.abertura__lua i { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 25%, #f6d38a, #dc9d3d 55%, #b4701c); opacity: 0; animation: abertura-doura 1.3s .2s ease-in forwards; }
.abertura__txt { margin: 0; font-family: var(--f-mao); font-size: 2rem; color: var(--vinho); }
.abertura__txt span { animation: pisca 1s infinite; }
.abertura__txt span:nth-child(2) { animation-delay: .2s; } .abertura__txt span:nth-child(3) { animation-delay: .4s; }
@keyframes abertura-doura { to { opacity: 1; } }
@keyframes pisca { 50% { opacity: .2; } }
@keyframes abertura-sai { to { visibility: hidden; opacity: 0; } }
.tem-motion:not(.pronto) .hero * { animation-play-state: paused !important; }

/* Barra de leitura */
.progresso { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 120; background: linear-gradient(90deg, var(--laranja), var(--vinho)); transform-origin: left; transform: scaleX(0); pointer-events: none; }

/* Cursor que vira tapioca nos links (só com mouse) */
.cursor { position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none; display: none; }
.cursor span {
  display: block; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--vinho);
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), border-radius .3s var(--ease), background .3s, opacity .3s;
}
.cursor.is-link span { width: 56px; height: 28px; margin: -14px 0 0 -28px; border-radius: 0 0 56px 56px; background: radial-gradient(ellipse at 50% 30%, #f3cf7e, #d99a3b); opacity: .9; }
.cursor.is-escuro span { background: var(--ouro); }
@media (hover: hover) and (pointer: fine) { .tem-motion .cursor { display: block; } }

/* Grão de filme bem sutil */
.grao {
  position: fixed; inset: -50%; z-index: 110; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grao 1.2s steps(6) infinite;
}
@keyframes grao { 0% { transform: translate(0,0); } 33% { transform: translate(-4%,3%); } 66% { transform: translate(3%,-4%); } 100% { transform: translate(-2%,2%); } }

/* Hero com profundidade */
.lua { transform-style: preserve-3d; will-change: transform; }
.lua__foto, .lua__metade { transition: transform .2s ease-out; }
.hero h1 .pal { display: inline-block; white-space: nowrap; }
.hero h1 .ch { display: inline-block; will-change: transform; }

/* Títulos com palavras que sobem */
.palavra { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.palavra > span { display: inline-block; }

/* ============ Galeria horizontal "Na mesa" ============ */
.mesa { background: var(--massa); position: relative; }
.mesa__fixo { padding: clamp(4rem, 8vw, 6rem) 0; overflow: hidden; }
.mesa__titulo { width: var(--wrap); margin: 0 auto 2.5rem; display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; }
.mesa__titulo h2 { font-size: var(--t-xxl); line-height: .95; letter-spacing: -.03em; margin: 0; max-width: 12ch; }
.mesa__titulo p { max-width: 32ch; margin: 0; font-size: var(--t-l); color: #5b4540; }
.mesa__trilho { display: flex; gap: clamp(1rem, 2vw, 2rem); padding: 0 max(1.25rem, calc((100vw - 1180px) / 2)); align-items: center; overflow-x: auto; padding-bottom: 1rem; }
.mesa.presa .mesa__trilho { width: max-content; overflow: visible; padding-bottom: 0; }
.mesa__trilho:focus-visible { outline: 3px solid var(--vinho); outline-offset: -3px; }
.foto-m { margin: 0; position: relative; flex: none; width: clamp(240px, 26vw, 360px); aspect-ratio: 4 / 5; border-radius: var(--r-m); overflow: hidden; box-shadow: var(--sombra); background: var(--ouro); }
.foto-m.f-alta { aspect-ratio: 3 / 4.6; border-radius: 200px 200px var(--r-m) var(--r-m); }
.foto-m img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); transition: transform 1.2s var(--ease); }
.foto-m:hover img { transform: scale(1.05); }
.foto-m figcaption {
  position: absolute; left: .8rem; bottom: .8rem; background: var(--massa); color: var(--vinho); font-weight: 700; font-size: var(--t-s);
  padding: .35rem .8rem; border-radius: var(--pill); transform: translateY(150%); transition: transform .5s var(--ease);
}
.foto-m:hover figcaption, .foto-m:focus-within figcaption { transform: none; }
@media (max-width: 860px) {
  .mesa__trilho { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; scrollbar-width: none; }
  .mesa__trilho::-webkit-scrollbar { display: none; }
  .foto-m { scroll-snap-align: center; width: 72vw; }
  .foto-m figcaption { transform: none; }
}
@media (min-width: 0px) {
  .calmo .mesa__trilho { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; }
  .calmo .foto-m { scroll-snap-align: center; width: min(72vw, 360px); }
  .calmo .foto-m figcaption { transform: none; }
}

/* ============ Vídeo da história ============ */
.video-historia { position: relative; aspect-ratio: 9 / 16; max-height: 78vh; width: 100%; max-width: 420px; border-radius: 32px; overflow: hidden; background: var(--tinta); box-shadow: 0 40px 80px -30px rgba(59,16,22,.7); justify-self: center; }
.video-historia video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-historia__play {
  position: absolute; inset: auto 1rem 1rem 1rem; display: flex; align-items: center; gap: .9rem; text-align: left;
  padding: .7rem 1.1rem .7rem .7rem; border: 0; border-radius: var(--pill); background: rgba(255,253,247,.92); backdrop-filter: blur(10px);
  color: var(--vinho); cursor: pointer; transition: transform .3s var(--ease);
}
.video-historia__play:hover { transform: translateY(-3px); }
.video-historia__play svg { width: 46px; height: 46px; padding: 12px 10px 12px 14px; border-radius: 50%; background: var(--vinho); color: var(--ouro); flex: none; }
.video-historia__play b { display: block; font-size: var(--t-m); }
.video-historia__play small { margin-left: auto; font-weight: 600; color: #7a6560; }
.video-historia.is-tocando .video-historia__play { opacity: 0; pointer-events: none; transform: translateY(20px); }
.video-historia::before { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 60%, rgba(43,23,20,.55)); pointer-events: none; z-index: 1; transition: opacity .4s; }
.video-historia.is-tocando::before { opacity: 0; }
.video-historia__play { z-index: 2; }
.historia blockquote cite { display: block; font-style: normal; font-size: var(--t-s); font-weight: 600; color: #6d5853; margin-top: .6rem; }

.linha-tempo { list-style: none; padding: 0; margin: 2rem 0 0; counter-reset: t; display: grid; gap: 1.1rem; position: relative; }
.linha-tempo::before { content: ''; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(var(--ouro) var(--progresso-t, 0%), #eadfd2 0); }
.linha-tempo li { counter-increment: t; position: relative; padding-left: 3.2rem; }
.linha-tempo li::before {
  content: counter(t); position: absolute; left: 0; top: -2px; width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center;
  background: var(--massa); border: 3px solid var(--ouro); font-weight: 800; color: var(--vinho); font-size: .9rem;
}
.linha-tempo b { display: block; font-size: var(--t-m); }
.linha-tempo span { color: #5b4540; font-size: var(--t-s); }

/* Mural de depoimentos com leve inclinação */
.dep { transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.dep:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 30px 50px -28px rgba(59,16,22,.9); }

/* Recortes de mídia revelados com cortina */
.recorte figure { clip-path: inset(0 0 0 0 round var(--r-s)); }

/* Brilho que percorre o botão principal */
.btn:not(.btn--linha):not(.sacola-btn) { position: relative; overflow: hidden; isolation: isolate; }
.btn:not(.btn--linha):not(.sacola-btn)::after {
  content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform .8s var(--ease);
}
.btn:not(.btn--linha):not(.sacola-btn):hover::after { transform: translateX(120%); }

.calmo .cursor, .calmo .grao { display: none !important; }

/* Celular: carrossel com a foto do centro em destaque (fica aqui porque este arquivo carrega depois do style.css) */
@media (max-width: 860px) {
  .mesa__trilho { gap: .9rem; padding: .5rem 14vw 1.2rem; }
  .foto-m, .foto-m.f-alta { width: 72vw; aspect-ratio: 3 / 4; border-radius: 26px; transform: scale(var(--s, .9)); transition: transform .25s ease-out; }
  .foto-m img { transform: scale(1.05); }
}
