:root {
  --bg-main: #02040a;
  --bg-card: rgba(13, 18, 31, 0.6);
  --green-accent: #10b981;
  --green-dim: rgba(16, 185, 129, 0.1);
  --border-color: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 12px;

  --text-main: #ffffff;
  --text-muted: #94a3b8;

  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --container-padding: clamp(1.5rem, 5vw, 3rem);
}

:root[data-theme='light'] {
  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.7);
  --green-accent: #059669;
  --green-dim: rgba(5, 150, 105, 0.1);
  --border-color: #e2e8f0;
  --glass-border: rgba(0, 0, 0, 0.05);
  --text-main: #0f172a;
  --text-muted: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-accent);
}

:focus-visible {
  outline: 2px solid var(--green-accent);
  outline-offset: 4px;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  background-image: linear-gradient(
    to bottom top,
    #062d24 0%,
    var(--bg-main) 50%
  );
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
  /* Smooth Theme Transition */
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hero Entrance Animations */
.hero > * {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.hero .profile-box {
  animation-delay: 0.1s;
}
.hero .badge {
  animation-delay: 0.3s;
}
.hero h1 {
  animation-delay: 0.5s;
}
.hero p {
  animation-delay: 0.7s;
}
.hero .hero-contacts-minimal {
  animation-delay: 0.9s;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.icon {
  width: 24px;
  height: 24px;
}
.icon-sm {
  width: 16px;
  height: 16px;
}
.icon-lg {
  width: 48px;
  height: 48px;
}

/* --- SKIP LINK (ACCESSIBILITY) --- */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 0;
  background: var(--green-accent);
  color: #02040a;
  padding: 1rem;
  z-index: 1000;
  text-decoration: none;
  font-weight: bold;
  font-family: var(--font-body);
  border-radius: 0 0 8px 0;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* --- HEADER --- */
header {
  width: 100%;
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  z-index: 100;
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background-color: rgba(2, 4, 10, 0.8);
}

:root[data-theme='light'] header {
  background-color: rgba(248, 250, 252, 0.8);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
  transition: color 0.2s;
}

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

.logo-box {
  background: var(--green-accent);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-code);
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  align-items: center;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(to right, var(--text-muted), var(--green-accent));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-links a:hover {
  color: var(--green-accent);
}

/* Toggle Button */
.theme-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.5rem;
}
.theme-btn:hover {
  color: var(--green-accent);
}

.icon-sun {
  display: none;
}
.icon-moon {
  display: block;
}

:root[data-theme='light'] .icon-sun {
  display: block;
}
:root[data-theme='light'] .icon-moon {
  display: none;
}

/* --- HERO --- */
.hero {
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 6rem);
  max-width: 800px;
  margin: 0 auto;
}

.profile-box {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: center;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-main);
  box-shadow: 0 0 0 3px var(--green-accent), 0 0 30px rgba(16, 185, 129, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--green-accent), 0 0 50px rgba(16, 185, 129, 0.5);
}

.badge {
  display: inline-block;
  border: 1px solid var(--green-accent);
  color: var(--green-accent);
  background: var(--green-dim);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-family: var(--font-code);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.text-highlight {
  color: transparent;
  background: linear-gradient(#fff, var(--green-accent));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero p {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-inline: auto;
}

/* Hero Contacts Minimal */
.hero-contacts-minimal {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1rem;
}

.minimal-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s;
  cursor: pointer;
  position: relative;
}
.minimal-link:hover {
  color: var(--green-accent);
}

.email-copy-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  /* Reset button styles */
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

.email-copy-wrapper .icon-sm {
  opacity: 0.5;
  transition: all 0.2s ease;
}

.email-copy-wrapper:hover .icon-sm {
  opacity: 1;
  color: var(--green-accent);
}

.email-copy-wrapper.success .icon-sm {
  color: var(--green-accent);
  opacity: 1;
}

.email-copy-wrapper.success::after {
  content: 'Copiado!';
  color: var(--green-accent);
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: 0.5rem;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.btn {
  padding: clamp(0.6rem, 2vw, 0.8rem) clamp(1.6rem, 4vw, 1.8rem);
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(100px, 190px, 400px);
  border-radius: 40px;
  font-weight: 600;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--green-accent);
  color: #02040a;
  border: 1px solid var(--green-accent);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--green-accent);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--green-accent);
  color: var(--text-main);
  background: var(--green-accent);
}

/* --- SEÇÕES GERAIS --- */
section {
  scroll-margin-top: 100px;
}

.section-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.view-all {
  color: var(--green-accent);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* --- PROJETOS --- */
.grid-projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: clamp(4rem, 8vw, 6rem);
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 10px 25px -15px var(--green-accent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--green-accent);
  box-shadow: 0 10px 25px -15px var(--green-accent);
  transform: scale(1.05);
}
.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-preview {
  height: 180px;
  background: #05080f;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
  color: var(--border-color);
}

.project-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.tag {
  font-family: var(--font-code);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.project-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.project-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}
.project-link {
  font-size: 0.85rem;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.project-link:hover {
  color: var(--green-accent);
}
.project-link.disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- SKILLS --- */
.center-header {
  text-align: center;
  margin-bottom: 4rem;
}

.grid-skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.skill-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 10px 25px -15px var(--green-accent);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
}
.skill-card:hover {
  border-color: var(--green-accent);
  background: linear-gradient(
    to bottom right,
    var(--bg-card),
    rgba(16, 185, 129, 0.05)
  );
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.skill-icon-box {
  width: 40px;
  height: 40px;
  background: var(--green-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-accent);
}

.skill-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0;
}
.skill-list {
  list-style: none;
  padding: 0;
}
.skill-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.skill-list li::before {
  content: '•';
  color: var(--green-accent);
  font-weight: bold;
}

/* --- FOOTER --- */
footer {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding: 4rem 4rem;
  margin-top: 4rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
}

/* --- MOBILE MENU --- */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  z-index: 101;
}

/* --- MOBILE BREAKPOINT --- */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    background: var(--bg-main);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    transition: right 0.3s ease-in-out;
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 100;
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    display: block;
    font-size: 1.2rem;
  }

  .footer-content {
    justify-content: center;
    flex-direction: column;
  }

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

  .hero-contacts-minimal {
    justify-content: center;
  }

  .hero p {
    margin-inline: auto;
  }
}
/* --- SMALL MOBILE / HIGH ZOOM --- */
@media (max-width: 480px) {
  header {
    padding: 0.5rem 0;
  }
  body {
    padding-top: 60px;
  }
  .logo {
    font-size: 1rem;
  }
  .mobile-menu-btn .icon {
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 2500px) {
  html {
    font-size: 150%;
  }

  .container {
    max-width: 1800px;
    padding: 0 clamp(3rem, 5vw, 6rem);
  }

  body {
    padding-top: 150px;
  }

  .hero {
    padding-top: 4rem;
    padding-bottom: 8rem;
    max-width: 1400px;
  }

  .hero p {
    max-width: 900px;
    font-size: 1.5rem;
  }

  .profile-box {
    margin-bottom: 3rem;
  }

  .grid-skills {
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }

  .grid-projects {
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  }

  .project-img,
  .project-preview {
    height: 250px;
  }

  .profile-photo {
    width: 300px;
    height: 300px;
    border-width: 5px;
    box-shadow: 0 0 0 5px var(--green-accent), 0 0 50px rgba(16, 185, 129, 0.5);
  }

  .profile-photo:hover {
    box-shadow: 0 0 0 5px var(--green-accent), 0 0 80px rgba(16, 185, 129, 0.7);
  }
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out !important;
}

.show {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hidden {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- TECH CAROUSEL --- */
.tech-carousel-section {
  padding: 2rem 0 4rem;
  overflow: hidden;
  position: relative;
  /* Optional: bg gradient or transparent */
}

.carousel-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.carousel-container::before,
.carousel-container::after {
  content: '';
  position: absolute;
  top: 0;
  width: 150px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.carousel-container::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-main), transparent);
}

.carousel-container::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-main), transparent);
}

.tech-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  /* Animation duration will be dynamic ideally, but fixed is fine */
  animation: scroll 40s linear infinite;
  padding: 1rem 0;
}

.tech-track:hover {
  animation-play-state: paused;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  min-width: 140px; /* Ensure pill size */
  justify-content: center;
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  user-select: none;
}

.tech-item:hover {
  border-color: var(--green-accent);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.tech-item span {
  font-family: var(--font-code);
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.tech-icon {
  font-size: 1.5rem; /* FontAwesome sizing */
  color: var(--green-accent);
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-50% - 1rem)); /* Moves half way (original set) + half gap */
  }
}
