/* ===============================
   BASE
================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #0f172a;
  min-height: 100vh;

  background:
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
}

/* ===============================
   LAYOUT
================================ */

header,
main,
footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

section {
  margin-bottom: 5rem;
}

/* ===============================
   HEADER
================================ */

header h1 {
  font-size: 2rem;
  margin: 0;
}

header p {
  margin-top: 0.5rem;
  color: #555;
}

/* ===============================
   WORKS GRID
================================ */

#works h2 {
  margin-bottom: 2rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.work-item {
  background: #fff;
}

.work-item img {
  width: 100%;
  height: auto;
  display: block;
}

.work-item h3 {
  font-size: 1rem;
  margin: 0.75rem 0 0.25rem;
}

.work-item p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

/* ===============================
   STUDIES
================================ */

#studies article {
  max-width: 900px;
  margin-bottom: 2rem;
}

/* ===============================
   ABOUT
================================ */

#about {
  max-width: 700px;
}

/* ===============================
   CONTACT
================================ */

#contact a {
  color: inherit;
  text-decoration: underline;
}

/* ===============================
   FOOTER
================================ */

footer {
  font-size: 0.85rem;
  color: #777;
  padding-bottom: 3rem;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}
header,
main,
footer {
  position: relative;
  z-index: 1;
}
.work-item {
  background: rgba(255, 255, 255, 0.9);
}
/* ===============================
   MENU / HEADER
================================ */

.site-header {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.menu .logo {
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  letter-spacing: 0.05em;
}

.menu ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.menu a {
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
}

.menu a:hover {
  text-decoration: underline;
}

/* Header intro */

.header-intro h1 {
  font-size: 2.4rem;
  margin: 0;
}

.header-intro p {
  max-width: 700px;
  margin-top: 1rem;
  color: #475569;
}
/* ===============================
   RESPONSIVE YOUTUBE VIDEO
================================ */

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* ===============================
   STUDIES REFORMULADO
================================ */

.studies-intro {
  max-width: 800px;
  margin-bottom: 3rem;
  color: #475569;
}

.study-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 2rem;
  border-radius: 8px;
  max-width: 800px;
  transition: transform 0.2s ease;
}

.study-card:hover {
  transform: translateY(-4px);
  background: #fff;
}

.study-card h3 {
  margin-top: 0;
  font-size: 1.4rem;
  color: #0f172a;
}

.tech-stack {
  margin: 1.5rem 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tech-stack span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  background: #e2e8f0;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  color: #475569;
}

/* Accordion Style */
.tech-details {
  margin: 1.5rem 0;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.tech-details summary {
  display: list-item !important;
  font-weight: 600;
  cursor: pointer;
  color: #2563eb;
  list-style: none; /* Remove a seta padrão em alguns browsers */
}

.tech-details summary::before {
  content: "+ "; /* Símbolo manual simples */
}

.tech-details[open] summary::before {
  content: "- ";
}

.details-content {
  padding: 1rem 0;
  font-size: 0.95rem;
}

.details-content ul {
  padding-left: 1.2rem;
  margin: 0;
}

.github-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  border-bottom: 2px solid #0f172a;
}

.github-link:hover {
  color: #2563eb;
  border-color: #2563eb;
}
/* ===============================
   CONTACT FORM
================================ */

.contact-section {
  max-width: 600px; /* Formulários ficam melhor mais estreitos */
}

.contact-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.form-group input,
.form-group textarea {
  padding: 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
}

.submit-btn {
  background: #0f172a;
  color: #fff;
  padding: 1rem 2rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start; /* Botão não ocupa a largura toda */
}

.submit-btn:hover {
  background: #2563eb;
}
/* ===============================
   LANGUAGE TOGGLE (SWITCH)
================================ */
.lang-switch {
  position: fixed; /* Mantém fixo na tela */
  top: 1.5rem;     /* Distância do topo */
  right: 1.5rem;   /* Distância da direita */
  z-index: 1000;   /* Garante que fique acima de tudo (videos, cards, etc) */

  /* Estilo "Glassmorphism" para ser elegante */
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: 50px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Ajuste para mobile: se a tela for pequena, o botão pode diminuir ou mudar de lugar */
@media (max-width: 600px) {
  .lang-switch {
    top: 1rem;
    right: 1rem;
    padding: 6px 10px;
  }
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #0f172a;
}

input:checked + .slider:before {
  transform: translateX(14px);
}

/* ===============================
   LOGIC: SHOW/HIDE LANGUAGES (FIXED)
================================ */

/* Esconde a versão PT por padrão */
[lang="pt"] {
  display: none !important;
}

/* Quando o idioma for PT, esconde o EN */
body.lang-pt [lang="en"] {
  display: none !important;
}

/* Mostra os elementos PT respeitando seu tipo original */
body.lang-pt [lang="pt"] {
  display: block !important;
}

/* CORREÇÕES ESPECÍFICAS PARA PT */

/* Mantém links e spans como inline-block (evita a linha esticada) */
body.lang-pt a[lang="pt"],
body.lang-pt span[lang="pt"],
span[lang="en"] {
  display: inline-block !important;
}

/* Mantém o summary funcionando corretamente */
body.lang-pt summary[lang="pt"] {
  display: list-item !important;
}

/* Mantém os itens de lista com marcadores (bullets) */
body.lang-pt li[lang="pt"] {
  display: list-item !important;
}