/* ============================================
   Link Bio — Ricardo Moura
   Clean premium · branco/preto/cinza + detalhes azul
   ============================================ */

:root {
  --bg: #ffffff;
  --bg-elevated: #f4f5f7;
  --surface: rgba(15, 17, 21, 0.035);
  --surface-hover: rgba(15, 17, 21, 0.06);
  --stroke: rgba(15, 17, 21, 0.09);
  --text: #14151a;
  --text-dim: #6b7280;
  --accent-1: #2f7dfd;
  --accent-2: #5ec8ff;
  --grad: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --shadow: 0 10px 26px rgba(20, 21, 26, 0.07);
  --shadow-lg: 0 18px 40px rgba(20, 21, 26, 0.1);
  --shadow-accent: 0 10px 24px rgba(47, 125, 253, 0.18);
  --icon-bg: rgba(255, 255, 255, 0.6);
  --radius: 18px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #17181c;
  --bg-elevated: #23252b;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.09);
  --text: #f5f6f8;
  --text-dim: #9aa1ac;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.45);
  --icon-bg: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .name {
  background: linear-gradient(120deg, #f5f6f8 30%, #b9b9c9);
  -webkit-background-clip: text;
  background-clip: text;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Paleta de tints usada em tiles/tags — cada classe só define as custom
   properties; quem consome (card, stat-card, coupon, topic-pill) cai de
   volta pro azul/cinza padrão quando nenhuma está presente. */
.tile-blue   { --tile-color: #2f7dfd; --tile-bg: rgba(47, 125, 253, 0.08); --tile-border: rgba(47, 125, 253, 0.22); }
.tile-violet { --tile-color: #8b5cf6; --tile-bg: rgba(139, 92, 246, 0.08); --tile-border: rgba(139, 92, 246, 0.22); }
.tile-teal   { --tile-color: #0d9488; --tile-bg: rgba(13, 148, 136, 0.08); --tile-border: rgba(13, 148, 136, 0.22); }
.tile-amber  { --tile-color: #d97706; --tile-bg: rgba(217, 119, 6, 0.09); --tile-border: rgba(217, 119, 6, 0.24); }
.tile-pink   { --tile-color: #db2777; --tile-bg: rgba(219, 39, 119, 0.08); --tile-border: rgba(219, 39, 119, 0.22); }

/* ---------- Preloader ---------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid var(--stroke);
  border-top-color: var(--accent-1);
  animation: preloader-spin 0.75s linear infinite;
}
@keyframes preloader-spin { to { transform: rotate(360deg); } }

/* ---------- Theme toggle ---------- */

.theme-toggle {
  position: fixed;
  top: 18px; right: 18px;
  z-index: 50;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.theme-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.theme-toggle svg { width: 19px; height: 19px; display: block; }
.theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: block; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Fundo ---------- */

#bg3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
}
.glow-1 {
  width: 420px; height: 420px;
  background: var(--accent-1);
  top: -140px; left: -120px;
  opacity: 0.14;
  animation: drift1 18s ease-in-out infinite alternate;
}
.glow-2 {
  width: 380px; height: 380px;
  background: var(--accent-2);
  bottom: -120px; right: -110px;
  opacity: 0.1;
  animation: drift2 22s ease-in-out infinite alternate;
}
.glow-3 {
  width: 340px; height: 340px;
  background: #8b5cf6;
  top: 38%; right: -110px;
  opacity: 0.08;
  animation: drift3 26s ease-in-out infinite alternate;
}
.glow-4 {
  width: 300px; height: 300px;
  background: #0d9488;
  bottom: 12%; left: -100px;
  opacity: 0.07;
  animation: drift4 20s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(60px, 80px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-70px, -60px) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-60px, 70px) scale(1.12); } }
@keyframes drift4 { to { transform: translate(70px, -50px) scale(1.18); } }

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */

.page {
  position: relative;
  z-index: 2;
  max-width: 580px;
  margin: 0 auto;
  padding: 64px 20px 48px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title svg { width: 15px; height: 15px; color: var(--accent-1); }

/* ---------- Perfil ---------- */

.profile {
  text-align: center;
  margin-bottom: 32px;
  padding: 32px 24px 28px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.avatar-wrap {
  position: relative;
  width: 118px; height: 118px;
  margin: 0 auto 20px;
}

.avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent-1), var(--accent-2), #d6ecff, var(--accent-1));
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  display: block;
  box-shadow: var(--shadow);
}

.status-dot {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-1);
  border: 3px solid var(--bg);
  box-shadow: 0 0 12px rgba(47, 125, 253, 0.6);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 125, 253, 0.45); }
  50% { box-shadow: 0 0 0 9px rgba(47, 125, 253, 0); }
}

.name {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #14151a 30%, #52565f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.handle {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-top: 2px;
}

.meta-line {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.meta-line svg { width: 13px; height: 13px; color: var(--accent-1); flex-shrink: 0; }
.meta-dot { opacity: 0.6; }

.roles {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 500;
  min-height: 1.6em;
}
#role-typer {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.caret {
  color: var(--accent-1);
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.bio {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.topics-marquee {
  margin-top: 16px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.topics-track {
  list-style: none;
  display: flex;
  width: max-content;
  gap: 8px;
  animation: marquee 46s linear infinite;
}
@keyframes marquee { to { transform: translateX(-50%); } }

.topic-pill {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(47, 125, 253, 0.25);
  background: rgba(47, 125, 253, 0.08);
  color: var(--accent-1);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Bentobox (seguidores + links) ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(112px, auto);
  grid-auto-flow: dense;
  gap: 12px;
  margin-bottom: 32px;
}
.bento-item--wide { grid-column: 1 / -1; }

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--tile-bg, var(--surface));
  border: 1px solid var(--tile-border, var(--stroke));
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.stat-card:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: var(--shadow-lg), var(--shadow-accent);
}
.stat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}
.stat-card__icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--icon-bg);
  color: var(--tile-color, var(--accent-1));
}
.stat-card__icon svg { width: 18px; height: 18px; }
.stat-card__go {
  width: 16px; height: 16px;
  color: var(--text-dim);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s;
}
.stat-card__go svg { width: 100%; height: 100%; }
.stat-card:hover .stat-card__go {
  color: var(--tile-color, var(--accent-1));
  transform: translate(2px, -2px);
}
.stat-card__body { display: flex; flex-direction: column; }
.stat-card__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
  display: block;
}
.stat-card__label {
  font-size: 0.74rem;
  color: var(--text-dim);
}
.stat-card__handle {
  font-size: 0.72rem;
  color: var(--tile-color, var(--accent-1));
  margin-top: 3px;
  font-weight: 600;
}

/* ---------- Cards de links ---------- */

.card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--tile-bg, var(--surface));
  border: 1px solid var(--tile-border, var(--stroke));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(47, 125, 253, 0.1), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-accent);
}

.card--featured {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(120deg, rgba(47,125,253,0.7), rgba(94,200,255,0.7)) border-box;
}
.card--featured:hover {
  background:
    linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box,
    var(--grad) border-box;
}

.card--compact {
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}
.card--compact .card__icon { width: 40px; height: 40px; }
.card--compact .card__title {
  font-size: 0.92rem;
  line-height: 1.28;
  display: block;
}
.card--compact .card__desc {
  font-size: 0.76rem;
  line-height: 1.35;
  display: block;
  margin-top: -6px;
}

.card__icon {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--icon-bg);
  color: var(--tile-color, var(--accent-1));
  flex-shrink: 0;
}
.card--featured .card__icon { background: var(--bg-elevated); }
.card__icon svg { width: 22px; height: 22px; }

.card__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.card__desc {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.card__arrow {
  margin-left: auto;
  width: 22px; height: 22px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s;
}
.card__arrow svg { width: 100%; height: 100%; }
.card:hover .card__arrow {
  transform: translate(3px, -3px);
  color: var(--accent-1);
}

.card__badge {
  position: absolute;
  top: 12px; right: 14px;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(47, 125, 253, 0.35);
}
.card__badge--soon {
  background: var(--text-dim);
  box-shadow: none;
}

.card--disabled {
  opacity: 0.55;
  filter: grayscale(0.4);
  cursor: not-allowed;
}
.card--disabled:hover {
  transform: none;
  box-shadow: var(--shadow);
}
.card--disabled::before { display: none; }

/* ---------- Cupons ---------- */

.coupons { display: flex; flex-direction: column; gap: 14px; margin-bottom: 32px; }

.coupon {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--tile-bg, var(--surface));
  border: 1px solid var(--tile-border, var(--stroke));
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.coupon:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-accent);
}

.coupon__icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--icon-bg);
  color: var(--tile-color, var(--accent-1));
}
.coupon__icon svg { width: 20px; height: 20px; }

.coupon__body { flex: 1; min-width: 0; }
.coupon__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.coupon__brand a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.coupon__brand a:hover { color: var(--accent-1); }
.coupon__brand svg { width: 13px; height: 13px; color: var(--text-dim); }
.coupon__desc {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 2px;
}

.coupon__code {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border-radius: 12px;
  border: 1.5px dashed rgba(47, 125, 253, 0.4);
  background: rgba(47, 125, 253, 0.05);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--accent-1);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.coupon__code:hover { background: rgba(47, 125, 253, 0.1); }
.coupon__code svg { width: 16px; height: 16px; flex-shrink: 0; }
.coupon__code.is-copied {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
  color: #16a34a;
}

/* ---------- Spotify ---------- */

.spotify { margin-bottom: 32px; }

.spotify__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.spotify__head h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}
.eq i {
  width: 4px;
  border-radius: 2px;
  background: var(--grad);
  animation: eq 1s ease-in-out infinite;
}
.eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq i:nth-child(2) { height: 90%; animation-delay: 0.18s; }
.eq i:nth-child(3) { height: 60%; animation-delay: 0.36s; }
.eq i:nth-child(4) { height: 100%; animation-delay: 0.52s; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

.spotify__frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}
.spotify__frame iframe { display: block; }

/* ---------- Redes sociais ---------- */

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.social {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--text-dim);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.social svg { width: 21px; height: 21px; }
.social:hover {
  transform: translateY(-5px) scale(1.06);
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(47, 125, 253, 0.35);
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 44px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ---------- Acessibilidade / motion ---------- */

a:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
  border-radius: var(--radius);
}

[data-reveal] { opacity: 0; }
.no-js [data-reveal],
.reduced-motion [data-reveal] { opacity: 1 !important; transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  [data-reveal] { opacity: 1 !important; }
}

@media (max-width: 480px) {
  .page { padding-top: 48px; }
  .bento { gap: 10px; }
  .card { padding: 15px 16px; gap: 13px; }
  .card--compact { padding: 14px; }
  .card__icon { width: 42px; height: 42px; }
  .coupon { flex-wrap: wrap; }
  .coupon__code { margin-left: auto; }
}
