/* ====== BASE ====== */
:root {
  color-scheme: dark;
  --fg: #e5e7eb;
  --muted: #94a3b8;
  --acc: #22c55e;
  --bg: #0b1220;
  --card: #0e1726;
  --line: #1f2a3a;
  --danger: #f97373;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.75);
  --max-width: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #020617 0, var(--bg) 50%, #020617 100%);
  color: var(--fg);
  display: flex;
  flex-direction: column;
}

/* ====== ACESSIBILIDADE ====== */

.skip-link {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -150%);
  background: #020617;
  color: #f9fafb;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid #4b5563;
  z-index: 50;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.18s ease-out;
}

.skip-link:focus-visible {
  transform: translate(-50%, 8px);
  outline: none;
}

/* ====== HERO ====== */

header.hero {
  position: relative;
  min-height: 72vh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

header.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/capa.png") center / cover no-repeat;
  filter: brightness(0.55);
  transform: scale(1.02);
}

header.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(15,23,42,0.8), transparent 55%),
    linear-gradient(180deg, rgba(15,23,42,0.8), rgba(15,23,42,0.95));
  mix-blend-mode: multiply;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 24px;
  max-width: var(--max-width);
  width: 100%;
}

.hero-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 14px;
  font-size: 13px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  color: var(--muted);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.2);
}

.pill-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #bfdbfe;
}

h1 {
  font-size: clamp(32px, 6vw, 60px);
  line-height: 1.05;
  margin: 8px 0 10px;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  max-width: 520px;
  margin-inline: auto;
}

/* ====== BOTÕES / CTA ====== */

.cta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--acc);
  color: #000;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  min-height: 44px;
  font-size: 15px;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.16s ease-out,
    box-shadow 0.16s ease-out,
    background 0.2s ease-out;
  cursor: pointer;
  white-space: nowrap;
}

.btn span.icon {
  font-size: 18px;
  line-height: 0;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 55px rgba(22, 163, 74, 0.7);
  background: #4ade80;
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.5);
}

.btn:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 3px;
}

.btn.secondary {
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.btn.secondary:hover {
  background: #0b1120;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 1);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed #334155;
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(15, 23, 42, 0.7);
}

/* ====== CONTEÚDO PRINCIPAL ====== */

main {
  flex: 1;
  width: 100%;
  padding: 32px 0 40px;
}

.section {
  max-width: var(--max-width);
  margin: 0 auto 40px;
  padding: 0 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.section-header p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 380px;
}

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: radial-gradient(circle at top left, #020617 0, var(--card) 55%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.8);
}

.card h3 {
  margin: 0;
  font-size: 16px;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.chip {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid #1f2937;
  background: rgba(15, 23, 42, 0.9);
}

.card a.card-link {
  margin-top: 12px;
  font-size: 13px;
  color: #a5b4fc;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card a.card-link:hover {
  text-decoration: underline;
}

.card a.card-link span.icon {
  font-size: 15px;
}

/* ====== LAYOUT GERAL (UTILITÁRIOS) ====== */

.hstack {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spacer {
  flex: 1;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.ok {
  color: #86efac;
}

.danger {
  color: var(--danger);
}

/* Cards diretamente dentro do <main> (telas internas como /perfil/app.html) */
main > .card {
  max-width: var(--max-width);
  margin: 0 auto 16px;
}

/* ====== HEADER DO APP (perfil, etc.) ====== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: linear-gradient(180deg, #020617, #020617f5);
  backdrop-filter: blur(16px);
}

/* Em telas menores, quebra os botões em linhas */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

/* ====== FORM / CAMPOS ====== */

.field {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #111827;
  color: var(--fg);
  font: inherit;
  transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out, background 0.16s ease-out;
}

.field:focus {
  outline: none;
  border-color: var(--acc);
  background: #1f2a3a;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

label {
  display: block;
  margin: 6px 0 6px;
  font-weight: 600;
  font-size: 14px;
}

/* Layout de colunas (perfil, inventário) */

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Avatar do usuário */

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #020617;
}

/* ====== PRIVACIDADE / PERFIL ====== */

.card-privacy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.switchline {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ====== ABAS (tabs) ====== */

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  margin: -4px 0 12px;
}

.tab-btn {
  white-space: nowrap;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #0e1424;
  padding: 10px 16px;
  color: var(--fg);
  cursor: pointer;
  font-size: 14px;
}

.tab-btn.active {
  background: var(--acc);
  color: #041006;
  border: none;
  font-weight: 800;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

/* ====== LISTAS (inventário, Strava) ====== */

.feed {
  display: grid;
  gap: 12px;
}

.feed-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #0d1322;
}

.item-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cover {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #020617;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 12px;
  margin-left: 6px;
}

/* Ajuste de botões dentro dos cards de inventário */

.feed-item .btn {
  min-height: 0;
  padding: 8px 12px;
  font-size: 13px;
}

/* ====== LINKS TIPO BOTÃO EM LINHA (seguidores, etc.) ====== */

.linklike {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #a5b4fc;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.linklike:hover {
  opacity: 0.9;
}

.linklike:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

/* ====== COMUNIDADE (lista de perfis públicos) ====== */

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.search {
  flex: 1;
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #1f2a3a;
  color: var(--fg);
  font: inherit;
  transition:
    border-color 0.2s ease-out,
    box-shadow 0.2s ease-out,
    background 0.2s ease-out;
}

.search:focus {
  outline: none;
  border-color: var(--acc);
  background: #111827;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35);
}

.community-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.community-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar-sm {
  width: 64px;
  height: 64px;
}

.name {
  font-weight: 800;
}

/* Reuso geral para linhas de ações (comunidade, etc.) */
.actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* Skeleton loading para comunidade */

.skel {
  background: linear-gradient(90deg,#1a2231 25%,#1f2a3a 37%,#1a2231 63%);
  background-size: 400% 100%;
  animation: sh 1.4s ease infinite;
  border-radius: 12px;
}

@keyframes sh {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ====== FOOTER ====== */

footer {
  border-top: 1px solid #1f2937;
  padding: 12px 20px 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(18px);
}

footer small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}

/* ====== RESPONSIVIDADE ====== */

@media (max-width: 600px) {
  .hero-inner {
    padding-inline: 16px;
  }

  .section {
    padding-inline: 16px;
  }

  .section-header {
    align-items: flex-start;
  }
}

/* ====== REDUZIR MOVIMENTO (ACESSIBILIDADE) ====== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
