/* Sono Profundo · efeitos (par de efeitos.js)
   Usa só os tokens de styles.css: luar para dados, sálvia para meta atingida, âmbar para a navegação ativa.
   Carregue depois de styles.css. */

/* ---------------------------------------------------------------- 1. anel de eficiência */
.fx-ring { position: relative; display: inline-grid; place-items: center; width: var(--fx-s, 64px); height: var(--fx-s, 64px); flex-shrink: 0; }
.fx-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fx-ring circle { fill: none; }
.fx-ring-track { stroke: var(--line); }
.fx-ring-val { stroke: var(--moon); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.fx-ring.is-good .fx-ring-val { stroke: var(--good); }
.fx-ring-meta { stroke: var(--fg-2); stroke-width: 1.5; stroke-linecap: round; opacity: .7; }
.fx-ring-num { position: relative; font-family: var(--font-display); font-size: calc(var(--fx-s, 64px) * 0.28); font-weight: 500; font-variant-numeric: tabular-nums lining-nums; line-height: 1; }
.fx-ring.is-empty .fx-ring-num { color: var(--muted); }
/* linha com anel + texto, para o Início e o Progresso */
.fx-ring-row { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }

/* ---------------------------------------------------------------- 3. indicador da navegação */
#nav.fx-nav { position: relative; }
#nav.fx-nav a { z-index: 1; }
#nav.fx-nav a[aria-current="page"]::before { content: none; }
.fx-nav-ind { position: absolute; top: 0; left: 0; display: block; pointer-events: none; border-radius: 2px; background: var(--accent); will-change: transform; }
.fx-nav-ind.is-moving { transition: transform .32s cubic-bezier(.32, .72, 0, 1), width .32s cubic-bezier(.32, .72, 0, 1), height .32s cubic-bezier(.32, .72, 0, 1); }
/* computador: pílula de superfície atrás do link, com o traço âmbar à esquerda */
.fx-nav-ind.is-vertical { background: var(--surface); border-radius: var(--radius-sm); box-shadow: inset 2px 0 0 var(--accent); }
@media (min-width: 900px) { #nav.fx-nav a[aria-current="page"] { background: transparent; } }

/* ---------------------------------------------------------------- 4. saudação em desfoque */
.fx-word { display: inline-block; animation: fx-blur-in .9s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes fx-blur-in {
  from { opacity: 0; filter: blur(10px); transform: translateY(10px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* ---------------------------------------------------------------- 5. bordas da rolagem */
@property --fx-ft { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --fx-fb { syntax: '<length>'; inherits: false; initial-value: 0px; }
#view.fx-edges {
  --fx-ft: 0px;
  --fx-fb: 0px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fx-ft), #000 calc(100% - var(--fx-fb)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fx-ft), #000 calc(100% - var(--fx-fb)), transparent 100%);
  transition: --fx-ft var(--dur) var(--ease), --fx-fb var(--dur) var(--ease);
}
#view.fx-edges.fx-top { --fx-ft: calc(var(--safe-top) + 28px); }
#view.fx-edges.fx-bot { --fx-fb: 28px; }

/* ---------------------------------------------------------------- movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .fx-ring-val, .fx-nav-ind.is-moving, #view.fx-edges { transition: none; }
  .fx-word { animation: none; }
}
