:root {
  --fundo: #E4E6E8;
  --papel: #FFFFFF;
  --tinta: #000000;
  --suave: #464B50;
  --led: #C80000;
  --botao: #C80000;
  --linha: rgba(0, 0, 0, .28);
  --raio: 6px;
  --coluna: 9rem;
}
[data-tema="escuro"] {
  --fundo: #000000;
  --papel: #1B1D1F;
  --tinta: #F2F3F4;
  --suave: #A3A8AD;
  --led: #FF3B30;
  --botao: #D81B14;
  --linha: rgba(255, 255, 255, .28);
}

/* ===== BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--fundo);
  color: var(--tinta);
  transition: background .3s, color .3s;
}
ul { list-style: none; }
p { max-width: 62ch; }
p + p { margin-top: .8rem; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--led); }
:focus-visible { outline: 3px solid var(--led); outline-offset: 3px; }

h1, h2, h3 { line-height: 1; }
h1, h2 { font-stretch: 62%; font-weight: 900; letter-spacing: -.01em; }
h1 { font-size: clamp(3.4rem, 10vw, 7rem); line-height: .92; }
h2 { font-size: clamp(2.6rem, 6vw, 4.2rem); }
h3 { font-stretch: 85%; font-weight: 700; font-size: 1.3rem; line-height: 1.15; }

.conteiner { width: min(1100px, 92%); margin-inline: auto; }
.secao { padding: clamp(4rem, 9vw, 7rem) 0; }
.secao.alternada { background: var(--papel); }

/* ===== CABEÇALHO ===== */
.cabecalho {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  background: var(--fundo); border-bottom: 2px solid var(--tinta);
}
.navegacao { display: flex; align-items: center; gap: 1rem; height: 68px; }
.logo { margin-right: auto; text-decoration: none; font-stretch: 62%; font-weight: 900; font-size: 1.7rem; }
.logo span { color: var(--led); }
.menu { order: 1; display: flex; gap: .25rem; }
.menu a { display: block; padding: .4rem .8rem; text-decoration: none; font-weight: 600; }
.menu a:hover { color: inherit; box-shadow: inset 0 -3px var(--tinta); }
.menu a.ativo { box-shadow: inset 0 -3px var(--led); }

.interruptor { order: 2; display: flex; cursor: pointer; }
.interruptor-caixa { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor-trilho { position: relative; width: 44px; height: 24px; border: 2px solid var(--tinta); border-radius: 99px; }
.interruptor-trilho::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--tinta); transition: transform .2s;
}
.interruptor-caixa:checked ~ .interruptor-trilho::after { transform: translateX(20px); }
.interruptor-caixa:focus-visible ~ .interruptor-trilho { outline: 3px solid var(--led); outline-offset: 3px; }

.botao-menu {
  order: 3; display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 40px; height: 40px; background: transparent; cursor: pointer;
  border: 2px solid var(--tinta); border-radius: var(--raio);
}
.botao-menu .barra { width: 18px; height: 2px; background: var(--tinta); }

/* ===== HERO + ETIQUETA ===== */
.hero { padding-top: calc(68px + clamp(3rem, 8vw, 6rem)); }
.hero-grade { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .8fr); gap: 3rem; align-items: center; }
.hero p { margin-top: 1.5rem; }
.botao {
  display: inline-block; margin-top: 1.5rem; padding: .8rem 1.6rem; cursor: pointer;
  background: var(--botao); color: #fff; border: 0; border-radius: var(--raio);
  font: inherit; font-weight: 700; text-decoration: none;
}
.botao:hover { color: #fff; filter: brightness(1.15); }

.etiqueta {
  --furo: 22px;
  position: relative; justify-self: center; width: min(100%, 320px);
  padding: 3.8rem 1.4rem 1.4rem;
  background: #fff; color: #000; border: 2px solid #000;
  border-radius: 14px 14px var(--raio) var(--raio);
  transform-origin: 50% 1.5rem;
  transform: rotate(2.5deg);
  animation: balanco 1.4s cubic-bezier(.3, 1.4, .5, 1) both;
}
.etiqueta::before {
  content: ""; position: absolute; top: 1rem; left: 50%;
  width: var(--furo); height: var(--furo); margin-left: calc(var(--furo) / -2);
  border-radius: 50%; background: var(--fundo); border: 2px solid #000;
}
@keyframes balanco { from { transform: rotate(-9deg); } to { transform: rotate(2.5deg); } }
.foto { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border: 2px solid #000; border-radius: var(--raio); margin-bottom: 1rem; }
.etiqueta dt { font-size: .82rem; font-weight: 600; color: #464B50; }
.etiqueta dd { font-weight: 700; padding-bottom: .55rem; margin-bottom: .55rem; border-bottom: 1px solid rgba(0, 0, 0, .25); }
.etiqueta dd:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

/* ===== FORMAÇÃO (registro) ===== */
.registro { margin-top: 2.5rem; border-top: 2px solid var(--tinta); }
.registro-item {
  display: grid; grid-template-columns: var(--coluna) minmax(0, 1fr) auto;
  gap: .5rem 2rem; align-items: start;
  padding: 1.5rem 0; border-bottom: 1px solid var(--linha);
}
.registro-item p, .registro-meta { color: var(--suave); }
.registro-meta { text-align: right; }
.situacao { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; }
.situacao::before { content: ""; flex: none; width: .7rem; height: .7rem; border-radius: 50%; background: var(--tinta); }
.situacao.ativa::before { background: var(--led); box-shadow: 0 0 0 4px color-mix(in srgb, var(--led) 25%, transparent); }
.registro-item a { font-weight: 600; }
.registro details { margin-top: .8rem; }
.registro summary { cursor: pointer; font-weight: 600; width: fit-content; text-underline-offset: 3px; text-decoration: underline; text-decoration-thickness: 2px; }
.modulos { margin-top: .6rem; }
.modulos li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; padding: .6rem 0; border-top: 1px solid var(--linha); }
.modulos small { color: var(--suave); }

.pratica { margin-top: 3rem; }
.pratica dl { display: grid; grid-template-columns: var(--coluna) minmax(0, 1fr); gap: .6rem 2rem; margin-top: 1rem; }
.pratica dt { font-weight: 700; }

/* ===== PORTFÓLIO (vitrine desigual) ===== */
.vitrine { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.25rem; margin-top: 2.5rem; }
.projeto { display: flex; flex-direction: column; gap: .6rem; padding: 1.5rem; border: 2px solid var(--tinta); border-radius: var(--raio); }
.projeto .tecnologias { color: var(--suave); }
.projeto a { font-weight: 600; margin-top: auto; width: fit-content; }
.projeto-principal {
  grid-row: span 2; justify-content: flex-end; min-height: 22rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  background: var(--tinta); color: var(--fundo);
}
.projeto-principal h3 { font-stretch: 62%; font-weight: 900; font-size: clamp(2.6rem, 5vw, 4rem); line-height: .95; }
.projeto-principal .tecnologias { color: inherit; }
.projeto-principal a:hover { color: inherit; text-decoration-thickness: 4px; }

/* ===== CONTATO ===== */
.contato-grade { display: grid; grid-template-columns: 1fr 1.1fr; gap: 4rem; align-items: start; }
.contato-grade p { margin-top: 1rem; }
.campo { margin-bottom: 1.1rem; }
label { display: block; font-weight: 700; margin-bottom: .3rem; }
input, textarea {
  width: 100%; padding: .75rem; font: inherit; color: var(--tinta);
  background: transparent; border: 2px solid var(--tinta); border-radius: var(--raio);
}
input:focus, textarea:focus { outline: 3px solid var(--led); outline-offset: 2px; }
.invalido { border-color: var(--led); }
.erro { display: block; min-height: 1.2em; margin-top: .3rem; color: var(--led); font-weight: 600; }

.redes { display: flex; gap: .75rem; margin-top: 2rem; }
.rede-link {
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 2px solid var(--tinta); border-radius: var(--raio); transition: background .2s;
}
.rede-link::before {
  content: ""; width: 22px; height: 22px; background: var(--tinta);
  -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat;
}
.rede-link:hover { background: var(--tinta); }
.rede-link:hover::before { background: var(--fundo); }
.whatsapp  { --icone: url('../img/icones/whatsapp.svg'); }
.instagram { --icone: url('../img/icones/instagram.svg'); }
.github    { --icone: url('../img/icones/github.svg'); }
.linkedin  { --icone: url('../img/icones/linkedin.svg'); }

.rodape { padding: 1.5rem 0; border-top: 2px solid var(--tinta); color: var(--suave); }
.rodape p { width: min(1100px, 92%); margin-inline: auto; max-width: none; text-align: center; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0, 0, 0, .6); }
.modal[hidden] { display: none; }
.modal-caixa { width: min(92%, 420px); padding: 2rem; background: var(--papel); border: 2px solid var(--tinta); border-radius: var(--raio); }
.modal-caixa p { margin: .6rem 0 1.2rem; }

/* ===== RESPONSIVO ===== */
@media (max-width: 760px) {
  .botao-menu { display: flex; }
  .menu {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; padding: .6rem 4%;
    background: var(--fundo); border-bottom: 2px solid var(--tinta);
  }
  .menu.aberto { display: flex; }
  .hero-grade, .contato-grade, .vitrine { grid-template-columns: 1fr; }
  .contato-grade { gap: 2.5rem; }
  .projeto-principal { grid-row: auto; min-height: 16rem; }
  .registro-item, .pratica dl { grid-template-columns: 1fr; gap: .3rem; }
  .registro-meta { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .etiqueta { animation: none; }
  html { scroll-behavior: auto; }
}
