@import url('https://fonts.googleapis.com/css2?family=Ribeye+Marrow&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Ribeye Marrow", serif;
  font-weight: 400;
  font-style: normal;
  background-color: #0e0e0e;
  color: white;
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ===============================
   TABS — lógica central
================================ */

.tab {
  display: none;
}

/* todas as tabs ativas: flex column, ocupam tudo */
.tab.active {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* INÍCIO: centraliza perfil, permite absolute dos filhos */
.tab.active#inicio {
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* PROJETOS: scroll interno na grid */
.tab.active#projetos {
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
}

/* PLACEHOLDERS (contatos/feedback): centraliza texto */
.tab.active#contatos,
.tab.active#feedback {
  align-items: center;
  justify-content: center;
}

/* ===============================
   PROJETOS — cards
================================ */

.tab.active#projetos .projetos-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.tab.active#projetos .projeto-card {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tab.active#projetos .projeto-preview {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.tab.active#projetos .projeto-desc {
  font-size: 0.9rem;
  color: #ccc;
  flex-grow: 1;
  text-align: justify;
}

.tab.active#projetos .projeto-botoes {
  display: flex;
  gap: 10px;
}

.tab.active#projetos .projeto-botoes img {
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.tab.active#projetos .projeto-botoes img:hover {
  transform: scale(1.1);
  opacity: 0.85;
}

/* ===============================
   FUNDO DE ESTRELAS
================================ */

.dot-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.dot {
  position: absolute;
  background: white;
  border-radius: 50%;
  width: 2px;
  height: 2px;
  opacity: 0.5;
  filter: drop-shadow(0 0 2px white);
  animation: twinkle linear infinite;
}

@keyframes twinkle {
  0%   { opacity: 0.2; transform: scale(0.5); }
  50%  { opacity: 1;   transform: scale(1.2); }
  100% { opacity: 0.2; transform: scale(0.7); }
}

/* ===============================
   SIDEBAR (DESKTOP)
================================ */

.sidebar {
  width: 450px;
  background: rgba(0, 0, 0, 0.493);
  border-right: 1px solid rgba(255, 255, 255, 0.308);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 20px;
  text-align: center;
  z-index: 10;
  position: relative;
  background-size: 200% 200%;
  animation: sidebarGradient 12s ease infinite;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

@keyframes sidebarGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.sidebar-menu {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.sidebar a {
  color: white;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: bold;
  padding: 10px;
  border: 3px solid transparent;
  transition: border 0.2s;
  display: inline-block;
}

.sidebar a:hover {
  border: 3px solid white;
}

.sidebar a.active {
  border: 3px solid white;
}

.sidebar-footer {
  padding-top: 40px;
  font-size: 1.2rem;
  opacity: 0.7;
}

/* ===============================
   LINGUA
================================ */

.sidebar-lang {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 10px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 2px solid transparent;
  padding: 6px 10px;
  cursor: pointer;
  transition: border 0.2s, transform 0.2s;
}

.lang-btn img {
  width: 28px;
  height: auto;
  display: block;
}

.lang-text {
  font-size: 13px;
  color: #ddd;
  white-space: nowrap;
  font-family: "Ribeye Marrow", serif;
}

.lang-btn:hover {
  border-color: #555;
  transform: scale(1.05);
}

.lang-btn.active {
  border-color: #aaa;
  background-color: rgba(255, 255, 255, 0.05);
}

.lang-btn.active .lang-text {
  color: #fff;
  font-weight: 600;
}

/* ===============================
   CONTEUDO PRINCIPAL
================================ */

/* content nao faz scroll — cada tab cuida do proprio scroll */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  z-index: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/* tab-container ocupa tudo */
.tab-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

/* ===============================
   BOLINHAS DE TOPO
================================ */

.bolinhas-topo {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  padding: 15px;
  animation: slideDown 0.6s ease-out forwards;
  opacity: 0;
  z-index: 2;
  white-space: nowrap;
}

.bolinhas-topo img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.4));
  transition: transform 0.3s ease;
}

.bolinhas-topo img:hover {
  transform: scale(1.2);
}

@keyframes slideDown {
  0%   { transform: translate(-50%, -30px); opacity: 0; }
  100% { transform: translateX(-50%);       opacity: 1; }
}

/* ===============================
   PERFIL
================================ */

.perfil {
  text-align: center;
  position: relative;
  z-index: 1;
}

.perfil #profile {
  width: 325px;
  height: auto;
  object-fit: cover;
  border-radius: 50%;
  border: 15px solid #cfcfcf07;
  margin-bottom: 20px;
}

#br-flag {
  width: 32px;
  height: auto;
}

.perfil h2 {
  font-size: 1.8rem;
  font-weight: bold;
}

.perfil h3 {
  font-size: 1.7rem;
  opacity: 0.9;
  margin-top: 10px;
}

/* ===============================
   CURSOR / TYPING
================================ */

.cursor {
  display: inline-block;
  animation: blink 1s steps(1) infinite;
  font-weight: bold;
}

@keyframes blink {
  50% { opacity: 0; }
}

.rainbow-text {
  background: linear-gradient(90deg, #444444, #939393, #d2d2d2);
  background-size: 400%;
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbowAnimation 6s linear infinite;
}

@keyframes rainbowAnimation {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

/* ===============================
   CONTACTS (DESKTOP: lateral direita)
================================ */

.contacts {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  z-index: 2;
}

.contacts img {
  width: 50px;
  height: 50px;
  transition: transform 0.3s ease;
}

.contacts img:hover {
  transform: scale(1.2);
}

/* ===============================
   CONTATOS
================================ */

.contatos-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  backdrop-filter: blur(6px);
}

.contatos-card h2 {
  font-size: 1.6rem;
}

.contatos-card p {
  font-size: 0.95rem;
  color: #aaa;
  line-height: 1.6;
}

.mailto-btn {
  display: inline-block;
  padding: 10px 20px;
  border: 2px solid white;
  color: white;
  text-decoration: none;
  font-family: "Ribeye Marrow", serif;
  font-size: 1.2rem;
  background: transparent;
  transition: 0.2s;
  margin-top: 10px;
}

.mailto-btn:hover {
  background: white;
  color: black;
}

/* ===============================
   FEEDBACK
================================ */

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 90%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px;
  backdrop-filter: blur(6px);
}

.tab.active#feedback h2 {
  margin-bottom: 4px;
  font-size: 1.6rem;
}

.tab.active#feedback > p {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.feedback-form input,
.feedback-form textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  font-family: "Ribeye Marrow", serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
  border-color: rgba(255, 255, 255, 0.5);
}

.feedback-form input::placeholder,
.feedback-form textarea::placeholder {
  color: #666;
}

.fb-estrelas {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fb-estrelas > span:first-child {
  font-size: 0.9rem;
  color: #aaa;
}

.estrelas {
  display: flex;
  gap: 4px;
}

.estrelas span {
  font-size: 1.8rem;
  cursor: pointer;
  color: #444;
  transition: color 0.15s, transform 0.1s;
  line-height: 1;
}

.estrelas span:hover {
  transform: scale(1.15);
}

.estrelas span.ativa {
  color: #f5a623;
}

#fb-estrelas-label {
  font-size: 0.85rem;
  color: #aaa;
}

#fb-enviar {
  background: transparent;
  border: 2px solid white;
  color: white;
  font-family: "Ribeye Marrow", serif;
  font-size: 1rem;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  align-self: flex-start;
  margin-top: 4px;
}

#fb-enviar:hover:not(:disabled) {
  background: white;
  color: #0e0e0e;
  transform: scale(1.04);
}

#fb-enviar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fb-status {
  font-size: 0.88rem;
  margin-top: 2px;
}

.fb-status.sucesso { color: #4caf50; }
.fb-status.erro    { color: #e74c3c; }

/* ===============================
   FEEDBACK + CONTATOS — mobile
================================ */

@media (max-width: 768px) {
  .contatos-card,
  .feedback-form {
    padding: 28px 20px;
  }

  .tab.active#feedback,
  .tab.active#contatos {
    justify-content: flex-start;
    padding-top: 80px;
  }
}

/* ===============================
   HAMBURGUER (escondido no desktop)
================================ */

.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px;
  transition: border-color 0.2s;
}

.hamburger:hover {
  border-color: rgba(255,255,255,0.6);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===============================
   OVERLAY (mobile)
================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.sidebar-overlay.visible {
  opacity: 1;
}

/* ===============================
   MOBILE <= 768px
================================ */

@media (max-width: 768px) {

  body {
    overflow: clip;
  }

  .hamburger {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  /* sidebar vira drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    z-index: 100;
    transform: translateX(-100%);
    padding: 40px 20px 30px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* content e tab-container ocupam tela toda */
  .content {
    width: 100%;
    height: 100vh;
    overflow: clip;
  }

  .tab-container {
    height: 100%;
    overflow: hidden;
    flex: 1 0 0; 
    min-height: 0; /* necessário no Safari para flex children com overflow */
  }

  /* cada tab ativa: tem seu proprio scroll vertical */
  .tab.active {
    height: 100%;
    overflow-y: auto;
    min-height: 0;
    overflow-x: hidden;
    padding: 70px 16px 24px; /* espaco pro hamburguer no topo */
    align-items: center;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  /* inicio: position relative para os filhos absolutos */
  .tab.active#inicio {
    position: relative;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* bolinhas: sai do absolute, quebra em linhas */
  .bolinhas-topo {
    position: relative;
    top: unset;
    left: unset;
    transform: none;
    animation: none;
    opacity: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    white-space: normal;
    gap: 12px;
    padding: 0 0 12px;
    width: 100%;
    margin-bottom: 4px;
  }

  .bolinhas-topo img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  /* tab-content centraliza o perfil */
  .tab-content {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .perfil #profile {
    width: 250px;
    border-width: 8px;
  }

  .perfil h2 {
    font-size: 1.15rem;
  }

  .perfil h3 {
    font-size: 1.05rem;
  }

  /* contacts: horizontal abaixo do perfil */
  .contacts {
    position: relative;
    right: unset;
    top: unset;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding: 0 0 16px;
  }

  .contacts img {
    width: 42px;
    height: 42px;
  }

  /* projetos: coluna unica, scroll da propria tab */
  .tab.active#projetos {
    overflow-y: auto;
    align-items: stretch;
  }

  .tab.active#projetos .projetos-container {
    grid-template-columns: 1fr;
    overflow-y: visible;
    max-width: 100%;
    padding: 0 4px 20px;
    flex: unset;
  }

  /* sidebar */
  .sidebar a {
    font-size: 1.15rem;
  }

  .sidebar-menu ul {
    gap: 22px;
  }

  .sidebar-footer {
    font-size: 0.9rem;
  }
}

/* ===============================
   TABLET  769px - 1024px
================================ */

@media (min-width: 769px) and (max-width: 1024px) {

  .sidebar {
    width: 300px;
  }

  .sidebar a {
    font-size: 1.15rem;
  }

  .sidebar-menu ul {
    gap: 22px;
  }

  .perfil #profile {
    width: 240px;
  }

  .perfil h2 { font-size: 1.4rem; }
  .perfil h3 { font-size: 1.3rem; }

  .bolinhas-topo img {
    width: 38px;
    height: 38px;
  }

  .contacts img {
    width: 44px;
    height: 44px;
  }

  .tab.active#projetos .projetos-container {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }
}

/* ===============================
   TELA GRANDE >= 1440px
================================ */

@media (min-width: 1440px) {

  .sidebar {
    width: 480px;
  }

  .sidebar a { font-size: 1.55rem; }

  .perfil #profile { width: 370px; }
  .perfil h2 { font-size: 2rem; }
  .perfil h3 { font-size: 1.9rem; }

  .bolinhas-topo img {
    width: 52px;
    height: 52px;
  }

  .contacts img {
    width: 58px;
    height: 58px;
  }

  .tab.active#projetos .projetos-container {
    max-width: 1200px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ===============================
   TELA MUITO GRANDE >= 1920px
================================ */

@media (min-width: 1920px) {

  .sidebar { width: 520px; }
  .sidebar a { font-size: 1.7rem; }

  .perfil #profile { width: 420px; }
  .perfil h2 { font-size: 2.2rem; }
  .perfil h3 { font-size: 2rem; }

  .bolinhas-topo img {
    width: 58px;
    height: 58px;
  }

  .tab.active#projetos .projetos-container {
    max-width: 1500px;
  }
}