/* ===== Variáveis de tema ===== */
:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --card: #1c222b;
  --border: #2a313c;
  --text: #e6edf3;
  --text-muted: #9aa5b1;
  --accent: #f89820;        /* laranja do Java */
  --accent-2: #6db33f;      /* verde do Spring */
  --accent-soft: rgba(248, 152, 32, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --header-h: 70px;
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --border: #e1e5ea;
  --text: #1b1f24;
  --text-muted: #57606a;
  --accent: #d9730d;
  --accent-2: #4a8f26;
  --accent-soft: rgba(217, 115, 13, 0.1);
  --shadow: 0 10px 30px rgba(20, 30, 50, 0.08);
}

/* ===== Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  -webkit-text-size-adjust: 100%;   /* iPhone não aumenta a fonte ao girar a tela */
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

.mono {
  font-family: "JetBrains Mono", monospace;
}

.container {
  width: min(1100px, 100% - 32px);
  margin-inline: auto;
}

/* ===== Botões ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--accent);
  transition: transform 0.2s, background 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--accent);
  color: #111;
}

.btn--outline {
  background: transparent;
  color: var(--accent);
}

.btn--outline:hover {
  background: var(--accent-soft);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

/* ===== Cabeçalho ===== */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 100;
  -webkit-backdrop-filter: blur(10px);   /* Safari/iOS */
  backdrop-filter: blur(10px);
  background: var(--bg);                 /* fallback para navegadores antigos */
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.header.scrolled {
  border-bottom-color: var(--border);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
}

.logo span {
  color: var(--text);
}

.nav__menu {
  display: flex;
  gap: 28px;
}

.nav__link {
  font-size: 0.95rem;
  color: var(--text-muted);
  position: relative;
  transition: color 0.2s;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s;
}

.nav__link:hover,
.nav__link.active {
  color: var(--text);
}

.nav__link.active::after,
.nav__link:hover::after {
  width: 100%;
}

.nav__actions {
  display: flex;
  gap: 10px;
}

/* botão de idioma */
.lang-btn {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
}

.lang-btn span {
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

html[lang="pt-BR"] .lang-btn [data-lang="pt"],
html[lang="en"] .lang-btn [data-lang="en"] {
  background: var(--accent);
  color: #111;
}

/* títulos de seção: o <b> só serve para o texto traduzível */
.section__title b {
  font-weight: inherit;
}

/* ícones do tema */
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* botão hambúrguer */
.nav__toggle {
  display: none;
  gap: 4px;
  align-content: center;
}

.nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

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

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  min-height: 100svh;   /* no celular, desconta a barra de endereço */
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 60px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 48px;
}

.hero__tag {
  color: var(--accent);
  margin-bottom: 8px;
}

.hero__title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
}

.hero__subtitle {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 500;
  color: var(--accent-2);
  margin: 12px 0 20px;
  min-height: 2.2em;
}

.cursor {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

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

.hero__desc {
  color: var(--text-muted);
  max-width: 540px;
  font-size: 1.05rem;
}

.hero__desc strong {
  color: var(--text);
}

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 20px;
}

.hero__location {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* janela de código */
.code-window {
  background: #0b0f14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-10px); }
}

.code-window__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #151a21;
  border-bottom: 1px solid #222a35;
}

.code-window__bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f56;
}

.code-window__bar span:nth-child(2) { background: #ffbd2e; }
.code-window__bar span:nth-child(3) { background: #27c93f; }

.code-window__bar p {
  margin-left: 10px;
  font-size: 0.8rem;
  color: #8b949e;
}

.code-window pre {
  padding: 20px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #c9d1d9;
  overflow-x: auto;
}

.code-window .k { color: #ff7b72; }
.code-window .t { color: #79c0ff; }
.code-window .s { color: #a5d6ff; }

/* ===== Seções ===== */
.section {
  padding: 90px 0;
}

.section:nth-of-type(odd) {
  background: var(--bg-alt);
}

.section__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section__title span {
  color: var(--accent);
  font-size: 0.7em;
}

.section__title::after {
  content: "";
  flex: 1;
  max-width: 260px;
  height: 1px;
  background: var(--border);
}

/* ===== Sobre ===== */
.about {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: start;
}

.about__text p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about__text strong {
  color: var(--text);
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.about__stats li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.about__stats strong {
  display: block;
  font-size: 1.8rem;
  color: var(--accent);
}

.about__stats span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Projetos ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.filter {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter.active,
.filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

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

.card.hidden {
  display: none;
}

.card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card__icon {
  font-size: 1.8rem;
}

.card__links {
  display: flex;
  gap: 14px;
}

.card__link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.card__link:hover {
  text-decoration: underline;
}

.card h3 {
  font-size: 1.2rem;
}

.card__sub {
  font-size: 0.9rem;
  color: var(--accent-2);
  margin-bottom: 14px;
}

.card__list {
  flex: 1;
  margin-bottom: 18px;
}

.card__list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.93rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card__list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.more {
  text-align: center;
  margin-top: 36px;
  color: var(--text-muted);
}

.more a {
  color: var(--accent);
  font-weight: 600;
}

/* ===== Experiência ===== */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}

.timeline__item {
  position: relative;
  margin-bottom: 36px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline__date {
  font-size: 0.82rem;
  color: var(--accent);
}

.timeline__item h3 {
  font-size: 1.15rem;
  margin: 4px 0 8px;
}

.timeline__item h3 span {
  color: var(--accent-2);
}

.timeline__item p {
  color: var(--text-muted);
  max-width: 720px;
}

/* ===== Competências ===== */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.skill-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.skill-group h3 {
  font-size: 1rem;
  margin-bottom: 14px;
}

/* ===== Formação ===== */
.education {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.edu-card {
  display: flex;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
}

.edu-card h3 {
  font-size: 1.15rem;
}

.edu-card p:last-child {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.courses li {
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.courses li:first-child {
  padding-top: 0;
}

.courses strong {
  font-weight: 600;
  font-size: 0.97rem;
}

.courses span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Contato ===== */
.contact {
  text-align: center;
}

.contact .section__title {
  justify-content: center;
}

.contact .section__title::after {
  display: none;
}

.contact__text {
  color: var(--text-muted);
  max-width: 520px;
  margin: -16px auto 28px;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.toast {
  margin-top: 18px;
  min-height: 1.5em;
  color: var(--accent-2);
  font-weight: 600;
}

/* ===== Rodapé ===== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px max(16px, calc((100% - 1100px) / 2));
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer__top:hover {
  color: var(--accent);
}

/* ===== Abertura com quadradinhos ===== */
/* esconde a página até o JS montar a abertura (e mostra sozinho após 2,5s caso o JS falhe) */
.intro-loading body > :not(.intro) {
  visibility: hidden;
  animation: intro-failsafe 0s 2.5s forwards;
}

@keyframes intro-failsafe {
  to { visibility: visible; }
}

/* os quadradinhos são desenhados num <canvas> pelo script.js:
   uma imagem só, então não sobram frestas entre eles em nenhum zoom de tela */
.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.intro canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.intro__logo {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
}

.intro.play .intro__logo {
  animation: logo-in 0.35s ease both, logo-out 0.3s ease 0.6s forwards;
}

.intro__logo span {
  color: var(--text);
}

@keyframes logo-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}

@keyframes logo-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: scale(1.1); }
}

/* ===== Animação ao rolar ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .code-window, .cursor { animation: none; }
}

/* ===== Responsivo ===== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .about,
  .education {
    grid-template-columns: 1fr;
  }
}

/* menu vira "hambúrguer" antes de os links encostarem no logo e nos botões */
@media (max-width: 980px) {
  .nav__toggle {
    display: grid;
  }

  .nav__menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .nav__menu.open {
    max-height: 400px;
  }

  .nav__menu li a {
    display: block;
    padding: 14px 24px;
  }

  .nav__link::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .section {
    padding: 70px 0;
  }

  .projects,
  .skills {
    grid-template-columns: 1fr;
  }

  .code-window pre {
    font-size: 0.75rem;
  }

  /* e-mail cabe numa linha só, sem o emoji quebrar */
  #copyEmail {
    padding: 12px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }
}

/* telas de toque: sem efeito de hover "preso" depois do toque */
@media (hover: none) {
  .btn:hover,
  .card:hover {
    transform: none;
  }

  .card:hover {
    border-color: var(--border);
    box-shadow: none;
  }
}
