/* ==========================================================================
   Velkyn 07 · camada comum de refino (base: Velkyn Hub)
   Carregada por ÚLTIMO em cada app (Cofre, Edda, Notas). Não muda estrutura,
   dados nem funções: só superfícies, luz, foco e movimento.
   Tema claro: classe .light (no html ou no body) ou data-theme="marfim".
   ========================================================================== */
:root {
  --v7-bronze: #DBB581;
  --v7-bronze-claro: #F0D3A6;
  --v7-gelo: #B1D7DD;
  --v7-luz: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 0 0 1px rgba(255, 255, 255, .012);
  --v7-luz-botao: inset 0 1px 0 rgba(255, 255, 255, .07);
  --v7-luz-primario: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 12px 28px -14px rgba(219, 181, 129, .75);
  --v7-holofote: rgba(219, 181, 129, .11);
  --v7-sombra: 0 24px 60px -26px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .22);
  --v7-foco: 0 0 0 4px rgba(219, 181, 129, .16);
  --v7-mola: cubic-bezier(.16, 1.18, .3, 1);
  --v7-suave: cubic-bezier(.2, .8, .2, 1);
  --v7-grao: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
:is(html.light, body.light, [data-theme="marfim"]) {
  --v7-bronze: #91663A;
  --v7-bronze-claro: #B58653;
  --v7-gelo: #2F6F7A;
  --v7-luz: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 2px rgba(35, 50, 58, .05);
  --v7-luz-botao: inset 0 1px 0 rgba(255, 255, 255, .8);
  --v7-luz-primario: inset 0 1px 0 rgba(255, 255, 255, .35), 0 12px 26px -14px rgba(145, 102, 58, .6);
  --v7-holofote: rgba(145, 102, 58, .08);
  --v7-sombra: 0 24px 60px -28px rgba(35, 50, 58, .36), 0 2px 8px rgba(35, 50, 58, .07);
  --v7-foco: 0 0 0 4px rgba(145, 102, 58, .16);
}

/* Grão quase invisível sobre o carvão (só no escuro) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 2147483000; pointer-events: none;
  background: var(--v7-grao) 0 0 / 160px repeat;
}
:is(html.light, body.light, [data-theme="marfim"]) body::after, body.light::after { background: none; }

/* Títulos mais firmes, rótulos editoriais espaçados */
h1, h2 { letter-spacing: -.026em; }
.eyebrow { letter-spacing: .2em; }

/* Botão principal: volume sutil e reflexo; secundários com aresta de luz */
button.primary, .primary { box-shadow: var(--v7-luz-primario); transition: transform 160ms var(--v7-suave), box-shadow 280ms var(--v7-suave), filter 280ms var(--v7-suave); }
button.primary:hover, .primary:hover { filter: brightness(1.05); }
button:active { transform: scale(.97); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--v7-gelo); outline-offset: 3px; }

/* Navegação lateral: ícone desliza e o ativo ganha brilho */
.nav-item { transition: background 280ms var(--v7-suave), color 280ms var(--v7-suave), transform 160ms var(--v7-suave); }
.nav-item svg, .nav-item .icon { transition: transform 280ms var(--v7-mola), filter 280ms var(--v7-suave); }
.nav-item:hover svg, .nav-item:hover .icon { transform: translateX(2px); }
:is(.nav-item.selected, .nav-item.active, .nav-item[aria-current="page"]) :is(svg, .icon) { filter: drop-shadow(0 0 6px rgba(219, 181, 129, .55)); }
.sidebar { position: relative; }

/* Cartões: aresta de luz, elevação ao passar e holofote que segue o cursor */
:is(.note-card, .playlist-card, .account-card, .settings-group, .setting-row, .gen-panel, .queue-item, .hub-banner, .hero) { box-shadow: var(--v7-luz); }
:is(.note-card, .playlist-card, .account-card:not(.selected)) { position: relative; isolation: isolate; transition: transform 280ms var(--v7-suave), box-shadow 280ms var(--v7-suave), border-color 280ms var(--v7-suave); }
:is(.note-card, .playlist-card, .account-card:not(.selected)):hover { transform: translateY(-2px); box-shadow: var(--v7-luz), var(--v7-sombra); }
:is(.note-card, .playlist-card, .account-card:not(.selected))::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; z-index: -1;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), var(--v7-holofote), transparent 62%);
  transition: opacity 280ms var(--v7-suave);
}
:is(.note-card, .playlist-card, .account-card:not(.selected)):hover::after { opacity: 1; }

/* Campos: foco com halo bronze */
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select):focus-visible {
  outline: none; box-shadow: var(--v7-foco); border-color: color-mix(in srgb, var(--v7-bronze) 60%, transparent);
}

/* Chips e filtros respondem com mola */
:is(.chip, .filter-chip, .gen-chip, .pill) { transition: background 280ms var(--v7-suave), color 280ms var(--v7-suave), border-color 280ms var(--v7-suave), transform 160ms var(--v7-mola); }
:is(.chip, .filter-chip, .gen-chip):active { transform: scale(.96); }

/* Diálogos: entram com escala suave e fundo desfocado (no celular cada app mantém o painel inferior) */
dialog[open] { animation: v7-dialogo 520ms var(--v7-mola); }
dialog::backdrop { backdrop-filter: blur(8px); }
@keyframes v7-dialogo { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* Aviso flutuante em vidro */
#toast, .toast { backdrop-filter: blur(18px); box-shadow: var(--v7-sombra); }

/* Rolagem discreta */
* { scrollbar-width: thin; scrollbar-color: rgba(127, 140, 145, .35) transparent; }

@media (prefers-reduced-motion: reduce) {
  dialog[open] { animation: none; }
  :is(.note-card, .playlist-card, .account-card)::after { display: none; }
  :is(.note-card, .playlist-card, .account-card):hover { transform: none; }
}

/* ===== Notas · extras do refino 07 ===== */
.hub-banner { position: relative; overflow: hidden; isolation: isolate; }
.hub-banner::after { content: ""; position: absolute; inset: -40%; z-index: -1; pointer-events: none; opacity: .5;
  background: conic-gradient(from 0deg at 76% 50%, transparent 0 20%, rgba(219, 181, 129, .14) 30%, transparent 45%, rgba(177, 215, 221, .07) 62%, transparent 75%);
  animation: v7-aurora 38s linear infinite; }
@keyframes v7-aurora { to { transform: rotate(360deg); } }
button.primary { position: relative; overflow: hidden; }
button.primary::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%); pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%); }
button.primary:hover::after { transform: translateX(120%); transition: transform 760ms cubic-bezier(.2, .8, .2, 1); }
.nav, .sidebar nav { position: relative; }
@media (prefers-reduced-motion: reduce) { .hub-banner::after { animation: none; } button.primary::after { display: none; } }
