:root {
  --bg: #0a0e13;
  --surface: #11171e;
  --surface-2: #18202a;
  --line: #243040;
  --text: #e9eef3;
  --muted: #94a1ae;
  --accent: #f5b83d;
  --accent-soft: rgba(245, 184, 61, 0.12);
  --cool: #5cc8ff;
  --ok: #3fb97a;
  --mono:
    'JetBrains Mono Portfolio', ui-monospace, 'Cascadia Code', Consolas,
    monospace;
  --radius: 14px;
}

@font-face {
  font-family: 'JetBrains Mono Portfolio';
  src: url('../assets/JetBrainsMonoNL-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* fundo em grade sutil que some em direção ao fim do hero */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 86vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  mask-image: radial-gradient(
    ellipse 70% 70% at 70% 40%,
    #000 20%,
    transparent 75%
  );
}

.hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 520px;
  height: 520px;
  right: -120px;
  top: -140px;
  background: radial-gradient(
    circle,
    rgba(245, 184, 61, 0.16),
    transparent 65%
  );
  filter: blur(20px);
}

h1,
h2,
h3,
h4,
.navbar-brand,
.card-title {
  font-family: var(--mono);
  color: var(--text);
  letter-spacing: -0.02em;
}

p {
  font-weight: 400;
}

::selection {
  background: var(--accent);
  color: #1a1203;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- acessibilidade ---------- */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #1a1203;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

main:focus {
  outline: none;
}

.btn:focus-visible,
.dropdown-item:focus-visible,
.navbar-toggler:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: none;
}

/* ---------- navegação ---------- */
.navbar {
  background: rgba(10, 14, 19, 0.82) !important;
  backdrop-filter: blur(12px);
  border-color: var(--line) !important;
  position: sticky;
}

.navbar-brand {
  font-size: 1.05rem;
}

.navbar-brand::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.6rem;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.nav-link {
  color: var(--muted) !important;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: var(--text) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.navbar-toggler {
  border-color: var(--line) !important;
}

.navbar-toggler-icon {
  filter: invert(1) grayscale(1) brightness(2);
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

#language {
  color: var(--muted);
  border-color: var(--line);
}

#language:hover {
  background: var(--surface-2);
  color: var(--text);
}

.navbar .dropdown-menu {
  display: block;
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  background: var(--surface) !important;
  border-color: var(--line) !important;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
}

.navbar .dropdown-menu.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item.active,
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--surface-2);
  color: #fff !important;
}

.dropdown-item img,
#language img {
  object-fit: cover;
  border-radius: 2px;
}

/* ---------- hero ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}

.status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 185, 122, 0.6);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(63, 185, 122, 0);
  }
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  line-height: 1.05;
  font-weight: 700;
}

.wave {
  display: inline-block;
  transform-origin: 70% 80%;
  animation: wave 2.4s ease-in-out 0.6s 2;
}

@keyframes wave {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }
  10%,
  30% {
    transform: rotate(16deg);
  }
  20%,
  40% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

.hero-text {
  color: var(--muted);
  max-width: 56ch;
  font-size: 1.15rem;
  font-weight: 400;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1203;
  font-weight: 600;
  border-radius: 10px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #ffc857;
  border-color: #ffc857;
  color: #1a1203;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(245, 184, 61, 0.55);
}

.btn-outline-info {
  --bs-btn-color: var(--text);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-hover-color: var(--accent);
  --bs-btn-active-bg: var(--surface-2);
  --bs-btn-active-border-color: var(--accent);
  --bs-btn-active-color: var(--accent);
  border-radius: 10px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.portrait {
  position: relative;
  width: min(100%, 320px);
  margin-inline: auto;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.portrait::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: translate(14px, 14px);
  border: 2px solid var(--accent);
  border-radius: 28px;
  transition: transform 0.35s ease;
}

.portrait:hover::before {
  transform: translate(22px, 22px);
}

.code-card {
  position: absolute;
  z-index: 2;
  left: -2.5rem;
  bottom: -2rem;
  width: 17.5rem;
  max-width: 90vw;
  background: rgba(17, 23, 30, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 40px -16px rgba(0, 0, 0, 0.7);
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.7;
  overflow: hidden;
}

.code-card .bar {
  display: flex;
  gap: 6px;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.code-card .bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a4656;
}

.code-card pre {
  margin: 0;
  padding: 0.7rem 0.9rem 0.8rem;
  color: var(--text);
  font: inherit;
  white-space: pre;
}

.code-card .ln {
  display: block;
  opacity: 0;
  animation: type-in 0.4s ease forwards;
  animation-delay: calc(0.5s + var(--i) * 0.35s);
}

.code-card .k {
  color: var(--cool);
}
.code-card .s {
  color: var(--accent);
}
.code-card .c {
  color: #66788c;
}

.code-card .caret {
  display: inline-block;
  width: 7px;
  height: 0.95em;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}

@keyframes type-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* ---------- seções ---------- */
section {
  scroll-margin-top: 76px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  margin-bottom: 2rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

#about p {
  color: var(--muted) !important;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.75;
  max-width: 62ch;
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
}

.technology-panel {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  border-radius: var(--radius) !important;
}

.technology-panel h3 {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 700;
}

.badge-tech {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: #cfd8e0;
  font-weight: 500;
  font-size: 0.82rem;
  margin: 0.2rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.badge-tech:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: #fff;
}

.badge-tech img {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

/* aprender futuramente: contorno tracejado = ainda não conquistado */
#learning .technology-panel {
  background: transparent !important;
  border-style: dashed !important;
}

#learning .badge-tech {
  background: transparent;
  border-style: dashed;
}

/* ---------- projetos ---------- */
.project-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  height: 100%;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

/* luz que acompanha o cursor */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    320px circle at var(--mx) var(--my),
    rgba(245, 184, 61, 0.12),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 184, 61, 0.55) !important;
  box-shadow: 0 22px 40px -22px rgba(0, 0, 0, 0.8);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card .card-body {
  position: relative;
  padding: 1.6rem;
}

.project-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.project-card:hover .project-icon {
  transform: rotate(-6deg) scale(1.08);
}

.project-card .card-title {
  font-size: 1.2rem;
}

.card-text {
  color: var(--muted) !important;
  font-size: 0.95rem;
}

/* cartão "em breve" */
.col-md-6:last-child > .project-card {
  border-style: dashed !important;
  background: transparent !important;
}

/* ---------- rodapé ---------- */
footer {
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: 5rem !important;
  background: radial-gradient(
    ellipse 60% 100% at 50% 100%,
    rgba(245, 184, 61, 0.08),
    transparent 70%
  );
}

footer > p {
  color: var(--muted);
}

.footer-email {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 4.6vw, 2.4rem);
  color: var(--text) !important;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0% 2px
    no-repeat;
  padding-bottom: 4px;
  transition:
    background-size 0.35s ease,
    color 0.2s ease;
}

.footer-email:hover,
.footer-email:focus {
  background-size: 100% 2px;
  color: var(--accent) !important;
}

.github-link {
  display: inline-flex;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.github-link img {
  filter: invert(1);
  opacity: 0.7;
}

.github-link:hover,
.github-link:focus {
  color: #fff;
}

@media (max-width: 991.98px) {
  .hero {
    min-height: auto;
    padding-block: 2rem 4rem;
  }

  .code-card {
    left: 0;
    bottom: -3rem;
  }

  .portrait {
    margin-bottom: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .code-card .ln {
    opacity: 1;
  }
}
