/* ==========================================================
   LinkBio — Estilo público
   Minimalista, elegante, mobile-first
   ========================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body, 'Poppins'), sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

/* Dark mode automático via preferência do sistema */
html[data-mode="auto"] body {
  --bg: light-dark(var(--bg), #14110F);
}
html[data-mode="dark"] body,
html[data-mode="auto"] body {
  color-scheme: light dark;
}

/* Modo escuro manual (classe aplicada via JS) */
body.theme-dark {
  --bg: #14110F;
  --text: #F3EFEA;
  --secondary: #A79E92;
}

.page {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 56px 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.hero-photo-wrap { margin-bottom: 20px; }

.hero-photo {
  width: var(--photo-size, 120px);
  height: var(--photo-size, 120px);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 12px 28px -12px rgba(0,0,0,0.25);
}

.hero-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: 'Fraunces', serif;
  font-size: calc(var(--photo-size, 120px) * 0.4);
}

.hero-name {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.65rem;
  letter-spacing: 0.01em;
  margin: 0 0 2px;
}

.hero-username {
  margin: 0 0 10px;
  color: var(--secondary);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.hero-message {
  margin: 0 0 8px;
  color: var(--secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 320px;
}

/* ---------- Links ---------- */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 34px;
}

.link-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-height: 64px;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

body:not(.theme-dark) .link-item {
  border-color: rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.04);
}

body.theme-dark .link-item { border-color: rgba(255,255,255,0.14); }

.link-item:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

.link-item:active { transform: scale(0.97); }

.link-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
}
.link-icon svg { width: 55%; height: 55%; }
.link-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.link-icon .link-emoji { font-size: 1.5rem; line-height: 1; display: inline-flex; }

.link-title { text-align: center; }

.empty-hint { color: var(--secondary); font-size: 0.9rem; }

/* ---------- Redes sociais ---------- */
.socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 36px;
}

.social-icon {
  width: 20px;
  height: 20px;
  color: var(--secondary);
  transition: color .18s ease, transform .18s ease;
}
.social-icon svg { width: 100%; height: 100%; }
.social-icon:hover { color: var(--accent); transform: translateY(-2px); }

/* ---------- Rodapé ---------- */
.footer {
  margin-top: auto;
  padding-top: 40px;
  color: var(--secondary);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ---------- Toggle de tema ---------- */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  background: var(--bg);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
body.theme-dark .theme-toggle { border-color: rgba(255,255,255,0.14); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
body.theme-dark .theme-toggle .icon-sun { display: none; }
body.theme-dark .theme-toggle .icon-moon { display: block; }

/* ---------- Animações de entrada ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-1 { animation: rise .6s ease both; }
.fade-in-2 { animation: rise .6s ease both .12s; }
.fade-in-3 { animation: rise .6s ease both .3s; }
.fade-in-links { animation: rise .5s ease both calc(.2s + var(--d, 0s)); }

@media (prefers-reduced-motion: reduce) {
  .fade-in-1, .fade-in-2, .fade-in-3, .fade-in-links { animation: none; }
}

/* ---------- Presets de estilo ---------- */
html[data-preset="elegante"] .link-item { border-radius: 14px; }
html[data-preset="elegante"] .hero-name { font-size: 1.8rem; }

html[data-preset="dark_premium"] body { background-color: #0F0D0C; color: #F3EFEA; }
html[data-preset="dark_premium"] .link-item { border-color: rgba(255,255,255,0.12); }
html[data-preset="dark_premium"] .theme-toggle { display: none; }

/* ---------- Desktop: manter compacto ---------- */
@media (min-width: 560px) {
  .page { padding-top: 72px; }
}
