/*
 * Nagi Sushi — movimento em CSS.
 * Easing lento e preciso; nada elástico, nada com quique.
 * Entradas CSS em elementos que o GSAP também anima usam
 * animation-fill-mode: backwards (não deixam valor permanente).
 */

/* ============ SHOJI: portas de papel que se abrem ao carregar (100% CSS) ============ */
.shoji {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  pointer-events: none;
  animation: shoji-some 0.01s linear 2.15s forwards;
}
.shoji-porta {
  --ripa: #C3A77C;
  position: relative;
  flex: 1;
  background-color: #F6F1E6;
  background-image:
    linear-gradient(90deg, var(--ripa) 0 3px, transparent 3px),
    linear-gradient(0deg, var(--ripa) 0 3px, transparent 3px),
    var(--tx-fibras),
    var(--tx-grao);
  background-size: calc(100% / 3) 15vh, calc(100% / 3) 15vh, auto, auto;
  background-position: -1.5px -1.5px, -1.5px -1.5px, 0 0, 0 0;
  border: 12px solid #B8996A;
  box-shadow: inset 0 0 0 1px rgb(27 36 51 / 0.12), inset 0 0 60px rgb(184 154 110 / 0.25);
}
.shoji-esq { border-right-width: 6px; animation: shoji-esq 1.5s var(--ease-io) 0.45s forwards; }
.shoji-dir { border-left-width: 6px; animation: shoji-dir 1.5s var(--ease-io) 0.45s forwards; }
.shoji-puxador {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 56px;
  margin-top: -28px;
  border-radius: 7px;
  background: #A8885A;
  box-shadow: inset 0 2px 4px rgb(27 36 51 / 0.45), 0 1px 0 rgb(255 255 255 / 0.4);
}
.shoji-esq .shoji-puxador { right: 18px; }
.shoji-dir .shoji-puxador { left: 18px; }

@keyframes shoji-esq { to { transform: translateX(-101%); } }
@keyframes shoji-dir { to { transform: translateX(101%); } }
@keyframes shoji-some { to { visibility: hidden; } }

/* ============ HERO: título por linha com máscara, peças e ensō ============ */
@media (prefers-reduced-motion: no-preference) {
  .hero-titulo .linha > span {
    animation: linha-sobe 1.4s var(--ease-saida) backwards;
    animation-delay: calc(1.05s + var(--i) * 0.13s);
  }
  .hero .sobretitulo, .hero-sub, .hero-acoes, .hero-numeros {
    animation: sobe-suave 1.2s var(--ease-saida) backwards;
  }
  .hero .sobretitulo { animation-delay: 0.95s; }
  .hero-sub { animation-delay: 1.35s; }
  .hero-acoes { animation-delay: 1.5s; }
  .hero-numeros { animation-delay: 1.65s; }
  .hero-foto { animation: foto-entra 1.8s var(--ease-saida) 0.55s backwards; }
  /* Peças: GSAP move em x (transform); a entrada usa opacity + translate só durante a animação */
  .peca { animation: peca-entra 1.4s var(--ease-saida) backwards; }
  .peca-salmao { animation-delay: 1.15s; }
  .peca-wasabi { animation-delay: 1.3s; }
  .peca-gari { animation-delay: 1.4s; }
  .peca-shiso { animation-delay: 1.25s; }

  .hero-rolar::after { animation: rolar 2.4s var(--ease-io) 2.4s infinite; }
}
.motion .enso-traco { stroke-dashoffset: 0.86; }
@media (prefers-reduced-motion: no-preference) {
  .motion .enso-traco { animation: enso-entra 1.8s var(--ease-saida) 1s backwards; }
  .motion .enso-traco-fino { animation-delay: 1.15s; }
}

@keyframes linha-sobe { from { transform: translateY(108%); } }
@keyframes sobe-suave { from { opacity: 0; transform: translateY(18px); } }
@keyframes foto-entra { from { opacity: 0; transform: scale(1.06); } }
@keyframes peca-entra { from { opacity: 0; translate: 0 26px; } }
@keyframes enso-entra { from { stroke-dashoffset: 1; } }
@keyframes rolar {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============ REVELAÇÕES AO ROLAR (main.js marca .visto) ============ */
.motion .revela-linha > span { overflow: hidden; padding-bottom: 0.06em; }
.motion .revela-linha > span > .li {
  transform: translateY(108%);
  transition: transform 1.3s var(--ease-saida);
  transition-delay: calc(var(--l, 0) * 0.12s);
}
.motion .revela-linha.visto > span > .li { transform: none; }

.motion .prato,
.motion .avaliacao,
.motion .info-bloco,
.motion .faq-item,
.motion .etapa-texto {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease-saida), transform 1.2s var(--ease-saida), border-color 0.4s, box-shadow 0.6s var(--ease-saida);
  transition-delay: calc(var(--i, 0) * 0.08s);
}
.motion .prato.visto,
.motion .avaliacao.visto,
.motion .info-bloco.visto,
.motion .faq-item.visto,
.motion .etapa-texto.visto {
  opacity: 1;
  transform: none;
}
.motion .faq-item.visto, .motion .prato.visto { transition-delay: 0s; }
.motion .prato.visto { transition-delay: calc(var(--i, 0) * 0.07s); }
.motion .avaliacao:nth-child(2) { --i: 1; }
.motion .avaliacao:nth-child(3) { --i: 2; }
.motion .avaliacao:nth-child(4) { --i: 3; }
.motion .info-bloco:nth-child(2) { --i: 1; }
.motion .info-bloco:nth-child(3) { --i: 2; }

/* Resposta do FAQ: fade simples ao abrir */
@media (prefers-reduced-motion: no-preference) {
  .faq-item[open] .faq-resposta { animation: sobe-suave 0.7s var(--ease-saida); }
}

/* ============ PREFERS-REDUCED-MOTION: estático, só fades simples ============ */
@media (prefers-reduced-motion: reduce) {
  .shoji { animation: shoji-some 0.01s linear 0.7s forwards; }
  .shoji-esq, .shoji-dir { animation: some-fade 0.6s ease 0.1s forwards; }
  @keyframes some-fade { to { opacity: 0; } }

  .hero { height: auto; }
  .hero-palco { position: relative; height: auto; min-height: 100svh; }
  .etapa { position: relative; top: auto; }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .dialogo, .dialogo::backdrop { transition: opacity 0.25s ease !important; }
  .dialogo-item, .dialogo-bandeja, .dialogo-checkout { transform: none !important; }
}
