:root {
  /* Modo escuro como padrão */
  --bg: #1a1a2e;
  --text: #f1f1f1;
  --primary: #7f5af0;
  --secondary: #ffffff;
  --accent: #06d6a0;
  --code-bg: #000000;
  --code-top: #6145b4;
  --card-bg: #313153;
  --card-text: #f1f1f1;
  --border: #404040;
  --hover: #3f3f5f;
}

[data-theme="light"] {
  /* Modo claro como alternativo */
  --bg: #f2ecff;
  --text: #1a1a1a;
  --primary: #7f5af0;
  --secondary: #6d28d9;
  --accent: #059669;
  --code-bg: #6b51bb;
  --code-top: #6d28d9;
  --card-bg: #ffffff;
  --card-text: #1e1e2f;
  --border: #e5e5e5;
  --hover: #f3f4f6;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Fredoka', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: all 0.3s ease;
  margin: 0;
  padding: 2rem;
  display: flex;
  justify-content: center;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  width: 100%;
}

/* Header com nome e links sociais */
.header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.nome {
  font-family: monospace;
  color: var(--primary);
  font-size: 2rem;
  margin: 0;
  font-weight: 600;
}

/* Botão/Link do "y" para ypla.dev */
.y-link {
  display: inline-block;
  margin: 0 4px;
  padding: 0 .25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: all .2s ease;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.y-link:hover {
  color: #fff;
}

.social-links {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  cursor: pointer; /* clique visível */
}

.social-link:hover {
  background: white;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
}

.social-link i {
  font-size: 1.5rem;
}

.descricao{
  padding-top: 3%;
  padding-bottom: 3%;
  max-width: 900px;   /* mais compacta */
  line-height: 1.5;
}

/* Code Block */
.code-block {
  background: var(--code-bg);
  color: #ffffff;
  border-radius: 10px;
  font-family: monospace;
  font-size: 0.9rem;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  margin-bottom: 3rem;
}

.code-header {
  background: var(--code-top);
  padding: 0.5rem 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  height: 2rem;
}

.code-header .btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* Círculo vermelho com cor "comunismo" e estado playing */
.code-header .red {
  background-color: #c62828 !important; /* sobrepõe o #ff5f56 */
  cursor: pointer;
}
.code-header .btn.red.playing {
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.35);
}

.code-header .yellow {
  background-color: #ffbd2e;
}

.code-header .blue {
  background-color: #68b5f3;
}

.code-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.code-section{
  color: #ffbd2e;
}

.code-block pre {
  margin: 0;
  padding: 1rem;
  white-space: pre-wrap;
  flex: 1;
}

/* Download Button */
.download-section {
  padding-bottom: 10px;
  padding-right: 10px;
  display: flex;
  align-items: center;
  justify-content: right;
}

.download-btn {
  display: flex;
  align-items: center;
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-family: sans-serif;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.download-btn:hover {
  color: var(--primary);
}

.download-btn i {
  font-size: 1rem;
}

/* Projetos */
.projetos {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
}

.card-projeto {
  font-family: 'Fredoka', sans-serif;
  background: var(--card-bg);
  color: var(--card-text);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: left;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1.5rem;
  align-items: start;
  border: 1px solid var(--border);
  animation: fadeInUp 0.6s ease forwards; /* animação de entrada */
}

.card-projeto:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.projeto-content h2 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.projeto-content p {
  margin-bottom: 1rem;
  opacity: 0.9;
}

/* Tech Stack */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--hover);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 90%;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.tech-item:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.tech-item i {
  font-size: 1rem;
}

/* Projeto Links */
.projeto-titulo{
  color: var(--primary);
  text-decoration: none;
  font-size: 24px;
  font-weight: 500;
}

.projeto-titulo:hover{
  color: var(--secondary);
}

.projeto-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.projeto-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--primary);
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.projeto-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.projeto-link i {
  font-size: 0.9rem;
}

/* Projeto Image */
.projeto-image {
  width: 200px;
  height: 300px;
  background: var(--hover);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.8;
  font-size: 0.9rem;
  border: 2px dashed var(--border);
  text-align: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.projeto-image:hover {
  opacity: 1;
  border-color: var(--primary);
}

.projeto-image i {
  font-size: 2rem;
  color: var(--primary);
}

.projeto-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}


/* Animações */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsividade */
@media (max-width: 740px) {
  body {
    padding: 1rem;
  }

  .header-section {
    flex-direction: column;
    align-items: center;
  }

  .social-links {
    order: 1;
    justify-content: center;
    padding-top: 2%;
    padding-bottom: 2%;
    width: 100%;
  }

  .social-link i {
    font-size: 1.5rem;
    color: white;
    border-radius: 50%;
  }

  .card-projeto {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .projeto-image {
    width: 100%;
  }

  .nome {
    font-size: 2rem;
  }

  .code-content {
    flex-direction: column;
  }

  .projeto-links {
    gap: 1rem;
    justify-content: center;
  }

  .projeto-link{
    width: 100%;
  }

  .tech-stack {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nome{
    font-size: 2rem;
  }

  .social-link i {
    font-size: 1.5rem;
    color: white;
    background: var(--primary);
    border-radius: 50%;
  }

  .tech-item {
    font-size: 90%;
  }
}

@media (max-width: 350px) {
  .social-links {
    gap: 0px;
  }

  .social-link i {
    font-size: 1.5rem;
    color: white;
    background: var(--primary);
    border-radius: 50%;
  }

  .tech-item {
    font-size: 90%;
  }
}
