/* notes-demo.css: a demonstração "depois da chamada" da home (#notes). Uma
 * janela de notas recebe três anotações soltas enquanto a chamada é transcrita,
 * o botão gera as notas e uma faixa desce reescrevendo tudo em blocos. Ao lado,
 * a chamada flutua com duas câmeras de verdade (Pexels, ver midia/call/).
 *
 * O estado mora em `data-phase` na janela: rough, generate, enhancing e
 * enhanced. O HTML já nasce em enhanced, então sem JavaScript, ou com menos
 * movimento pedido, a página mostra as notas prontas. A janela usa só tokens do
 * estilo.css; o fundo é uma ilustração (raios girando devagar sob uma retícula),
 * igual nos dois temas, com as cores da marca declaradas aqui.
 */
.notes-section {
  --notes-art-ink: #23251C; /* fq-ignore: cor da ilustração, igual nos dois temas */
  --notes-art-lime: #C9D45C; /* fq-ignore: cor da ilustração */
  --notes-art-olive: #8E9A4E; /* fq-ignore: cor da ilustração */
  --notes-art-clay: #D9865B; /* fq-ignore: cor da ilustração */
  display: grid;
  gap: 48px;
}

.notes-stage {
  position: relative;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 56px) clamp(16px, 13vw, 160px) clamp(20px, 5vw, 56px) clamp(16px, 5vw, 56px);
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  background: var(--notes-art-ink);
}
/* Os raios: um leque de listras que gira devagar atrás da janela. */
.notes-stage::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -60% -40%;
  background: repeating-conic-gradient(from 0deg at 68% 50%,
    var(--notes-art-lime) 0 5deg, var(--notes-art-ink) 5deg 9deg,
    var(--notes-art-clay) 9deg 12deg, var(--notes-art-ink) 12deg 17deg,
    var(--notes-art-olive) 17deg 23deg, var(--notes-art-ink) 23deg 27deg);
  animation: notes-rays 120s linear infinite;
}
/* A retícula: pontos escuros que somem perto do centro e apagam as bordas. */
.notes-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, var(--notes-art-lime) 0 10%, transparent 10%),
    radial-gradient(circle, var(--notes-art-ink) 1.2px, transparent 1.8px) 0 0 / 6px 6px;
  -webkit-mask: radial-gradient(120% 90% at 72% 45%, transparent 18%, var(--notes-art-ink) 62%);
  mask: radial-gradient(120% 90% at 72% 45%, transparent 18%, var(--notes-art-ink) 62%);
}

.notes-window {
  position: relative;
  min-height: 552px;
  padding: 16px clamp(20px, 4vw, 32px) 96px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  box-shadow: var(--shadow-window);
}
.notes-traffic { display: flex; gap: 6px; margin-bottom: 24px; }
.notes-traffic i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.notes-title { font-family: var(--font-display); font-size: clamp(22px, 3vw, 28px); font-weight: 500; margin: 0; }
.notes-meta { display: flex; gap: 8px; margin: 12px 0 24px; }
.notes-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 12px; color: var(--text-subtle);
}
.notes-chip svg { width: 13px; height: 13px; }
.notes-chip-icon { padding: 4px; border-radius: 50%; }

.notes-body { display: grid; gap: 12px; font-size: 14px; line-height: 1.55; }
.notes-block { display: grid; gap: 4px; }
.notes-block + .notes-block { margin-top: 12px; }
.notes-block h4 { margin: 0; font-size: 14px; font-weight: 600; }
.notes-block ul { margin: 0; padding-left: 20px; list-style: disc; }
.notes-block li { color: var(--text-muted); }
.notes-block li + li { margin-top: 2px; }
.notes-block li::marker { color: var(--text-subtle); }
.notes-block .notes-sub { margin-left: 16px; list-style-type: circle; color: var(--text-subtle); }
.notes-rough { display: grid; gap: 8px; }
.notes-rough-line { margin: 0; min-height: 1.55em; color: var(--text); transition: opacity .35s ease, translate .35s ease; }
.notes-source { display: none; }
.notes-typed.is-typing::after { content: ""; display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: var(--accent); }

/* A faixa que desce: fica no fluxo, logo abaixo do último bloco que já chegou. */
.notes-enhancing {
  display: flex; align-items: center; gap: 8px; margin: 0 -12px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-raised);
  box-shadow: var(--shadow-window);
  font-size: 13px; color: var(--text-subtle);
  animation: notes-bar-in .4s cubic-bezier(.16, 1, .3, 1) both;
}
/* O texto da faixa brilha da esquerda para a direita enquanto as notas nascem. */
.notes-enhancing > span:last-child {
  color: transparent;
  background: linear-gradient(90deg, var(--text-subtle) 0 30%, var(--accent) 42%, var(--notes-art-clay) 52%, var(--text-subtle) 66%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: notes-shimmer 1.8s linear infinite;
}
.notes-spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: notes-spin .8s linear infinite;
}

/* O texto chega com a ponta verde e assenta na cor do corpo. */
.notes-block.is-fresh :is(h4, li) {
  color: transparent;
  background-image: linear-gradient(90deg, var(--text) 0 38%, var(--accent) 50%, var(--notes-art-clay) 58%, var(--band-accent) 66%, transparent 78%);
  background-size: 270% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: notes-ink 1.1s cubic-bezier(.4, 0, .2, 1) both;
}

/* O pé da janela troca de peça a cada fase, sempre no mesmo lugar. */
.notes-dock { position: absolute; left: 0; right: 0; bottom: 20px; display: grid; justify-items: center; }
.notes-dock > * { grid-area: 1 / 1; transition: opacity .3s ease, scale .3s ease; opacity: 0; scale: .96; pointer-events: none; }
.notes-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-raised);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-soft);
}
.notes-pill .wave i { background: var(--accent); }
.notes-generate { background: var(--accent-fill); color: var(--accent-fill-text); border-color: transparent; }
.notes-generate svg { width: 14px; height: 14px; }
.notes-generate.is-pressed { scale: .93; }

[data-phase="rough"] .notes-transcribing,
[data-phase="generate"] .notes-generate,
[data-phase="enhanced"] .notes-switch { opacity: 1; scale: 1; }
[data-phase="rough"] :is(.notes-enhanced, .notes-enhancing),
[data-phase="generate"] :is(.notes-enhanced, .notes-enhancing),
[data-phase="enhanced"] :is(.notes-enhancing, .notes-rough),
[data-phase="enhancing"] .notes-block:not(.is-shown),
.notes-rough-line.is-consumed { display: none; }

/* A chamada flutua no canto de baixo, metade por cima da janela, como no Mac. */
.call-float {
  position: absolute;
  right: clamp(16px, 7vw, 88px);
  bottom: clamp(24px, 6vw, 56px);
  width: clamp(96px, 16vw, 160px);
  display: grid; gap: 6px; padding: 6px;
  border-radius: 16px; background: var(--band);
  box-shadow: var(--shadow-window);
}
.call-tile {
  width: 100%; aspect-ratio: 8 / 9; object-fit: cover; border-radius: 10px; background: var(--band-raised); display: block;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow .4s ease;
}
/* Quem fala ganha o contorno verde; o notes-demo.js reveza entre as duas câmeras. */
.call-tile.is-speaking { box-shadow: 0 0 0 2px var(--accent-fill); }
.call-controls { display: flex; justify-content: center; gap: 8px; padding: 4px 0 2px; }
.call-controls i {
  display: grid; place-items: center;
  width: 28px; height: 20px; border-radius: 6px;
  background: var(--band-raised); border: 1px solid var(--band-border); color: var(--band-text);
}
.call-controls svg { width: 12px; height: 12px; }
.call-controls .call-end { background: #C8463C; border-color: transparent; color: #FFFFFF; } /* fq-ignore: o vermelho universal de encerrar chamada */
.call-controls .call-end svg { rotate: 135deg; }
.js .notes-stage.reveal .call-float { opacity: 0; }
.js .notes-stage.reveal.visivel .call-float { animation: call-slide-in .9s cubic-bezier(.16, 1, .3, 1) .35s both; }

@keyframes notes-spin { to { rotate: 360deg; } }
@keyframes notes-rays { to { rotate: 360deg; } }
@keyframes notes-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes notes-bar-in { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }
@keyframes call-slide-in { from { opacity: 0; translate: 32px 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes notes-ink { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (max-width: 760px) {
  .notes-stage { padding: 16px 16px 128px; }
  .notes-window { min-height: 608px; }
  .call-float { bottom: 16px; right: 16px; grid-template-columns: 1fr 1fr; width: 176px; }
  .call-controls { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .notes-spinner, .notes-block.is-fresh :is(h4, li), .notes-stage::before,
  .notes-enhancing, .notes-enhancing > span:last-child, .js .notes-stage.reveal.visivel .call-float { animation: none; }
  .js .notes-stage.reveal .call-float { opacity: 1; }
  .notes-enhancing > span:last-child { color: var(--text-subtle); background: none; }
  .notes-dock > * { transition: none; }
}
