/* RR Vinhos — motion system
   Ideia central: "a taça enchendo" — imagens se revelam de baixo para cima,
   como vinho subindo no copo; o resto entra com calma, sem pirotecnia. */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-reveal: 1s;
  --dur-pour: 1.4s;
}

/* ---------- Micro-interações (sempre ativas, curtas) ---------- */
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease-out);
}
.btn--wine::before { background: var(--wine-deep); }
.btn--ghost::before, .btn--ghost-paper::before { background: rgba(255,255,255,.14); }
.btn--paper::before { background: #fff; }
.btn:active { transform: scale(.98); }
.btn { transition: transform .15s ease; }

.link-arrow .arrow { display: inline-block; transition: transform .4s var(--ease-out); }

.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--wine); transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}

.card__media img, .event__media img, .trio__item img, .split__media img, .cta__media img {
  transition: transform 1.2s var(--ease-out);
}

@media (hover: hover) {
  .btn:hover::before { transform: scaleX(1); transform-origin: left; }
  .link-arrow:hover .arrow { transform: translateX(6px); }
  .nav a:hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); transform-origin: left; }
  .card:hover .card__media img,
  .event:hover .event__media img,
  .trio__item:hover img { transform: scale(1.06); }
  .depo__media:hover img { filter: grayscale(.2) contrast(1.05); }
  .depo__media img { transition: filter .8s ease; }
  a:hover { color: var(--wine-deep); }
  .footer-col a:hover { color: var(--wine); }
}
.nav a[aria-current="true"]::after { transform: scaleX(1); }

/* Header: sombra ao rolar; no celular some ao descer e volta ao subir */
.site-header { transition: transform .45s var(--ease-out), box-shadow .3s ease, background-color .3s ease; }
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(42,29,24,.08); }
@media (max-width: 899px) {
  .site-header.is-hidden { transform: translateY(-100%); }
}

/* Barra de progresso de leitura (cor do vinho) */
.progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--wine); transform-origin: left; transform: scaleX(var(--progress, 0));
}

/* Burger -> X */
.burger span { transition: transform .4s var(--ease-out), opacity .2s ease, top .4s var(--ease-out); }
.burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* FAB */
.fab { transition: transform .5s var(--ease-out), opacity .3s ease; }
.fab:not(.is-visible) { transform: translateY(24px) scale(.8); opacity: 0; pointer-events: none; }

/* ---------- Animações de entrada (somente com JS e sem "reduzir movimento") ---------- */
@media (prefers-reduced-motion: no-preference) {

  /* Hero: Ken Burns lento + texto em cascata + "Vinhos" escrito à mão */
  .js .hero__media img { animation: kenburns 9s var(--ease-out) both; }
  .js .hero [data-hero] {
    opacity: 0; transform: translateY(18px);
    animation: rise 1.1s var(--ease-out) forwards;
    animation-delay: calc(.25s + var(--i, 0) * .14s);
  }
  .js .hero__title .script {
    clip-path: inset(-20% 100% -20% 0);
    animation: write 1.6s var(--ease-in-out) .75s forwards;
  }
  .js .hero__scroll::after { animation: drip 2.4s var(--ease-in-out) 2s infinite; }

  /* Revelação genérica */
  .js [data-reveal] {
    opacity: 0; transform: translateY(28px);
    transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
    transition-delay: calc(var(--i, 0) * 110ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  /* "Pour": imagem sobe como vinho na taça */
  .js [data-pour] { overflow: hidden; clip-path: inset(100% 0 0 0); transition: clip-path var(--dur-pour) var(--ease-in-out); transition-delay: calc(var(--i, 0) * 120ms); }
  .js [data-pour] img { transform: scale(1.18); transition: transform 1.8s var(--ease-out); transition-delay: calc(var(--i, 0) * 120ms); }
  .js [data-pour].is-in { clip-path: inset(0 0 0 0); }
  .js [data-pour].is-in img { transform: scale(1); }

  /* Linhas decorativas que se desenham */
  .js [data-line] { transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease-out) .2s; }
  .js [data-line].is-in { transform: scaleX(1); }
  .js .ticks[data-reveal] li::before { transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease-out); }
  .js .ticks[data-reveal].is-in li::before { transform: scaleX(1); }
  .js .ticks[data-reveal].is-in li:nth-child(2)::before { transition-delay: .12s; }
  .js .ticks[data-reveal].is-in li:nth-child(3)::before { transition-delay: .24s; }

  .js [data-seal] { box-shadow: none; transition: box-shadow 1s ease .9s; }
  .js [data-seal].is-in { box-shadow: 0 24px 48px rgba(42,29,24,.18); }

  /* Selo gira levemente ao entrar */
  .js .seal { opacity: 0; transform: rotate(-90deg) scale(.6); transition: transform 1.2s var(--ease-out) .5s, opacity .6s ease .5s; }
  .js .is-in .seal { opacity: 1; transform: none; }

  /* Menu mobile: links entram em cascata */
  .menu.is-open { animation: fade .35s ease both; }
  .menu.is-open .menu__links li, .menu.is-open .menu__foot {
    animation: rise .7s var(--ease-out) both;
    animation-delay: calc(.06s + var(--i, 0) * .06s);
  }

  /* Paralaxe sutil nas palavras-fantasma (CSS scroll-driven, quando suportado) */
  @supports (animation-timeline: view()) {
    .signature__ghost--top { animation: drift-left linear both; animation-timeline: view(); }
    .signature__ghost--bottom { animation: drift-right linear both; animation-timeline: view(); }
  }
}

@keyframes kenburns { from { transform: scale(1.14); } to { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes write { to { clip-path: inset(-20% -10% -20% 0); } }
@keyframes drip {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(200%); }
}
@keyframes drift-left { from { transform: translateX(6%); } to { transform: translateX(-6%); } }
@keyframes drift-right { from { transform: translateX(-8%); } to { transform: translateX(4%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
