/* Movimento da Veionara: matéria, corda e ressonância. */
@keyframes bancada-camera {
  0% { transform: scale(1.055) translate3d(0, 0, 0); }
  100% { transform: scale(1) translate3d(-.35%, .15%, 0); }
}
@keyframes onda-resonante {
  0%, 100% { transform: scaleY(.78); opacity: .72; }
  50% { transform: scaleY(1); opacity: 1; }
}
@keyframes marca-escrita {
  0% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* 1. A câmera percorre a bancada devagar, como uma aproximação de observação. */
.motion-ready .hero-photo {
  animation: bancada-camera 15s cubic-bezier(.2,.55,.35,1) both;
  transform-origin: 58% 48%;
}

/* 2. A faixa da roseta recebe uma onda visual de ressonância, sem áudio automático. */
.resonance::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 100%;
  pointer-events: none;
  opacity: .9;
  background: url('assets/brand/onda-harmonicos.svg') center / 100% 100% no-repeat;
  transform-origin: center;
  animation: onda-resonante 4.8s ease-in-out infinite;
  filter: drop-shadow(0 0 2px var(--acid));
  mix-blend-mode: normal;
}

/* O lettering aparece como uma passada contínua, começando no símbolo. */
.motion-ready .site-header .brand img {
  clip-path: inset(0 100% 0 0);
  animation: marca-escrita 1.6s cubic-bezier(.65,0,.25,1) .12s both;
}

/* O botão responde como uma marca feita na madeira: assenta, desliza e volta. */
.button {
  transition: box-shadow .28s ease, transform .32s cubic-bezier(.2,.8,.2,1),
    background-color .28s ease, color .28s ease, border-color .28s ease;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #546026, 0 9px 22px rgba(0,0,0,.18);
}
.button:active {
  transform: translateY(2px) scale(.985);
  box-shadow: inset 0 2px 5px rgba(20,22,18,.22);
}
.button.outline:hover {
  box-shadow: inset 0 -2px 0 var(--acid);
}
.line-link::after,
.site-nav a::after {
  transform-origin: right;
  transition: transform .42s cubic-bezier(.2,.8,.2,1);
}
.line-link:hover::after,
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform-origin: left;
}

@media (max-width: 760px) {
  .motion-ready .hero-photo { animation-duration: 18s; }
}
@media (prefers-reduced-motion: reduce) {
  .motion-ready .hero-photo,
  .resonance::after,
  .motion-ready .site-header .brand img {
    animation: none !important;
    clip-path: none !important;
  }
  .button, .line-link::after, .site-nav a::after { transition: none !important; }
  .button:hover, .button:active { transform: none; box-shadow: none; }
}


/* Títulos entram em sequência, com uma oscilação curta que perde amplitude. */
@keyframes escrita-ressonante {
  0% { opacity: 0; filter: blur(1.5px); transform: translate3d(-1px, 6px, 0) rotate(-.35deg); }
  42% { opacity: 1; filter: blur(0); transform: translate3d(.7px, -2px, 0) rotate(.22deg); }
  68% { opacity: 1; transform: translate3d(-.4px, 1px, 0) rotate(-.1deg); }
  100% { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0) rotate(0); }
}
.motion-ready .title-motion .title-word {
  display: inline-block;
  white-space: nowrap;
}
.motion-ready .title-motion .title-char {
  display: inline-block;
  white-space: pre;
  animation: escrita-ressonante 480ms cubic-bezier(.2,.75,.25,1) both;
  animation-delay: calc(var(--char-index, 0) * 11ms);
  transform-origin: 50% 80%;
}
@media (prefers-reduced-motion: reduce) {
  .motion-ready .title-motion .title-char {
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}


/* A faixa da roseta revela o conjunto harmônico sem controles locais. */
.resonance-interface {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px max(24px, calc((100vw - 1328px) / 2));
  background: linear-gradient(90deg, rgba(20,22,18,.7), rgba(20,22,18,.08) 56%, rgba(20,22,18,.58));
}
.resonance-copy { display: grid; gap: 2px; max-width: min(48vw, 540px); text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.resonance-copy .eyebrow { margin: 0; font-size: 10px; }
.sound-status { color: var(--paper); font-size: 10px; line-height: 1.5; }
.resonance-caption { font-size: 9px; letter-spacing: .2em; color: var(--paper); text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.resonance.audio-active::after {
  animation: none;
  transform: scaleY(calc(.62 + var(--audio-level, 0) * .72));
  opacity: calc(.78 + var(--audio-level, 0) * .22);
  filter: drop-shadow(0 0 3px var(--acid)) drop-shadow(0 0 calc(var(--audio-level, 0) * 18px) var(--acid));
}
.sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 12px;
  font-size: 10px;
  white-space: nowrap;
}
.sound-toggle svg { width: 27px; height: 20px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle svg path:nth-child(2) { color: #c69b57; }
.sound-toggle svg path:nth-child(3) { color: var(--paper); }
.sound-toggle[aria-pressed="true"] { color: var(--acid); border-color: var(--acid); }
@keyframes marca-harmonica {
  0%, 100% { transform: translateY(0); opacity: .82; }
  50% { transform: translateY(-1.5px); opacity: 1; }
}
.sound-reactive .sound-toggle svg path {
  animation: marca-harmonica 620ms ease-in-out infinite;
}
.sound-reactive .sound-toggle svg path:nth-child(2) { animation-delay: 80ms; }
.sound-reactive .sound-toggle svg path:nth-child(3) { animation-delay: 145ms; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.sound-dialog {
  width: min(590px, calc(100vw - 36px));
  max-width: none;
  border: 1px solid rgba(212,231,108,.62);
  padding: clamp(28px, 5vw, 52px);
  background: radial-gradient(ellipse at 20% 0%, rgba(212,231,108,.09), transparent 52%), var(--ink);
  color: var(--paper);
  box-shadow: 0 30px 100px rgba(0,0,0,.68);
}
.sound-dialog[open] { animation: dialog-ressonance 420ms cubic-bezier(.2,.8,.2,1) both; }
.sound-dialog::backdrop { background: rgba(7,8,6,.78); backdrop-filter: blur(8px); }
.sound-dialog-mark { width: 106px; margin-bottom: 27px; color: var(--acid); }
.sound-dialog-mark svg { width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.sound-dialog-mark svg path:nth-child(2) { stroke: #c69b57; }
.sound-dialog-mark svg path:nth-child(3) { stroke: var(--paper); }
.sound-dialog .eyebrow { margin-bottom: 13px; }
.sound-dialog h2 { max-width: 470px; font-size: clamp(38px, 6vw, 59px); }
.sound-dialog p { margin-top: 22px; font-size: 13px; line-height: 1.75; color: var(--muted); }
.sound-dialog .sound-dialog-note { font-size: 11px; }
.sound-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 30px; }
.sound-dialog-dismiss { border: 0; border-bottom: 1px solid var(--acid); background: none; padding: 8px 0; color: var(--acid); cursor: pointer; font: inherit; }
@keyframes dialog-ressonance {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
main { transition: opacity .24s ease, transform .32s cubic-bezier(.2,.8,.2,1); }
main.route-loading { opacity: .18; transform: translateY(8px); }

@media (max-width: 760px) {
  .resonance { height: 156px; }
  .resonance-interface { padding: 16px 18px; }
  .resonance-copy { max-width: 58%; }
  .resonance-copy .eyebrow { font-size: 9px; letter-spacing: .1em; }
  .sound-status { max-width: 215px; font-size: 8px; }
  .resonance-caption { max-width: 38%; font-size: 7px; line-height: 1.8; text-align: right; }
  .sound-toggle { min-height: 38px; padding: 6px 9px; gap: 6px; font-size: 9px; }
  .sound-toggle svg { width: 23px; height: 18px; }
}
@media (max-width: 420px) {
  .sound-toggle { width: 38px; min-height: 38px; padding: 5px; }
  .sound-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .sound-dialog-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .resonance-interface { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .resonance.audio-active::after { animation: none !important; }
  .sound-reactive .sound-toggle svg path { animation: none !important; }
  .sound-dialog[open] { animation: none !important; }
  main { transition: none !important; }
}

/* O nível da guia alcança todo o site enquanto o documento único permanece aberto. */
.sound-reactive body > .site-header,
.sound-reactive body > main,
.sound-reactive body > .site-footer {
  filter: saturate(calc(1 + var(--sound-level, 0) * .32));
  transition: filter 140ms linear;
}
.sound-reactive .site-header::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: -1px;
  width: calc(7% + var(--sound-level, 0) * 93%);
  height: 2px;
  background: var(--acid);
  box-shadow: 0 0 calc(var(--sound-level, 0) * 18px) rgba(212,231,108,.62);
  pointer-events: none;
}
.sound-reactive .brand img {
  filter: drop-shadow(0 0 calc(var(--sound-level, 0) * 9px) rgba(212,231,108,.48));
  transform: translateY(calc((.5 - var(--sound-level, 0)) * 1.5px));
}
.sound-reactive main h1,
.sound-reactive main h2 {
  text-shadow: 0 0 calc(var(--sound-level, 0) * 12px) rgba(212,231,108,.38);
  transform: translateY(calc((.5 - var(--sound-level, 0)) * 1.6px));
}
@media (prefers-reduced-motion: reduce) {
  .sound-reactive body > .site-header,
  .sound-reactive body > main,
  .sound-reactive body > .site-footer { filter: none; transition: none; }
  .sound-reactive .site-header::after { display: none; }
  .sound-reactive .brand img,
  .sound-reactive main h1,
  .sound-reactive main h2 { filter: none; text-shadow: none; transform: none; }
}
