/* Kabala · preto quente com um único dourado (estrutura da referência ciridae, clima do reel Tecnomagia) */
:root {
  --void: #0b0907;
  --abismo: #070605;
  --superficie: #14110d;
  --superficie-2: #1b1712;
  --fio: rgba(216, 176, 98, 0.16);
  --fio-forte: rgba(216, 176, 98, 0.42);
  --ouro: #d8b062;
  --ouro-vivo: #f1d08a;
  --ouro-fundo: rgba(216, 176, 98, 0.08);
  --osso: #efe7d6;
  --cinza: #a99e88;
  --cinza-2: #7d7465;
  --brasa: #e07a4b;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --corpo: 'Barlow', 'Helvetica Neue', sans-serif;
  --hebraico: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --numeral: 'Cinzel', 'Cormorant Garamond', serif;
  --raio: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--osso);
  font: 400 1rem/1.55 var(--corpo);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--ouro); color: var(--void); }
input, button { font: inherit; color: inherit; }
input { caret-color: var(--ouro); }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
:focus-visible { outline: 1.5px solid var(--ouro); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: #3a3125 var(--void); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: #3a3125; border-radius: 10px; border: 2px solid var(--void); }
img, svg { display: block; }
.num { font-family: var(--numeral) !important; font-style: normal !important; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(11, 9, 7, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--fio);
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ouro); }
.marca span { font: 500 1.45rem/1 var(--serif); letter-spacing: 0.02em; color: var(--osso); }
.logo-arvore { width: 16px; height: 28px; }
.menu { display: flex; gap: 4px; margin-left: auto; }
.menu a {
  font: 500 0.82rem/1 var(--cond); letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; color: var(--cinza);
  padding: 9px 14px; border: 1px solid transparent; border-radius: 999px;
  transition: color 0.25s, border-color 0.25s;
}
.menu a:hover { color: var(--osso); }
.menu a.ativo { color: var(--ouro); border-color: var(--fio-forte); }
.quem {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid var(--fio); border-radius: 999px;
  padding: 5px 5px 5px 14px; cursor: pointer;
  font: 500 0.82rem/1 var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--osso);
  transition: border-color 0.25s;
}
.quem:hover { border-color: var(--fio-forte); }
.quem b {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--ouro); color: var(--ouro); font: 500 0.8rem/1 var(--numeral);
}
.troca {
  position: absolute; right: clamp(16px, 4vw, 48px); top: calc(100% + 8px);
  width: min(300px, calc(100vw - 32px));
  background: var(--superficie); border: 1px solid var(--fio-forte); border-radius: var(--raio);
  padding: 18px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  animation: surge 0.35s var(--ease);
}
.troca-nome { font: 500 1.35rem/1.15 var(--serif); margin: 4px 0 2px; }
.troca-data { color: var(--cinza); margin: 0 0 14px; font-size: 0.92rem; }
@keyframes surge { from { opacity: 0; transform: translateY(-6px); filter: blur(4px); } }

/* ---------- tipografia ---------- */
.rotulo {
  display: block; margin: 0;
  font: 500 0.78rem/1.2 var(--cond); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cinza);
}
.titulo-grande {
  font: 400 clamp(2.5rem, 1.1rem + 4.2vw, 5.2rem)/1.06 var(--serif);
  letter-spacing: -0.02em; margin: 0; text-wrap: balance;
}
.titulo-grande em { font-style: italic; color: var(--ouro); }
.titulo-sec {
  font: 400 clamp(1.9rem, 1.2rem + 2vw, 3rem)/1.1 var(--serif);
  letter-spacing: -0.015em; margin: 0; text-wrap: balance;
}
.titulo-sec em { font-style: italic; color: var(--ouro); }
.linha-fina { color: var(--cinza); font-size: 1.05rem; max-width: 46ch; margin: 0; text-wrap: pretty; }
.he { font-family: var(--hebraico); direction: rtl; unicode-bidi: isolate; }

/* ---------- botões e campos ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border-radius: 999px; cursor: pointer;
  font: 500 0.88rem/1 var(--cond); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
  transition: background 0.3s var(--ease), color 0.3s, border-color 0.3s, transform 0.2s;
}
.botao:active { transform: scale(0.98); }
.botao.ouro { background: var(--ouro); color: var(--void); border: 1px solid var(--ouro); }
.botao.ouro:hover { background: var(--ouro-vivo); border-color: var(--ouro-vivo); }
.botao.fantasma { background: transparent; color: var(--osso); border: 1px solid var(--fio-forte); }
.botao.fantasma:hover { border-color: var(--ouro); color: var(--ouro); }
.botao[disabled] { opacity: 0.45; cursor: not-allowed; }
.botao svg { width: 16px; height: 16px; }

.entrada { display: grid; grid-template-columns: 1fr 190px auto; gap: 12px; align-items: end; }
.campo { display: grid; gap: 8px; }
.campo input {
  width: 100%; min-height: 52px; padding: 0 18px;
  background: var(--superficie); border: 1px solid var(--fio-forte); border-radius: 12px;
  font: 400 1.1rem/1 var(--corpo); color: var(--osso);
  transition: border-color 0.25s, background 0.25s;
}
.campo input::placeholder { color: var(--cinza-2); }
.campo input:hover { border-color: rgba(216, 176, 98, 0.6); }
.campo input:focus { outline: none; border-color: var(--ouro); background: var(--superficie-2); }
.campo input[type='date']::-webkit-calendar-picker-indicator { filter: invert(78%) sepia(30%) saturate(600%) hue-rotate(0deg); cursor: pointer; }
.erro { grid-column: 1 / -1; margin: 0; color: var(--brasa); font-size: 0.95rem; }

/* ---------- estrutura ---------- */
.pagina { width: min(1240px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 120px; }
.secao { padding-top: clamp(72px, 9vw, 120px); }
.cab-secao { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: 36px; }
.cab-secao .linha-fina { max-width: 40ch; }
.painel-caixa { background: var(--superficie); border: 1px solid var(--fio); border-radius: var(--raio); padding: clamp(20px, 2.4vw, 32px); }

/* ---------- vazio (sem perfil) ---------- */
.vazio { min-height: calc(100vh - 70px); display: grid; align-content: center; gap: 28px; max-width: 860px; }

/* ---------- letras do nome ---------- */
.fita { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.fita .palavra { display: flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.letra {
  display: grid; justify-items: center; gap: 4px; min-width: 34px; padding: 10px 4px 8px;
  border-radius: 10px; border: 1px solid transparent;
  animation: letraEntra 0.6s var(--ease) both;
}
.letra .l-he { font: 400 1.7rem/1 var(--hebraico); color: var(--ouro); text-shadow: 0 0 18px rgba(216, 176, 98, 0.35); }
.letra .l-la { font: 500 0.82rem/1 var(--cond); letter-spacing: 0.1em; color: var(--cinza); }
.letra .l-n { font: 500 1.15rem/1 var(--serif); color: var(--osso); font-variant-numeric: lining-nums; }
.letra.vogal .l-la { color: var(--ouro); }
.letra.seq { border-color: rgba(224, 122, 75, 0.55); }
@keyframes letraEntra { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } }

/* ---------- círculo de número ---------- */
.circulo {
  position: relative; display: grid; place-items: center; text-align: center;
  width: var(--d, 180px); aspect-ratio: 1; border-radius: 50%;
}
.circulo svg.aro { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.circulo .aro circle { fill: none; stroke: var(--ouro); stroke-width: 0.7; }
.circulo .aro .aro-fundo { stroke: var(--fio); }
.circulo .aro .aro-traco { stroke-dasharray: 316; stroke-dashoffset: 316; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.4s var(--ease); }
.circulo.ligado .aro .aro-traco { stroke-dashoffset: 0; }
.circulo .c-n { font: 400 calc(var(--d, 180px) * 0.3)/1 var(--serif); color: var(--ouro); font-variant-numeric: lining-nums; }
.circulo .c-r { font: 500 0.74rem/1.1 var(--cond); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cinza); margin-top: 6px; }

/* ---------- árvore ---------- */
.arvore { width: 100%; height: auto; overflow: visible; }
.arvore .caminho { stroke: var(--fio-forte); stroke-width: 1; vector-effect: non-scaling-stroke; }
.arvore .sefira .halo { fill: none; stroke: none; }
.arvore .sefira .no { fill: var(--void); stroke: var(--fio-forte); stroke-width: 1; vector-effect: non-scaling-stroke; transition: fill 0.4s, stroke 0.4s; }
.arvore .sefira.oculta .no { stroke-dasharray: 3 3; }
.arvore .sefira-he { font: 400 9px/1 var(--hebraico); fill: var(--cinza); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.arvore .sefira-nome { font: 500 9.5px/1 var(--cond); letter-spacing: 0.1em; text-transform: uppercase; fill: var(--cinza-2); text-anchor: middle; }
.arvore .sefira.acesa .no { stroke: var(--ouro); }
.arvore .sefira.acesa .sefira-he { fill: var(--ouro); }
.arvore .sefira.acesa .sefira-nome { fill: var(--osso); }
.arvore .sefira.destino .no { fill: var(--ouro); }
.arvore .sefira.destino .sefira-he { fill: var(--void); }
.arvore .sefira.destino .halo { stroke: rgba(216, 176, 98, 0.25); stroke-width: 1; }
.arvore .anel { fill: none; stroke: var(--ouro); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.arvore .ponto { fill: var(--ouro-vivo); stroke: var(--void); stroke-width: 1.5; }
.arvore [role='button'] { cursor: pointer; outline: none; }
.arvore [role='button']:hover .no, .arvore [role='button']:focus-visible .no { stroke: var(--ouro-vivo); }
.arvore [role='button'].sel .halo { stroke: var(--ouro); stroke-width: 1; }
.desenha .caminho { stroke-dasharray: 260; stroke-dashoffset: 260; animation: traca 1.6s var(--ease) forwards; animation-delay: calc(var(--i) * 45ms); }
.desenha .sefira { animation: acende 0.8s var(--ease) both; animation-delay: 0.5s; }
@keyframes traca { to { stroke-dashoffset: 0; } }
@keyframes acende { from { opacity: 0; } }

/* ---------- chips e listas ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--fio-forte); font: 500 0.8rem/1 var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--osso);
}
.chip.ouro { border-color: var(--ouro); color: var(--ouro); }
.chip.brasa { border-color: rgba(224, 122, 75, 0.6); color: var(--brasa); }
.lista-linhas { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.lista-linhas li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--fio); font-size: 0.98rem; }
.lista-linhas li:first-child { border-top: 0; }
.lista-linhas svg { width: 16px; height: 16px; margin-top: 4px; color: var(--ouro); }
.lista-linhas.evita svg { color: var(--brasa); }

/* ---------- barra de nota ---------- */
.medidor { position: relative; height: 4px; background: var(--fio); border-radius: 4px; overflow: hidden; }
.medidor i { position: absolute; inset: 0; background: var(--ouro); border-radius: 4px; transform-origin: left; transform: scaleX(calc(var(--v) / 100)); animation: enche 1s var(--ease) both; }
@keyframes enche { from { transform: scaleX(0); } }
.medidor.baixo i { background: var(--brasa); }

.rodape { border-top: 1px solid var(--fio); padding: 28px clamp(16px, 4vw, 48px); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--cinza-2); font-size: 0.85rem; }
.rodape a { color: var(--cinza); }

.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 860px) {
  .fita { gap: 8px 14px; }
  .letra { min-width: 27px; padding: 8px 2px 6px; }
  .letra .l-he { font-size: 1.35rem; }
  .letra .l-n { font-size: 0.95rem; }
  .entrada { grid-template-columns: 1fr; }
  .entrada .botao { width: 100%; }
  .topo { gap: 12px; padding-block: 10px; flex-wrap: wrap; }
  .menu { order: 3; width: 100%; margin: 0 -4px; overflow-x: auto; scrollbar-width: none; }
  .menu::-webkit-scrollbar { display: none; }
  .quem { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .desenha .caminho { stroke-dashoffset: 0; }
}
