:root {
  /* Paleta inspirada em TLoU (sem assets oficiais) */
  --bg: #0e100f;
  --panel: #141613;
  --text: #e9e7e1; /* osso */
  --muted: #b7b3a9; /* osso gasto */
  --accent: #88a06e; /* musgo */
  --accent-contrast: #1d271a; /* musgo escuro */
  --rust: #a07a56; /* ferrugem */
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --grain: radial-gradient(
      1px 1px at 10% 20%,
      rgba(255, 255, 255, 0.05) 0 1px,
      transparent 1px
    ),
    radial-gradient(
      1px 1px at 80% 10%,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px
    ),
    radial-gradient(
      1px 1px at 30% 60%,
      rgba(255, 255, 255, 0.035) 0 1px,
      transparent 1px
    ),
    radial-gradient(
      1px 1px at 70% 80%,
      rgba(255, 255, 255, 0.03) 0 1px,
      transparent 1px
    );
  --radius: 10px;
}

/* Reset/estrutura */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  line-height: 1.65;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #0b0d0b 0%, #0f110f 45%, #121412 100%),
    var(--grain);
}

/* Camadas de fundo */
#cordyceps {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34; /* intensidade do traço no fundo */
}
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.35;
  mix-blend-mode: overlay;
  z-index: 1;
}

.container {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 20px;
  position: relative;
  z-index: 2;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header + progress bar */
header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  backdrop-filter: saturate(130%) blur(6px);
  border-bottom: 1px solid var(--border);
}
.scrollbar {
  height: 3px;
  background: linear-gradient(90deg, #22301e, #2a3825, #22301e);
  width: 0%;
  transition: width 0.1s linear;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent-contrast), #0e150f);
  color: #e7f2df;
  font-weight: 900;
  font-family: "Oswald", system-ui, sans-serif;
  border: 1px solid #2a3326;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.brand-text {
  font-family: "Oswald", system-ui, sans-serif;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 700;
}
.menu-btn {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid #2a3326;
  color: #e7e3d9;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
nav {
  position: relative;
}
.nav-list {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
  position: relative;
}
.nav-underline {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: #e7f2df;
  border-radius: 2px;
  left: 0;
  width: 0;
  transition: all 0.25s ease;
}
nav a {
  text-decoration: none;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
  position: relative;
}
nav a:hover,
nav a.active {
  color: #f1efe9;
  background: color-mix(in srgb, var(--accent-contrast) 36%, transparent);
  border-color: #2a3326;
}
nav a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 40%, #fff);
  outline-offset: 2px;
}

/* Mobile nav */
@media (max-width: 720px) {
  .menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .nav-list {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: color-mix(in srgb, var(--panel) 90%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
  }
  .nav-list.open {
    display: flex;
  }
  .nav-underline {
    display: none;
  }
}

/* Hero */
.hero {
  padding: 56px 0 28px;
  position: relative;
}
.hero::before {
  /* vinheta */
  content: "";
  position: absolute;
  inset: -10% -10% -10% -10%;
  z-index: 0;
  background: radial-gradient(
      60% 60% at 50% 20%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 60%
    ),
    radial-gradient(
      80% 60% at 50% 100%,
      rgba(0, 0, 0, 0.45) 0%,
      transparent 60%
    );
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 30px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.kicker {
  font-family: "Oswald", system-ui, sans-serif;
  color: color-mix(in srgb, var(--rust) 70%, #fff);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-size: 12px;
}
.title {
  font-family: "Oswald", system-ui, sans-serif;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.05;
  margin: 6px 0 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.title .accent {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 30%, transparent),
    transparent
  );
  padding: 0 6px;
  border-radius: 4px;
  box-decoration-break: clone;
}
.subtitle {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: clamp(15px, 2vw, 18px);
}
.typing {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  color: #e6e4de;
  margin-bottom: 18px;
  opacity: 0.9;
}
.cursor {
  color: var(--accent);
  margin-left: 3px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn,
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: 1px solid #2a3326;
  transition: transform 0.04s, background-color 0.2s, color 0.2s,
    border-color 0.2s;
}
.btn {
  background: linear-gradient(180deg, #23301f, #1a2418);
  color: #e7f2df;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.btn:hover {
  background: linear-gradient(180deg, #2a3825, #202a1e);
}
.btn:active {
  transform: translateY(1px);
}
.btn-outline {
  background: transparent;
  color: #e7e3d9;
}
.btn-outline:hover {
  background: color-mix(in srgb, var(--accent-contrast) 28%, transparent);
}

/* Avatar polaroid */
.hero-media {
  display: grid;
  place-items: center;
}
.polaroid {
  position: relative;
  padding: 10px;
  background: #0d0f0d;
  border: 1px solid #242824;
  width: min(100%, 300px);
  rotate: -2deg;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.polaroid:hover {
  transform: rotate(-1deg) scale(1.01);
}
.polaroid::before,
.polaroid::after {
  content: "";
  position: absolute;
  width: 68px;
  height: 22px;
  top: -12px;
  background: linear-gradient(
    180deg,
    rgba(215, 200, 170, 0.85),
    rgba(140, 120, 90, 0.85)
  );
  filter: saturate(0.6) contrast(0.9);
  transform: rotate(-8deg);
  left: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.polaroid::after {
  left: auto;
  right: 16px;
  transform: rotate(6deg);
}
.avatar {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: cover;
  object-position: center;
  border: 1px solid #222;
  background: #121412;
}
.caption {
  font-family: "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #d9d6cd;
  opacity: 0.9;
  margin-top: 8px;
  font-size: 12px;
}

/* Seções base */
section {
  padding: 34px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
  z-index: 1;
}
.section-header {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.section-title {
  font-family: "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  font-size: clamp(20px, 2.6vw, 28px);
  margin: 0;
  letter-spacing: 0.6px;
}
.section-lead {
  color: var(--muted);
  margin: 0;
}

/* Cards base (glass) */
.glass {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0.06)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.22;
  pointer-events: none;
}

/* Sobre */
.about-grid {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.about-card {
  padding: 14px;
}
.about-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0.3px;
}
.about-card p {
  margin: 0;
  color: var(--muted);
}

/* Habilidades */
.skills {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
}
.skill {
  padding: 12px;
  display: grid;
  gap: 4px;
}
.skill-badge {
  font-family: "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #eae7df;
}
.skill-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

/* Projetos com tilt */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
  perspective: 1000px;
}
.proj {
  transform-style: preserve-3d;
  transition: transform 0.12s ease;
}
.thumb {
  aspect-ratio: 16/9;
  width: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.6)),
    radial-gradient(
      80% 80% at 50% 20%,
      rgba(255, 255, 255, 0.06),
      transparent 60%
    ),
    linear-gradient(135deg, #2a2f2a, #1a1e1a);
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: #dcd7cc;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-family: "Oswald", system-ui, sans-serif;
  position: relative;
  overflow: hidden;
}
.shine {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px 200px at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, 0.12),
    transparent 50%
  );
  mix-blend-mode: soft-light;
  pointer-events: none;
  transition: opacity 0.2s ease;
  opacity: 0;
}
.proj:hover .shine {
  opacity: 0.6;
}
.proj-body {
  padding: 12px;
  display: grid;
  gap: 6px;
}
.proj-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.3px;
}
.proj-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.proj-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}
.link-btn,
.link-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #2a3326;
  text-decoration: none;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.link-btn {
  background: linear-gradient(180deg, #23301f, #1a2418);
  color: #e7f2df;
}
.link-btn:hover {
  background: linear-gradient(180deg, #2a3825, #202a1e);
}
.link-btn-outline {
  background: transparent;
  color: #e7e3d9;
}
.link-btn-outline:hover {
  background: color-mix(in srgb, var(--accent-contrast) 28%, transparent);
}

/* Linha do tempo */
.timeline {
  margin: 12px 0 0;
  padding-left: 14px;
  border-left: 2px dashed #2a3326;
  display: grid;
  gap: 16px;
}
.tl-item {
  position: relative;
  display: grid;
  gap: 4px;
}
.tl-dot {
  position: absolute;
  left: -10px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-contrast);
  border: 2px solid #0d0f0d;
  box-shadow: 0 0 0 2px #2a3326;
}
.tl-title {
  margin: 0;
  font-size: 16px;
}
.tl-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.tl-text {
  margin: 0;
  color: var(--muted);
}

/* Contato */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-top: 12px;
}
form {
  padding: 14px;
}
.row {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
label {
  font-weight: 700;
  letter-spacing: 0.3px;
}
input,
textarea {
  border: 1px solid #2a3326;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #0c0f0c;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 40%, #2a3326);
  box-shadow: 0 0 0 4px rgba(136, 160, 110, 0.18);
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.feedback {
  margin-top: 8px;
  color: #dcd7cc;
  min-height: 1.2em;
}
aside.contact {
  padding: 14px;
  display: grid;
  gap: 8px;
}
.contact ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.contact .links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Botão topo */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Revelação ao rolar */
.reveal {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Rodapé */
footer {
  margin-top: 34px;
  padding: 18px 20px 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

/* Responsivo */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .cards,
  .skills,
  .about-grid {
    grid-template-columns: 1fr;
  }
  .polaroid {
    width: min(100%, 280px);
  }
  .avatar {
    height: 320px;
  }
}

/* Acessibilidade: reduzir movimentos */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
  .proj {
    transition: none;
  }
  .shine {
    display: none;
  }
  .cursor {
    animation: none;
  }
}
