/* ===================================================================
   Design System — Gabriel Ferreira Dev
   Identidade visual unificada para todo o site
   =================================================================== */

/* ===================================================================
   1. VARIÁVEIS GLOBAIS — TEMA ESCURO (padrão)
   =================================================================== */
:root {
  /* Cores de fundo */
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a26;
  --surface-3: #222236;

  /* Cores de texto */
  --text: #e8e8f0;
  --text-2: #9494aa;
  --text-3: #6a6a80;

  /* Accent principal — ciano tecnológico (IA/dados) */
  --accent: #4fc3f7;
  --accent-2: #7c4dff;
  --accent-glow: rgba(79, 195, 247, 0.15);
  --accent-gradient: linear-gradient(135deg, var(--accent), var(--accent-2));

  /* Cores semânticas */
  --green: #00e676;
  --red: #ff5252;
  --orange: #ffab00;

  /* Bordas e sombras */
  --border: #2a2a3e;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 8px 32px var(--accent-glow);

  /* Tipografia */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Espaçamentos */
  --section-gap: 80px;
  --container-max: 1100px;
}

/* ===================================================================
   2. TEMA CLARO
   =================================================================== */
.light-theme,
[data-theme='light'] {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #f0f0f5;
  --surface-3: #e4e4ed;
  --text: #1a1a2e;
  --text-2: #5a5a70;
  --text-3: #88889a;
  --border: #d4d4e0;
  --accent-glow: rgba(79, 195, 247, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ===================================================================
   3. RESET BASE
   =================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-2);
}

/* ===================================================================
   4. LAYOUT
   =================================================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

section {
  padding: var(--section-gap) 0;
}

/* ===================================================================
   5. TIPOGRAFIA
   =================================================================== */
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
  line-height: 1.2;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================================================================
   6. BOTÕES
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}
.btn-primary:hover {
  background: #6fd4fa;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: #0a0a0f;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
}

/* ===================================================================
   7. BADGES
   =================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.badge-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-glow);
  color: var(--accent);
}

/* ===================================================================
   8. CARDS
   =================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

/* Project card */
.project-card {
  display: flex;
  flex-direction: column;
}

.project-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.project-card p {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 16px;
  flex: 1;
}

.project-card .techs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.project-card .techs span {
  padding: 2px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
}

.project-card .links {
  display: flex;
  gap: 16px;
}

.project-card .links a {
  color: var(--text-3);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-card .links a:hover {
  color: var(--accent);
}

/* Service card */
.service-card {
  display: flex;
  flex-direction: column;
}

.service-card .icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.service-card p {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 16px;
  flex: 1;
}

.service-card .service-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  transition: gap 0.2s;
}

.service-card .service-cta:hover {
  gap: 10px;
}

/* ===================================================================
   9. GRIDS
   =================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* ===================================================================
   10. SKILL CHIPS
   =================================================================== */
.skill-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.skill-chip:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.skill-chip .icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 6px;
}

/* ===================================================================
   11. SOCIAL CARDS
   =================================================================== */
.social-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.social-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}

.social-card .emoji { font-size: 1.5rem; }
.social-card .label { font-size: 0.8rem; color: var(--text-3); }
.social-card .handle { font-weight: 600; font-size: 0.9rem; }

/* ===================================================================
   12. ESTADOS (loading, vazio, erro)
   =================================================================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-2);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-2); font-size: 0.9rem; }

.error-state {
  text-align: center;
  padding: 60px 24px;
}

.error-state .error-icon { font-size: 3rem; margin-bottom: 16px; }
.error-state .error-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.error-state .error-message { color: var(--text-2); font-size: 0.9rem; margin-bottom: 20px; }

.error-retry {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.error-retry:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ===================================================================
   13. NAV / HEADER
   =================================================================== */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--accent);
}

.theme-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text);
}

.theme-btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 200;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===================================================================
   14. HERO
   =================================================================== */
.hero {
  padding: 80px 0 60px;
  display: flex;
  align-items: center;
  gap: 60px;
}

.hero-content { flex: 1; }

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 560px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--accent);
  box-shadow: 0 0 60px var(--accent-glow);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===================================================================
   15. FOOTER
   =================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 0.8rem;
}

/* ===================================================================
   16. BACK TO TOP
   =================================================================== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-glow);
  z-index: 100;
  font-weight: 700;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--accent-glow);
}

/* ===================================================================
   17. CTA SECTION
   =================================================================== */
.cta-section {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
}

.cta-section h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.cta-section p {
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 24px;
  font-size: 1rem;
}

/* ===================================================================
   18. RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
  :root {
    --section-gap: 48px;
  }

  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding: 40px 0;
    gap: 32px;
  }

  .hero h1 { font-size: 2.2rem; }
  .hero p { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-avatar { width: 140px; height: 140px; }

  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
  .services-grid { grid-template-columns: 1fr; }
  .cta-section { padding: 32px 20px; }
  .cta-section h2 { font-size: 1.2rem; }
  .section-title { font-size: 1.5rem; }

  /* Mobile nav */
  .hamburger { display: flex; }

  .nav-links {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 20px;
    gap: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 150;
  }

  .nav-links.open { display: flex !important; }

  .nav-links a {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
  }

  .nav-links a:last-of-type { border-bottom: none; }

  .nav-links .theme-btn {
    margin-top: 8px;
    width: auto;
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

@media (max-width: 375px) {
  .hero h1 { font-size: 1.8rem; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}
