/* ==========================================================================
   História Medieval - Link na Bio (Direto, Nobre e Sem Fofoca - Pro Edition)
   ========================================================================== */

/* --- Custom Font: Por Siempre Gótica --- */
@font-face {
  font-family: 'Por Siempre Gotica';
  src: url('assets/por-siempre-gotica.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --- Custom Properties / Design Tokens --- */
:root {
  --color-crimson-dark: #190205;
  --color-crimson-mid: #38070d;
  --color-gold-accent: #d4af37;
  --color-gold-light: #f3e5ab;
  --color-verified-blue: #0095f6;
  --color-text-light: #f7f3eb;
  --color-btn-bg: #ffffff;
  --color-btn-text: #1a1210;
  --color-btn-hover: #ffffff;
  
  --font-serif-display: 'Por Siempre Gotica', 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-serif-body: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-pill: 9999px;
  
  --shadow-pill: 0 4px 14px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-pill-hover: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(212, 175, 55, 0.25);
  
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.28s var(--ease-spring);
  --transition-fast: all 0.15s ease-out;
}

/* --- Base & Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  caret-color: transparent;
}

html, body {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden; /* Elimina scroll */
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background-color: #0d0103;
  /* Imagem da catedral completa como background, sem opacidade */
  background-image: url('assets/vitral.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--color-text-light);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  position: relative;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

a, button, [role="button"], .bio-link-btn, .capa__redes a, .icon-action-btn {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  caret-color: transparent;
}

/* --- Main Bio Container --- */
.bio-container {
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 100dvh;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 20px;
  margin: 0 auto;
}

/* --- Top Bar Actions --- */
.top-bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.icon-action-btn {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
  border-color: var(--color-gold-accent);
}

.icon-action-btn:active {
  transform: scale(0.94);
}

/* --- Profile Section --- */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 8px;
  animation: fadeIn 0.8s var(--ease-spring);
}

/* Avatar Crest (Logo Oficial) */
.avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 12px;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
  animation: pulseGlow 4s ease-in-out infinite alternate;
  pointer-events: none;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background-color: transparent;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.75));
  display: block;
}

/* Title & Badge */
.title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.profile-title {
  font-family: var(--font-serif-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  line-height: 1.2;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-verified-blue);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  animation: badgePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Bio Text */
.profile-bio {
  font-family: var(--font-serif-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: #f2e9dc;
  line-height: 1.4;
  max-width: 350px;
  margin-bottom: 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.2px;
}

/* Social Media Nav Bar (capa__redes) */
.capa__redes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.capa__redes li {
  display: inline-flex;
}

.capa__redes a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f7f3eb;
  text-decoration: none;
  transition: var(--transition-fast);
}

.icon-action-btn i.hgi-stroke {
  font-size: 18px;
  line-height: 1;
}

.verified-badge svg {
  width: 20px;
  height: 20px;
  display: block;
}

.capa__redes i.hgi-stroke {
  font-size: 18px;
  line-height: 1;
}

.capa__redes a:hover,
.capa__redes a:focus-visible {
  background: #630c17;
  border-color: var(--color-gold-accent);
  color: #f3e5ab;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.35);
}

.capa__redes a:active {
  opacity: 0.85;
}

/* --- Links Section (Luxury Codex Cards) --- */
.links-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
}

/* Link Button Card - Centralizado, menos largo */
.bio-link-btn {
  width: 100%;
  max-width: 280px; /* Menos largo */
  min-height: 48px;
  background: linear-gradient(135deg, #ffffff 0%, #fdfbf7 55%, #f7f1e6 100%);
  color: var(--color-btn-text);
  text-decoration: none;
  border-radius: 14px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center; /* Centraliza o conteúdo */
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(212, 175, 55, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.85);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  user-select: none;
  cursor: pointer;
  
  /* Animação suave de entrada */
  animation: buttonSlideUp 0.5s ease both;
  animation-delay: calc(var(--item-index, 1) * 0.06s);
}

/* Button Content */
.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-title {
  font-family: var(--font-serif-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #0a0504;
  line-height: 1.2;
  text-align: center;
  transition: color 0.2s ease;
}

/* Featured / Portal Button Special Accent */
.bio-link-btn.featured {
  background: linear-gradient(135deg, #ffffff 0%, #fcf9f2 50%, #f6ecd9 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.8);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(212, 175, 55, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(212, 175, 55, 0.4);
}

/* Hover & Active States */
.bio-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.55),
    0 0 16px rgba(212, 175, 55, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(212, 175, 55, 0.6);
}

.bio-link-btn:hover .btn-title {
  color: #630c17;
}

.bio-link-btn:active {
  transform: translateY(0);
  opacity: 0.92;
}

/* Keyboard accessibility */
.bio-link-btn:focus-visible,
.icon-action-btn:focus-visible,
.capa__redes a:focus-visible {
  outline: 2px solid var(--color-gold-accent);
  outline-offset: 3px;
}

/* --- Footer --- */
.bio-footer {
  margin-top: auto;
  padding-top: 8px;
  text-align: center;
}

.copyright {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.3px;
  font-family: var(--font-sans);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(18, 2, 4, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid var(--color-gold-accent);
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease, visibility 0.35s;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --- Keyframe Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes buttonSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  from {
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.35);
  }
  to {
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.55);
    border-color: rgba(212, 175, 55, 0.7);
  }
}

@keyframes badgePop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Reduced Motion Support --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Responsive Adjustments for Ultra-Compact Screens --- */
@media (max-height: 700px) {
  .bio-container {
    padding: 10px 8px 12px;
  }
  .avatar-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
  }
  .profile-title {
    font-size: 1.45rem;
  }
  .profile-bio {
    font-size: 0.92rem;
    margin-bottom: 8px;
    max-width: 320px;
  }
  .capa__redes {
    gap: 6px;
  }
  .capa__redes a {
    width: 32px;
    height: 32px;
  }
  .capa__redes svg {
    width: 14px;
    height: 14px;
  }
  .links-section {
    gap: 8px;
    margin: 4px 0;
  }
  .bio-link-btn {
    max-width: 250px;
    min-height: 42px;
    padding: 8px 18px;
  }
  .btn-title {
    font-size: 1.15rem;
  }
  .bio-footer {
    padding-top: 4px;
  }
  .copyright {
    font-size: 0.72rem;
  }
}

@media (max-width: 360px) {
  .profile-title {
    font-size: 1.45rem;
  }
  .profile-bio {
    font-size: 0.9rem;
  }
  .bio-link-btn {
    max-width: 240px;
    min-height: 44px;
  }
  .btn-title {
    font-size: 1.15rem;
  }
}
