/* ==========================================================================
   AlfaLINKS — tema escuro premium
   Tudo é controlado pelas variáveis abaixo. Troque os valores de :root
   para mudar cores, raios e sombras do site inteiro.
   ========================================================================== */

:root {
  /* Cores ------------------------------------------------------------- */
  --bg: #06070b;
  --bg-soft: #0b0d14;
  --text: #f3f5f9;
  --muted: #99a1b4;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --surface: rgba(255, 255, 255, .045);
  --surface-hi: rgba(255, 255, 255, .085);

  /* Paleta de destaque (também usada nos orbes de fundo) */
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #ff5c8a;

  /* Formas e sombras --------------------------------------------------- */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --ring: 3px;

  --shadow-sm: 0 6px 20px -10px rgba(0, 0, 0, .9);
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .95);
  --shadow-lg: 0 30px 70px -28px rgba(0, 0, 0, .95);
  --glow:
    0 0 0 1px rgba(255, 255, 255, .06),
    0 18px 50px -18px color-mix(in srgb, var(--accent) 55%, transparent);

  /* Medidas ------------------------------------------------------------ */
  --max-w: 40rem;
  --gutter: clamp(1.1rem, 4vw, 1.75rem);

  /* Movimento ---------------------------------------------------------- */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .38s;
}

/* Reset enxuto ---------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden; /* nunca deve existir scroll horizontal */
  overflow-x: clip;    /* navegador moderno: não cria área de rolagem */
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(.95rem, .9rem + .2vw, 1.02rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, i {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

button, a { -webkit-tap-highlight-color: transparent; }

::selection {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  color: #fff;
}

/* Acessibilidade -------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: 50%;
  z-index: 100;
  padding: .6rem 1.1rem;
  background: var(--accent);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  transform: translate(-50%, -220%);
  transition: transform .25s var(--ease);
}

.skip-link:focus-visible { transform: translate(-50%, 0); }

/* ==========================================================================
   Fundo decorativo
   ========================================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #10131d 0%, var(--bg) 60%),
    var(--bg);
}

.backdrop__image {
  position: absolute;
  inset: -10%;
  background-image: url("../assets/images/background.svg");
  background-size: cover;
  background-position: center;
  opacity: .55;
  filter: blur(2px) saturate(1.1);
  animation: drift 26s ease-in-out infinite alternate;
}

.backdrop__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 7, 11, .35) 0%, rgba(6, 7, 11, .78) 45%, var(--bg) 100%);
}

/* Orbes coloridos com blur — dão profundidade sem pesar a página */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  will-change: transform;
}

.orb--a {
  width: 34rem;
  height: 34rem;
  top: -14rem;
  left: -10rem;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  animation: float 18s ease-in-out infinite;
}

.orb--b {
  width: 28rem;
  height: 28rem;
  top: 8rem;
  right: -12rem;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 68%);
  animation: float 22s ease-in-out infinite reverse;
}

.orb--c {
  width: 30rem;
  height: 30rem;
  bottom: -16rem;
  left: 20%;
  background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
  opacity: .35;
  animation: float 26s ease-in-out infinite;
}

/* Textura sutil de grão para tirar o aspecto "chapado" */
.grain {
  position: absolute;
  inset: -50%;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.04); }
  to   { transform: translate3d(1.5%, 1.5%, 0) scale(1.1); }
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(2.5rem, -2rem, 0) scale(1.12); }
}

/* ==========================================================================
   Container principal
   ========================================================================== */
.page {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding: clamp(1.25rem, 5vw, 3.5rem) var(--gutter) clamp(2rem, 6vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3.5vw, 2rem);
}

/* ==========================================================================
   Perfil
   ========================================================================== */
.profile {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-hi), rgba(255, 255, 255, .02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

/* Imagem de capa temática atrás do conteúdo */
.profile__cover {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* Cobre 100% da seção: `cover` preenche sem distorcer nem deixar faixa vazia */
.profile__cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  opacity: .9;
}

/* Máscara que integra a capa ao tema escuro e preserva o contraste do texto */
.profile__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(95% 130% at 50% -20%, transparent 0%, rgba(6, 7, 11, .4) 55%, rgba(6, 7, 11, .88) 100%),
    linear-gradient(180deg, rgba(6, 7, 11, .12) 0%, rgba(6, 7, 11, .5) 45%, rgba(6, 7, 11, .93) 100%);
}

.profile__body {
  padding: clamp(2.25rem, 8vw, 3.25rem) clamp(1.25rem, 5vw, 2rem) clamp(1.75rem, 5vw, 2.25rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
}

/* --- Avatar ------------------------------------------------------------ */
.avatar {
  position: relative;
  width: clamp(6.5rem, 22vw, 8.5rem);
  aspect-ratio: 1;
  margin-bottom: .75rem;
  border-radius: 50%;
  isolation: isolate;
  transition: transform var(--dur) var(--ease);
  animation: pop .8s var(--ease) .05s backwards;
}

/* Borda sutil com brilho que reage ao cursor (JS atualiza --mx/--my) */
.avatar::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--ring) - 2px);
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  opacity: .85;
  animation: spin 14s linear infinite;
  /* recorta o centro, deixando apenas um anel de --ring */
  -webkit-mask: radial-gradient(circle closest-side, #0000 calc(100% - var(--ring)), #000 0);
          mask: radial-gradient(circle closest-side, #0000 calc(100% - var(--ring)), #000 0);
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, .28), transparent 58%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
  z-index: -1;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .12);
}

/* Halo suave atrás da foto */
.avatar__ring {
  position: absolute;
  inset: calc(-1 * var(--ring) - 12px);
  border-radius: 50%;
  box-shadow: 0 0 44px -6px color-mix(in srgb, var(--accent) 60%, transparent);
  opacity: .55;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  pointer-events: none;
}

/* Imagem ausente: mantém o lugar com um gradiente no lugar do ícone quebrado */
.avatar--empty img { display: none; }

.avatar--empty {
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
}

.avatar__status {
  position: absolute;
  right: 6%;
  bottom: 6%;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #0b0d14;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
}

.profile:hover .avatar::after { opacity: 1; }
.profile:hover .avatar::before { animation-play-state: paused; }
.profile:hover .avatar__ring { opacity: .95; transform: scale(1.05); }
.profile:hover .avatar { transform: translateY(-4px) scale(1.03); }

/* --- Textos do perfil --------------------------------------------------- */
.profile__name {
  font-size: clamp(1.6rem, 1.2rem + 1.9vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  background: linear-gradient(180deg, #fff, #c3c9db);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.profile__handle {
  font-size: .9rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--accent-2) 80%, #fff);
  margin-top: -.35rem;
}

.profile__bio {
  max-width: 34rem;
  color: var(--muted);
  font-size: .96rem;
  line-height: 1.65;
  margin-top: .35rem;
  text-wrap: pretty;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: .85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem;
  font-size: .76rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge i { font-size: .72rem; color: var(--accent-2); }

/* ==========================================================================
   Links
   ========================================================================== */
.links {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.link {
  --accent: var(--accent);
  --accent-soft: rgba(124, 92, 255, .18);
}

.link__btn {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: clamp(.85rem, 2.5vw, 1.1rem);
  min-height: 4.25rem;            /* alvo de toque confortável */
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface-hi), rgba(255, 255, 255, .025));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .3s var(--ease),
    border-color .3s var(--ease),
    box-shadow .3s var(--ease),
    background-color .3s var(--ease);
}

/* Brilho que segue o cursor */
.link__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(28rem circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity .35s var(--ease);
  pointer-events: none;
}

/* Borda gradiente que acende no hover */
.link__btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 85%, transparent),
    rgba(255, 255, 255, .06) 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s var(--ease);
  pointer-events: none;
}

.link__btn:hover,
.link__btn:focus-visible {
  transform: translateY(-4px) scale(1.012);
  border-color: transparent;
  box-shadow: var(--glow), var(--shadow);
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04));
}

.link__btn:hover::before,
.link__btn:hover::after { opacity: 1; }

.link__btn:active { transform: translateY(-1px) scale(.99); }

/* Ícone ----------------------------------------------------------------- */
.link__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.35rem;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), color .3s var(--ease);
}

.link__btn:hover .link__icon {
  transform: translateY(-2px) scale(1.06) rotate(-4deg);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 90%, transparent);
}

/* Texto ----------------------------------------------------------------- */
.link__text {
  display: flex;
  flex-direction: column;
  min-width: 0;                    /* permite truncar sem estourar a largura */
  flex: 1 1 auto;
}

.link__title {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link__sub {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link__arrow {
  flex: 0 0 auto;
  font-size: .85rem;
  color: var(--muted);
  opacity: .7;
  transition: transform .35s var(--ease), opacity .3s var(--ease), color .3s var(--ease);
}

.link__btn:hover .link__arrow {
  transform: translate(3px, -3px);
  opacity: 1;
  color: var(--accent);
}

/* Card desativado / em breve ------------------------------------------- */
.link--off { --accent: #8a91a6; --accent-soft: rgba(138, 145, 166, .12); }

.link--off .link__btn {
  cursor: not-allowed;
  opacity: .5;
  filter: grayscale(.55);
  transform: none !important;
  box-shadow: var(--shadow-sm);
}

.link--off .link__btn::before,
.link--off .link__btn::after { opacity: 0 !important; }

/* Onda do clique -------------------------------------------------------- */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle,
    color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%);
  pointer-events: none;
  animation: ripple .6s var(--ease-out) forwards;
  z-index: -1; /* fica acima do fundo do card e abaixo do texto */
}

@keyframes ripple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ==========================================================================
   Rodapé
   ========================================================================== */
.footer {
  text-align: center;
  padding-block: .5rem;
}

.footer__text {
  font-size: .78rem;
  color: color-mix(in srgb, var(--muted) 75%, transparent);
  letter-spacing: .02em;
}

/* ==========================================================================
   Animações de entrada
   ========================================================================== */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(.86); }
  to   { opacity: 1; transform: none; }
}

/* Rotação contínua do anel gradiente do avatar */
@keyframes spin {
  to { transform: rotate(1turn); }
}

/* A página inteira surge suavemente ao carregar */
.page {
  animation: fade-in .6s var(--ease) backwards;
}

/* `backwards` (não `both`) para que o hover continue funcionando depois
   que a animação de entrada termina. O avatar tem animação própria (pop). */
.profile__body > :not(.avatar) {
  animation: fade-up .7s var(--ease) backwards;
  animation-delay: .12s;
}

.profile__name { animation-delay: .18s; }
.profile__handle { animation-delay: .24s; }
.profile__bio { animation-delay: .3s; }
.badges { animation-delay: .36s; }

/* Cada link entra em cascata; o índice é definido pelo JS (--i) */
.link {
  animation: fade-up .65s var(--ease) backwards;
  animation-delay: calc(.3s + var(--i, 0) * .07s);
}

.footer { animation: fade-up .6s var(--ease) .75s backwards; }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 30rem) {
  :root { --radius: 16px; }

  .page { gap: 1.1rem; }

  .link__btn {
    min-height: 4rem;
    padding: .8rem .9rem;
    gap: .85rem;
  }

  .link__icon {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.25rem;
    border-radius: 13px;
  }

  .link__title { font-size: .98rem; }
  .link__sub { font-size: .78rem; }
  .link__arrow { display: none; }

  .profile__bio { font-size: .92rem; }
  .badge { font-size: .72rem; }
}

@media (max-width: 22.5rem) {
  .badges { gap: .4rem; }
  .badge { padding: .3rem .6rem; }
}

/* Telas largas: mais respiro e largura levemente maior */
@media (min-width: 64rem) {
  :root { --max-w: 42rem; }
  .page { padding-top: 4.5rem; }
}

/* Paisagem em celulares: evita cortes da capa */
@media (max-height: 30rem) and (orientation: landscape) {
  .page { padding-top: 1.25rem; }
  .avatar { width: 5.5rem; }
}

/* ==========================================================================
   Preferências do sistema
   ========================================================================== */

/* Ativado pelo JS se a preferência mudar durante a sessão */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .avatar::before { animation: none; }
}

/* Fallback para navegadores sem suporte a color-mix() */
@supports not (color: color-mix(in srgb, #fff 50%, #000)) {
  .avatar::before { background: var(--accent); }
  .link__btn:hover { box-shadow: var(--shadow); }
}

/* Fallback para navegadores sem backdrop-filter */
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .badge { background: rgba(255, 255, 255, .08); }
}