/* ==========================================================================
   VARIÁVEIS & RESET
   ========================================================================== */
:root {
  --bg-gradient-1: #0e2a36;
  --bg-gradient-2: #07131c;
  --primary: #c9a03d;
  --primary-light: #e0b65a;
  --secondary: #e8d5b7;
  --text-light: #f5f0e6;
  --text-dim: #cbd5e0;
  --text-muted: #a0aec0;
  --card-base: rgba(10, 26, 36, 0.85);
  --card-border: rgba(148, 163, 184, 0.4);
  --transition-fast: 0.25s ease-out;
  --transition-med: 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  --transition-slow: 0.9s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  --nav-bg: rgba(5, 12, 20, 0.9);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 1rem;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #102a43 0, #050c12 55%, #020509 100%);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-light);
  line-height: 1.5;
  overflow-x: hidden;
  /* Espaço para o menu inferior fixo (todas as telas) */
  padding-bottom: 4rem;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================================================
   ACESSIBILIDADE
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0.5rem;
  background: var(--primary);
  color: #020509;
  padding: 0.5rem 1rem;
  z-index: 1000;
  transition: top 0.2s ease;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
}

.skip-link:focus {
  top: 0.5rem;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   PRELOADER (tela de carregamento)
   ========================================================================== */
#loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: radial-gradient(circle at top, #102a43 0, #050c12 55%, #020509 100%);
}

#loader {
  display: block;
  position: relative;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary-light);
  animation: spin 1s linear infinite;
  z-index: 10001;
}

#loader::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  animation: spin 2s linear infinite;
}

#loader::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--secondary);
  animation: spin 1.5s linear infinite;
}

.loader-section {
  position: fixed;
  top: 0;
  width: 51%;
  height: 100%;
  background: radial-gradient(circle at top, #102a43 0, #050c12 55%, #020509 100%);
  z-index: 10000;
  transform: translateX(0);
  transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.loader-section.section-left {
  left: 0;
}

.loader-section.section-right {
  right: 0;
}

.loaded #loader-wrapper .loader-section.section-left {
  transform: translateX(-100%);
}

.loaded #loader-wrapper .loader-section.section-right {
  transform: translateX(100%);
}

.loaded #loader {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.loaded #loader-wrapper {
  visibility: hidden;
  transform: translateY(-100%);
  transition:
    visibility 0s 0.6s,
    transform 0.6s ease-out;
}

/* ==========================================================================
   FUNDO COM PARTÍCULAS
   ========================================================================== */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(201, 160, 61, 0.16) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(148, 163, 184, 0.2) 1px, transparent 1px);
  background-size: 40px 40px, 60px 60px;
  animation: particleDrift 42s linear infinite;
}

/* ==========================================================================
   CONTAINER PRINCIPAL
   ========================================================================== */
.container {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ==========================================================================
   MENU HUB
   ========================================================================== */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  backdrop-filter: blur(20px);
  background: rgba(5, 12, 20, 0.9);
  border-top: 1px solid rgba(201, 160, 61, 0.4);
  padding: 0.4rem 0.5rem;
}

.app-nav .nav-container {
  max-width: 90rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

/* Texto explicativo sempre acima */
.nav-explore-label {
  font-size: 0.65rem;
  color: #a0aec0;
  letter-spacing: 0.03em;
  margin: 0 0 0.15rem 0;
  padding: 0;
  opacity: 0.8;
  text-align: center;
}

/* Container dos botões (flex horizontal, quebra conforme necessário) */
.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
}

/* Estilo base para todos os botões (Início incluso) */
.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #cbd5e0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item i {
  font-size: 1rem;
}

.nav-item span {
  font-size: 0.65rem;
}

.nav-item:hover {
  background: rgba(201, 160, 61, 0.2);
  color: #e0b65a;
}

/* Estilo ativo para qualquer item (hub ou template) */
.nav-item.active {
  background: linear-gradient(120deg, rgba(201, 160, 61, 0.25), rgba(201, 160, 61, 0.1));
  color: #e0b65a;
  box-shadow: 0 0 8px rgba(201, 160, 61, 0.3);
  border: 0.5px solid rgba(201, 160, 61, 0.5);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-block: 2rem 2.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0.75rem;
  gap: 0.5rem;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-light);
  border: 1px solid rgba(201, 160, 61, 0.45);
  background: radial-gradient(circle at top left, rgba(201, 160, 61, 0.18), transparent 55%);
  backdrop-filter: blur(6px);
  cursor: default;
}

.hero-title {
  margin-top: 1.5rem;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.gradient {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--secondary));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 8s ease infinite;
}

.hero-line {
  width: 5rem;
  height: 3px;
  border-radius: 999px;
  margin: 1.25rem auto 1.1rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 0 18px rgba(201, 160, 61, 0.4);
}

.hero-subtitle {
  max-width: 34rem;
  margin-inline: auto;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ==========================================================================
   CARDS (TEMPLATES)
   ========================================================================== */
.projects {
  position: relative;
  z-index: 2;
  padding-block: 1rem 4.5rem;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 2.5rem;
}

.project-item {
  width: 100%;
  position: relative;
  border: 1px solid var(--card-border);
  border-top: none;
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0) 0%,
      color-mix(in srgb, var(--hover-color, var(--primary-light)) 24%, transparent) 40%,
      color-mix(in srgb, var(--hover-color, var(--primary-light)) 8%, transparent) 100%),
    var(--card-base);
  background-size: 0% 100%, 100% 100%;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  margin: 1rem 0;
  cursor: default;
  overflow: hidden;
  transition:
    background-size var(--transition-slow),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.project-item:first-of-type {
  border-top: 1px solid var(--card-border);
}

.project-item.is-active {
  border-color: rgba(201, 160, 61, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.7);
  background-size: 100% 100%, 100% 100%;
}

.project-thumb {
  position: relative;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

.project-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  filter: brightness(1) contrast(1.05) saturate(1.05);
  transform: scale(1.01);
  transition:
    transform var(--transition-med),
    filter var(--transition-med);
}

.project-item.is-active .project-thumb img {
  transform: scale(1.04);
  filter: brightness(1.05) contrast(1.08) saturate(1.1);
}

.project-main {
  padding: 1.05rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
  position: relative;
  display: inline-block;
  color: var(--text-dim);
  transition: color var(--transition-fast);
}

.project-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  white-space: nowrap;
  overflow: hidden;
  width: 0;
  background: linear-gradient(90deg,
      var(--hover-color, var(--primary-light)),
      var(--hover-color, var(--primary-light)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: width var(--transition-slow);
}

.project-item.is-active .project-title::after {
  width: 100%;
}

.project-item.is-active .project-title {
  color: #64748b;
}

.project-description {
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 40rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid rgba(201, 160, 61, 0.45);
  padding: 0.35rem 0.9rem;
  background-color: rgba(201, 160, 61, 0.06);
  color: var(--primary);
  text-decoration: none;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform 0.18s ease-out;
  cursor: pointer;
}

.project-link:hover {
  background-color: rgba(201, 160, 61, 0.2);
  border-color: rgba(201, 160, 61, 0.9);
  transform: translateY(-1px);
}

/* Cores específicas por card */
.project-item[data-hover-color="#3b82f6"] {
  --hover-color: #3b82f6;
}

.project-item[data-hover-color="#10b981"] {
  --hover-color: #10b981;
}

.project-item[data-hover-color="#f59e0b"] {
  --hover-color: #f59e0b;
}

.project-item[data-hover-color="#ec4899"] {
  --hover-color: #ec4899;
}

.project-item[data-hover-color="#8b5cf6"] {
  --hover-color: #8b5cf6;
}

/* ==========================================================================
   BOTÃO EXPLORE (veja mais / portfólio)
   ========================================================================== */
.see-more-container {
  text-align: center;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}

.see-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  border: 1px solid rgba(201, 160, 61, 0.5);
  border-radius: 3rem;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-light);
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  background: rgba(201, 160, 61, 0.05);
}

.see-more-btn i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.see-more-btn:hover {
  background: rgba(201, 160, 61, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(201, 160, 61, 0.2);
}

.see-more-btn:hover i {
  transform: translateX(4px);
}

.see-more-hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ==========================================================================
   PREVIEW FLUTUANTE (desktop)
   ========================================================================== */
.floating-preview {
  position: fixed;
  right: 2rem;
  top: 50%;
  width: 22rem;
  height: 18rem;
  border-radius: 1rem;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.65);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(15, 23, 42, 0.8);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1000;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  transform: none;
}

.floating-preview.is-visible {
  opacity: 1;
  visibility: visible;
}

.floating-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1) contrast(1.05);
}

.preview-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.28), transparent 55%);
}

/* ==========================================================================
   RODAPÉ
   ========================================================================== */
.footer {
  position: relative;
  z-index: 2;
  padding-block: 2.5rem 2.8rem;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.96));
  backdrop-filter: blur(12px);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-brand p,
.footer-credit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.83rem;
  color: var(--text-dim);
  text-decoration: none;
  background-color: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform 0.18s ease-out;
}

.footer-social a:hover {
  color: var(--primary-light);
  background-color: rgba(30, 64, 175, 0.25);
  border-color: rgba(201, 160, 61, 0.85);
  transform: translateY(-1px);
}

.footer-credit a {
  color: var(--primary);
  text-decoration: none;
}

.footer-credit a:hover {
  color: var(--primary-light);
}

.heartbeat {
  display: inline-block;
  color: #e11d48;
  animation: heartbeat 1.2s ease-in-out infinite;
}

/* ==========================================================================
   MEDIA QUERIES (mobile-first, apenas min-width)
   ========================================================================== */

/* >= 36rem (576px) */
@media (min-width: 36rem) {
  .nav-hub-btn {
    font-size: 0.75rem;
  }

  .nav-hub-btn i {
    font-size: 1rem;
  }

  .nav-hub-btn span {
    font-size: 0.75rem;
  }

  .nav-item i {
    font-size: 1rem;
  }

  .nav-item span {
    font-size: 0.75rem;
  }
}

/* >= 48rem (768px) – tablet */
@media (min-width: 48rem) {
  .hero-title {
    font-size: 3.1rem;
  }

  .project-item {
    flex-direction: row;
    align-items: stretch;
  }

  .project-thumb {
    width: 42%;
  }

  .project-thumb img {
    height: 100%;
    aspect-ratio: auto;
  }

  .project-main {
    padding: 1.05rem 1.8rem 1.2rem;
    flex: 1;
  }

  .see-more-btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    gap: 1rem;
  }

  .see-more-btn i {
    font-size: 1.1rem;
  }

  .see-more-hint {
    font-size: 0.8rem;
  }

  .nav-explore-label {
    font-size: 0.85rem;
  }

  .footer-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .footer-brand {
    align-items: flex-start;
  }

  .footer-credit {
    text-align: right;
  }
}

/* >= 64rem (1024px) – desktop */
@media (min-width: 64rem) {

  .app-nav {
    padding: 0.6rem 0.5rem;
  }

  .nav-explore-label {
    margin-bottom: 0.25rem;
  }

  .nav-buttons {
    gap: 0.5rem;
  }

  .nav-item {
    flex-direction: row;
    padding: 0.55rem 1.2rem;
    border-radius: 2.5rem;
    font-size: 0.9rem;
    gap: 0.75rem;
  }

  .nav-item i {
    font-size: 1.2rem;
  }

  .nav-item span {
    font-size: 1rem;
  }

  /* Estilos específicos para o hub (Início) – agora é igual aos outros */
  .nav-hub-btn {
    /* mesmo estilo dos demais, sem distinção */
  }

  /* Demais estilos da página (hero, cards, preview) permanecem iguais */
  .hero-title {
    font-size: 3.6rem;
  }

  .project-thumb {
    display: none;
  }

  .project-item {
    flex-direction: column;
    cursor: pointer;
    margin: 0;
  }

  .project-main {
    padding-block: 1.05rem 1.2rem;
    padding-inline: 1.8rem 4.5rem;
  }

  .floating-preview {
    display: block;
  }

  .footer {
    /* margin-bottom: 4rem; */
  }
}

/* >= 80rem (1280px) – desktop largo */
@media (min-width: 80rem) {
  .hero-title {
    font-size: 4rem;
  }
}

/* >= 90rem (1440px) – ultrawide */
@media (min-width: 90rem) {
  .container {
    max-width: 90rem;
  }

  .project-main {
    padding-inline: 2.2rem 5.5rem;
  }
}

/* ==========================================================================
   KEYFRAMES (animações)
   ========================================================================== */
@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.18);
  }

  60% {
    transform: scale(0.96);
  }
}

@keyframes particleDrift {
  0% {
    background-position: 0 0, 0 0;
  }

  100% {
    background-position: 6.25rem 6.25rem, -6.25rem -6.25rem;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}