/* ==========================================================================
   Ateliê da Escuta — camada de movimento (V13)
   Tudo aqui é decorativo e progressivo: o layout continua em style.css.
   · Faixas azuis com céu de pinceladas em canvas (versões desktop e celular)
   · Entradas, pinceladas, parallax e microinterações espalhadas pela página
   · prefers-reduced-motion desliga o movimento (o céu vira pintura estática)
   CSP-safe: nenhum estilo inline; valores dinâmicos chegam via CSS custom properties.
   ========================================================================== */

:root {
  --ease: cubic-bezier(.2, .75, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --star: #f1cf7a;
  --star-soft: #ffe9b0;
  --band-navy: #14283d;
  interpolate-size: allow-keywords;
}

/* ==========================================================================
   1. FAIXAS AZUIS — céu vivo
   ========================================================================== */
.constellation, .journey, .legal__hero { position: relative; isolation: isolate; overflow: hidden; }

/* Fundo da faixa um pouco mais aberto para a pintura respirar (antes era quase opaco) */
.constellation::before {
  background:
    linear-gradient(90deg, rgba(20, 40, 61, .9) 0%, rgba(20, 40, 61, .55) 48%, rgba(20, 40, 61, .4) 100%),
    url(../assets/images/vangogh-desktop.webp) center 45% / cover;
}
.journey { background: var(--band-navy); }
.journey::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(180deg, rgba(20, 40, 61, .88), rgba(20, 40, 61, .7) 50%, rgba(20, 40, 61, .9)),
    url(../assets/images/vangogh-desktop.webp) center / cover;
}
.legal__hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(90deg, rgba(20, 40, 61, .92), rgba(20, 40, 61, .55)), url(../assets/images/vangogh-desktop.webp) center / cover;
}
@media (max-width: 620px) {
  .constellation::before {
    background:
      linear-gradient(180deg, rgba(20, 40, 61, .78) 0%, rgba(20, 40, 61, .62) 40%, rgba(20, 40, 61, .72) 100%),
      url(../assets/images/vangogh-mobile.webp) center / cover;
  }
  .journey::before, .legal__hero::before {
    background: linear-gradient(180deg, rgba(20, 40, 61, .9), rgba(20, 40, 61, .72) 50%, rgba(20, 40, 61, .92)), url(../assets/images/vangogh-mobile.webp) center / cover;
  }
}

.band-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.band-sky__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s var(--ease); }
.band-sky__canvas.is-ready { opacity: 1; }
.band-sky__veil { position: absolute; inset: 0; }
/* véus de leitura: escurecem só onde há texto */
.constellation .band-sky__veil { background: radial-gradient(42% 70% at 18% 45%, rgba(12, 26, 44, .7), transparent 75%), linear-gradient(90deg, transparent 40%, rgba(12, 26, 44, .35)); }
.journey .band-sky__veil { background: linear-gradient(90deg, rgba(12, 26, 44, .15) 30%, rgba(12, 26, 44, .62) 55%, rgba(12, 26, 44, .7)); }
.legal__hero .band-sky__veil { background: linear-gradient(90deg, rgba(12, 26, 44, .65), transparent 75%); }
@media (max-width: 800px) {
  .constellation .band-sky__veil { background: linear-gradient(180deg, rgba(12, 26, 44, .4), rgba(12, 26, 44, .22) 30%, rgba(12, 26, 44, .4)); }
  .journey .band-sky__veil { background: linear-gradient(180deg, transparent 0 30%, rgba(12, 26, 44, .65) 45%, rgba(12, 26, 44, .7)); }
}
@media (min-width: 801px) and (hover: hover) {
  .band-sky::after {
    content: ''; position: absolute; inset: 0;
    background: url(../assets/textures/canvas-grain.webp); opacity: .14; mix-blend-mode: overlay;
  }
}
.constellation .star-card p, .constellation h2, .journey h2, .river__step { text-shadow: 0 1px 14px rgba(10, 20, 36, .55); }
.journey__grain { display: none; }

/* bordas pintadas: a faixa parece passada a pincel sobre o papel */
.band-edge {
  position: absolute; left: -2%; right: -2%; height: clamp(18px, 2.4vw, 30px); z-index: 1; pointer-events: none;
  background: var(--edge, var(--paper));
  -webkit-mask: url(../assets/textures/band-edge.svg) center / 100% 100% no-repeat;
  mask: url(../assets/textures/band-edge.svg) center / 100% 100% no-repeat;
}
.band-edge--top { top: -2px; }
.band-edge--bottom { bottom: -2px; transform: scale(-1, -1); }
.journey .band-edge--top { --edge: #eae6d9; }

/* ==========================================================================
   2. ENTRADAS AO ROLAR
   ========================================================================== */
.js .reveal { opacity: 0; translate: 0 32px; transition: opacity .9s var(--ease) var(--d, 0s), translate 1.1s var(--ease-out) var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; translate: 0 0; }
.js .reveal[data-reveal="brush"] {
  opacity: 1; translate: 0 0;
  -webkit-mask: url(../assets/textures/brush-wipe.svg) 100% 0 / 300% 100% no-repeat;
  mask: url(../assets/textures/brush-wipe.svg) 100% 0 / 300% 100% no-repeat;
  transition: -webkit-mask-position 1.7s var(--ease) var(--d, 0s), mask-position 1.7s var(--ease) var(--d, 0s);
}
.js .reveal[data-reveal="brush"].is-visible { -webkit-mask-position: 0 0; mask-position: 0 0; }
.js .reveal[data-reveal="brush"].reveal-done { -webkit-mask: none; mask: none; }

/* o traço do rótulo cresce quando a seção chega */
.js .reveal .eyebrow::before, .js .finale__inner .eyebrow::before { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1s var(--ease-out) .25s; }
.js .reveal.is-visible .eyebrow::before, .js .finale__inner.is-visible .eyebrow::before { transform: scaleX(1); }

/* palavras que sobem e desfocam (títulos com data-split) */
[data-split] .w { display: inline-block; }
.js [data-split] .w { opacity: 0; translate: 0 .42em; filter: blur(7px); }
.js [data-split].is-in .w {
  opacity: 1; translate: 0 0; filter: blur(0);
  transition: opacity .9s var(--ease) calc(var(--i) * 85ms + var(--base, .1s)),
              translate 1.1s var(--ease-out) calc(var(--i) * 85ms + var(--base, .1s)),
              filter .9s var(--ease) calc(var(--i) * 85ms + var(--base, .1s));
}

/* ==========================================================================
   3. HERO — abertura em sequência
   ========================================================================== */
.hero h1 em::after { clip-path: inset(0 0 0 0); }
.js .hero h1 em::after { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s var(--ease-out) 1.15s; }
.js .hero h1.is-in em::after { clip-path: inset(0 0 0 0); }

.plate { transform-style: preserve-3d; transition: transform .8s var(--ease-out); }
.plate.is-tilting { transition: transform .15s linear; transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)) rotate(3deg); }
.plate img { transition: scale 1.2s var(--ease-out); }
.plate:hover img { scale: 1.03; }
.plate picture { display: block; overflow: hidden; }

.registration { transition: letter-spacing .6s var(--ease); }
.portrait:hover .registration { letter-spacing: .24em; }

/* ==========================================================================
   4. VOCÊ NÃO ESTÁ SOZINHO — estrelas
   ========================================================================== */
.star-card { position: relative; border-top-color: transparent; transition: translate .5s var(--ease-out); }
.star-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, rgba(241, 207, 122, .8), rgba(255, 255, 255, .32) 40%, rgba(255, 255, 255, .25));
  transform-origin: 0 50%;
}
.js .star-card.reveal::before { transform: scaleX(0); transition: transform 1.2s var(--ease-out) calc(var(--d, 0s) + .2s); }
.js .star-card.reveal.is-visible::before { transform: scaleX(1); }
.star-card__star { display: inline-block; text-shadow: 0 0 12px rgba(241, 207, 122, .8); transition: rotate .8s var(--ease-out), scale .5s var(--ease-out); }
.star-card:hover { translate: 6px 0; }
.star-card:hover .star-card__star { rotate: 90deg; scale: 1.35; }

/* ==========================================================================
   5. SOBRE — selo, moldura e assinatura
   ========================================================================== */
.painted-frame picture { display: block; overflow: hidden; }
.painted-frame__img { translate: 0 var(--pi, 0px); scale: 1.12; }
@media (max-width: 620px) { .painted-frame__img { scale: 1.08; } }

.about__visual { position: sticky; }
.seal {
  position: absolute; right: -34px; bottom: -34px; z-index: 2;
  width: clamp(104px, 10vw, 136px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper);
  box-shadow: 0 14px 30px -16px rgba(25, 46, 64, .55), inset 0 0 0 1px rgba(136, 96, 36, .3);
}
.seal svg { position: absolute; inset: 7%; width: 86%; height: 86%; overflow: visible; }
.seal text { font: 600 14px DM, Arial, sans-serif; letter-spacing: .14em; fill: #7a5520; text-transform: uppercase; }
.seal img { width: 40%; height: auto; }
@media (max-width: 620px) { .seal { right: -8px; bottom: -26px; width: 96px; } .seal text { font-size: 15px; } }

.brush-underline { position: relative; display: inline-block; z-index: 0; }
.brush-underline::after {
  content: ''; position: absolute; left: -3%; right: -3%; bottom: .04em; height: .36em; z-index: -1;
  background: #e9c672; opacity: .7;
  -webkit-mask: url(../assets/textures/stroke-underline.svg) center / 100% 100% no-repeat;
  mask: url(../assets/textures/stroke-underline.svg) center / 100% 100% no-repeat;
  transform-origin: 0 50%;
}
.js .reveal .brush-underline::after { transform: scaleX(0); transition: transform 1.1s var(--ease-out) .5s; }
.js .reveal.is-visible .brush-underline::after { transform: scaleX(1); }

.credentials li { position: relative; border-top-color: transparent; }
.credentials li::before {
  content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--line);
  transform-origin: 0 50%;
}
.js .credentials.reveal li { opacity: 0; translate: 0 12px; transition: opacity .7s var(--ease), translate .9s var(--ease-out); }
.js .credentials.reveal li::before { transform: scaleX(0); transition: transform 1s var(--ease-out); }
.js .credentials.reveal.is-visible li { opacity: 1; translate: 0 0; }
.js .credentials.reveal.is-visible li::before { transform: scaleX(1); }
.js .credentials.reveal li:nth-child(2), .js .credentials.reveal li:nth-child(2)::before { transition-delay: .1s; }
.js .credentials.reveal li:nth-child(3), .js .credentials.reveal li:nth-child(3)::before { transition-delay: .2s; }
.js .credentials.reveal li:nth-child(4), .js .credentials.reveal li:nth-child(4)::before { transition-delay: .3s; }

.about__belief { position: relative; border-left-color: transparent; }
.about__belief::before {
  content: ''; position: absolute; left: -2px; top: 0; bottom: 0; width: 2px; background: #c7a75d;
  transform-origin: 50% 0;
}
.js .reveal .about__belief::before { transform: scaleY(0); transition: transform 1.4s var(--ease-out) .6s; }
.js .reveal.is-visible .about__belief::before { transform: scaleY(1); }

/* ==========================================================================
   6. ÁREAS — redemoinho e pinceladas
   ========================================================================== */
.palette { position: relative; isolation: isolate; overflow: hidden; }
.palette__swirl {
  position: absolute; right: -12vw; top: -10vw; z-index: -1;
  width: 48vw; max-width: 680px; aspect-ratio: 1; border-radius: 50%;
  translate: 0 var(--py, 0px);
  background:
    repeating-radial-gradient(circle, rgba(25, 47, 69, .07) 0 5px, transparent 5px 20px),
    radial-gradient(circle, rgba(233, 198, 114, .35), transparent 62%);
  -webkit-mask: radial-gradient(circle, #000 28%, transparent 70%);
  mask: radial-gradient(circle, #000 28%, transparent 70%);
}
.swatch { isolation: isolate; overflow: hidden; }
.swatch::before {
  content: ''; position: absolute; inset: 14% -4% 14% -2%; z-index: -1;
  background: linear-gradient(90deg, rgba(203, 216, 223, .75), rgba(203, 216, 223, .25) 70%, transparent);
  -webkit-mask: url(../assets/textures/stroke-underline.svg) center / 100% 100% no-repeat;
  mask: url(../assets/textures/stroke-underline.svg) center / 100% 100% no-repeat;
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .8s var(--ease-out);
}
.swatch:nth-child(3n+2)::before { background: linear-gradient(90deg, rgba(226, 205, 158, .8), rgba(226, 205, 158, .25) 70%, transparent); }
.swatch:nth-child(3n)::before { background: linear-gradient(90deg, rgba(199, 208, 185, .85), rgba(199, 208, 185, .25) 70%, transparent); }
.swatch:hover::before, .swatch.is-active::before { transform: scaleX(1); }
.swatch h3 { transition: translate .6s var(--ease-out); }
.swatch:hover h3, .swatch.is-active h3 { translate: 6px 0; }
.swatch__icon { transition: transform .6s var(--ease-out), border-radius .9s var(--ease); }

/* ==========================================================================
   7. COMO FUNCIONA — rio de luz
   ========================================================================== */
.journey__frame { overflow: hidden; }
.journey__frame picture { display: block; overflow: hidden; }
.journey__img { translate: 0 var(--pi, 0px); scale: 1.1; }

.river { position: relative; padding-left: 2.6rem; }
.river__path { position: absolute; left: 0; top: .9rem; bottom: 1.2rem; width: 1.6rem; padding: 0; border: 0; }
.river__path svg { width: 100%; height: 100%; overflow: visible; }
.river__bed, .river__flow { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.river__bed { stroke: rgba(255, 255, 255, .18); stroke-width: 1.5; }
.river__flow {
  stroke: var(--star); stroke-width: 2.2;
  stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--river, 1));
  filter: drop-shadow(0 0 5px rgba(241, 207, 122, .7));
}
.lantern { transition: color .6s, text-shadow .6s; }
.js .river__step .lantern { color: rgba(234, 201, 135, .45); }
.js .river__step.is-lit .lantern { color: #f6d891; text-shadow: 0 0 18px rgba(241, 207, 122, .85); }
.highlights li { transition: translate .5s var(--ease-out); }
.highlights li:hover { translate: 4px 0; }
.js .highlights.reveal li { opacity: 0; translate: 0 10px; transition: opacity .7s var(--ease), translate .8s var(--ease-out); }
.js .highlights.reveal.is-visible li { opacity: 1; translate: 0 0; }
.js .highlights.reveal li:nth-child(2) { transition-delay: .08s; }
.js .highlights.reveal li:nth-child(3) { transition-delay: .16s; }
.js .highlights.reveal li:nth-child(4) { transition-delay: .24s; }

/* ==========================================================================
   8. DÚVIDAS — abertura suave
   ========================================================================== */
.faq-q { transition: color .3s; }
.faq-q:hover { color: #355778; }
.faq-q__icon { display: inline-grid; place-items: center; width: 1.6rem; transition: rotate .5s var(--ease-out); }
.faq-item[open] .faq-q__icon { rotate: 180deg; }
.faq-item[open] .faq-a { animation: faq-in .55s var(--ease) both; }
@keyframes faq-in { from { opacity: 0; translate: 0 -6px; } }
@supports selector(::details-content) {
  .faq-item::details-content { block-size: 0; overflow-y: clip; transition: block-size .5s var(--ease), content-visibility .5s allow-discrete; }
  .faq-item[open]::details-content { block-size: auto; }
}
.safety { position: relative; overflow: hidden; }
.safety::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  translate: -100% 0;
}
.js .safety.reveal.is-visible::after { transition: translate 1.6s var(--ease) .6s; translate: 100% 0; }

/* ==========================================================================
   9. FINAL — Vamos conversar?
   ========================================================================== */
.finale { background-position: calc(-18vw + var(--fx, 0px)) center; }
@media (max-width: 620px) { .finale { background-position: calc(-47vw + var(--fx, 0px)) center; } }
.finale h2 .w--accent { color: #1f3d5c; }

/* ==========================================================================
   10. BOTÕES, NAV E DETALHES
   ========================================================================== */
.btn { position: relative; overflow: hidden; isolation: isolate; translate: var(--mx, 0px) var(--my, 0px); }
.btn::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 34%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-18deg) translateX(-140%);
  transition: transform .9s var(--ease-out);
}
.btn:hover::after { transform: skewX(-18deg) translateX(480%); }
.btn > svg { transition: rotate .5s var(--ease-out); }
.btn:hover > svg { rotate: -12deg; }

.nav a { position: relative; text-decoration: none; }
.nav a:hover { text-decoration: none; }
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 6px;
  background: #c79a45;
  -webkit-mask: url(../assets/textures/stroke-underline.svg) center / 100% 100% no-repeat;
  mask: url(../assets/textures/stroke-underline.svg) center / 100% 100% no-repeat;
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease-out);
}
.nav a:hover::after, .nav a.is-current::after { transform: scaleX(1); }
@media (max-width: 800px) { .js .nav.open a { animation: nav-in .5s var(--ease-out) both; } .js .nav.open a:nth-child(2) { animation-delay: .05s; } .js .nav.open a:nth-child(3) { animation-delay: .1s; } .js .nav.open a:nth-child(4) { animation-delay: .15s; } .js .nav.open a:nth-child(5) { animation-delay: .2s; } }
@keyframes nav-in { from { opacity: 0; translate: 0 -6px; } }

.footer-social-icon { transition: background-color .3s, color .3s, translate .5s var(--ease-out); }
.footer-social-icon:hover { background: var(--ink); color: var(--paper); translate: 0 -3px; }

.float-cta { transition: opacity .5s, translate .6s var(--ease-out), scale .4s var(--ease-out); }
.float-cta:hover { scale: 1.08; }
.js .float-cta:not(.is-shown) { opacity: 0; translate: 0 22px; pointer-events: none; }
.float-cta::before { content: ''; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; }

/* progresso de leitura também nos navegadores sem scroll-timeline */
@supports not (animation-timeline: scroll()) {
  .scroll-progress {
    position: fixed; inset: 0 0 auto; z-index: 5; height: 2px; background: #af8842;
    transform-origin: left; transform: scaleX(var(--progress, 0));
  }
}

/* ==========================================================================
   11. ANIMAÇÕES CONTÍNUAS (somente sem movimento reduzido)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .hero .eyebrow { animation: rise .9s var(--ease-out) .05s both; }
  .js .hero__intro { animation: rise 1s var(--ease-out) .75s both; }
  .js .hero .actions { animation: rise 1s var(--ease-out) .9s both; }
  .js .hero .plate { animation: plate-in 1.4s var(--ease-out) .35s both; }
  .js .hero .art { animation: art-in 1.8s var(--ease) .2s both; }
  .js .hero .registration { animation: fade 1.2s var(--ease) 1.3s both; }
  .js .hero .scroll-cue { animation: fade 1s var(--ease) 1.6s both, nudge 2.4s ease-in-out 2.6s infinite; }
  .sun { animation: sun-spin 80s linear infinite; }
  .seal svg { animation: spin 46s linear infinite; }
  .star-card__star { animation: twinkle 3.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.6s); }
  .swatch:hover .swatch__icon, .swatch.is-active .swatch__icon { animation: blob 3s ease-in-out infinite; }
  .float-cta.is-shown::before { animation: pulse 3.2s var(--ease) 1s infinite; }
  .js .journey__frame.reveal { rotate: -6deg; scale: .96; transition: -webkit-mask-position 1.7s var(--ease), mask-position 1.7s var(--ease), rotate 1.6s var(--ease-out), scale 1.6s var(--ease-out); }
  .js .journey__frame.reveal.is-visible { rotate: 0deg; scale: 1; }
}
@keyframes rise { from { opacity: 0; translate: 0 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes plate-in { from { opacity: 0; translate: 0 40px; rotate: 6deg; } }
@keyframes art-in {
  from { -webkit-mask: url(../assets/textures/brush-wipe.svg) 100% 0 / 300% 100% no-repeat; mask: url(../assets/textures/brush-wipe.svg) 100% 0 / 300% 100% no-repeat; }
  to { -webkit-mask: url(../assets/textures/brush-wipe.svg) 0 0 / 300% 100% no-repeat; mask: url(../assets/textures/brush-wipe.svg) 0 0 / 300% 100% no-repeat; }
}
@keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }
@keyframes sun-spin { to { rotate: 360deg; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: .55; scale: .88; } 50% { opacity: 1; scale: 1.18; } }
@keyframes blob { 0%, 100% { border-radius: 48% 56% 41% 53%; } 33% { border-radius: 58% 42% 55% 45%; } 66% { border-radius: 42% 58% 47% 53%; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(25, 47, 69, .45); } 70%, 100% { box-shadow: 0 0 0 16px rgba(25, 47, 69, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js .reveal, .js [data-split] .w, .js .credentials.reveal li, .js .highlights.reveal li { opacity: 1 !important; translate: none !important; filter: none !important; }
  .js .reveal[data-reveal="brush"] { -webkit-mask: none; mask: none; }
  .painted-frame__img, .journey__img, .palette__swirl, .btn { translate: none !important; }
  .river__flow { stroke-dashoffset: 0; }
  .js .river__step .lantern { color: #eac987; }
}

/* transição entre a página inicial e a de privacidade */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .4s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; filter: blur(5px); } }
@keyframes vt-in { from { opacity: 0; filter: blur(5px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
