:root {
  /* Theme Backgrounds */
  --page-bg: #030712;
  --page-text: #e2e8f0;

  /* Arcane & Steven Universe Palette */
  --arcane-bg: #030712;
  --arcane-hex: #00e5ff;
  --arcane-gold: #c8aa6e;
  --su-pink: #ff7b9c;
  --su-purple: #9d84cb;
  --su-sky: #8ecfc9;

  /* Stardew Valley UI */
  --stardew-bg: #fdf6e3;
  --stardew-border: #d4a373;
  --stardew-text: #5c4033;

  /* Spider-Verse */
  --spider-red: #ff2a2a;
  --spider-blue: #00f0ff;
  --spider-yellow: #ffeb3b;

  /* Kurzgesagt */
  --kurz-shadow: rgba(0, 0, 0, 0.2);
}

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

html,
body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

* {
  border-radius: inherit; /* Helps with some rounding issues in nested elements */
}

body {
  font-family: "Nunito", sans-serif;
  background-color: var(--page-bg);
  color: var(--page-text);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.02em;
  overflow-x: hidden;
  caret-color: transparent;
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

/* Modern Stardust & Tech Particles */
#stardust-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#stardust-layer1,
#stardust-layer2 {
  position: absolute;
  top: -150px;
  left: -150px;
  width: calc(100vw + 300px);
  height: calc(100vh + 300px);
  pointer-events: none;
  will-change: transform;
}

#stardust-layer1 {
  background-image:
    radial-gradient(
      1px 1px at 10% 10%,
      rgba(255, 255, 255, 0.4) 50%,
      transparent
    ),
    radial-gradient(
      1.5px 1.5px at 20% 40%,
      rgba(0, 229, 255, 0.4) 50%,
      transparent
    ),
    radial-gradient(
      1px 1px at 30% 80%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent
    ),
    radial-gradient(
      2px 2px at 40% 20%,
      rgba(255, 68, 119, 0.3) 50%,
      transparent
    ),
    radial-gradient(
      1.5px 1.5px at 50% 60%,
      rgba(255, 255, 255, 0.4) 50%,
      transparent
    ),
    radial-gradient(
      1px 1px at 60% 30%,
      rgba(0, 229, 255, 0.5) 50%,
      transparent
    ),
    radial-gradient(
      2px 2px at 70% 90%,
      rgba(255, 204, 0, 0.3) 50%,
      transparent
    ),
    radial-gradient(
      1px 1px at 80% 50%,
      rgba(255, 255, 255, 0.5) 50%,
      transparent
    ),
    radial-gradient(
      1.5px 1.5px at 90% 10%,
      rgba(255, 68, 119, 0.3) 50%,
      transparent
    );
  background-size: 150px 150px;
  animation: stardust-tech-drift 90s linear infinite;
  opacity: 0.8;
}

#stardust-layer2 {
  background-image:
    radial-gradient(
      1.5px 1.5px at 15% 25%,
      rgba(0, 229, 255, 0.5) 50%,
      transparent
    ),
    radial-gradient(
      1px 1px at 35% 75%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent
    ),
    radial-gradient(
      2px 2px at 65% 15%,
      rgba(255, 204, 0, 0.4) 50%,
      transparent
    ),
    radial-gradient(
      1px 1px at 85% 85%,
      rgba(255, 255, 255, 0.4) 50%,
      transparent
    );
  background-size: 100px 100px;
  animation: stardust-tech-drift-alt 60s linear infinite;
  opacity: 0.7;
}

@keyframes stardust-tech-drift {
  0% {
    transform: translate(0px, 0px);
  }
  100% {
    transform: translate(150px, 150px);
  }
}
@keyframes stardust-tech-drift-alt {
  0% {
    transform: translate(0px, 0px);
  }
  100% {
    transform: translate(-100px, 100px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none !important;
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* Accessibility: Keyboard Focus */
*:focus-visible {
  outline: 2px solid #00ffff !important;
  outline-offset: 4px !important;
  border-radius: 4px;
}

/* Regras Globais de Tipografia (Hierarquia de Leitura) */
p {
  font-weight: 400;
  line-height: 1.6;
  /* text-wrap balance removido para evitar quebras estranhas em parágrafos no mobile */
}

/* Spider-Verse Typography */
h1,
h2,
h3,
.spider-text {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  text-wrap: balance;
}

/* =========================================
       BASE STYLES (MOBILE-FIRST)
       ========================================= */

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 0.4rem 5%; /* Reduzido ainda mais */
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 11, 18, 0.95);
  backdrop-filter: blur(15px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 229, 255, 0.08);
  transition: all 0.3s ease;
}

nav.scrolled {
  padding: 0.2rem 5%;
  background: rgba(2, 4, 10, 0.98);
}

.logo {
  font-size: 1.2rem; /* Reduzido de 1.5rem */
  color: var(--arcane-hex);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 1px;
  font-family: "Space Grotesk", sans-serif;
  text-shadow: 1px 1px 0 var(--su-purple);
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-links a:not(.btn-cv) {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  padding: 10px 14px; /* Mais compacto */
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.nav-links a:not(.btn-cv):hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px; /* Mais compacto */
  background: rgba(0, 229, 255, 0.05);
  color: var(--arcane-hex);
  border: 1px solid var(--arcane-hex);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--arcane-hex);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-cv:hover {
  background: var(--arcane-hex);
  color: #000;
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--arcane-hex);
}

main {
  width: 100%;
}

/* Sections */
section {
  min-height: auto;
  padding: 80px 5%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

@keyframes blink-cursor {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Editorial Composition & Continuity */
.hero-master-wrapper {
  position: relative;
  background: transparent;
  overflow: clip; /* Melhora performance e evita scrollbars indesejadas */
}

#hero {
  height: 95vh;
  min-height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 150px 0 0 0;
  position: relative;
  z-index: 10;
  background: transparent !important;
  perspective: 1000px; /* For 3D feeling */
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.8;

  transition: transform 0.2s ease-out;
}

@keyframes canvasFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0.8;
  }
}

.hero-split-visual {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5vw; /* Added gap to ensure separation between title and photo */
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
  z-index: 2;
}

.glitch-title {
  font-size: clamp(2.5rem, 7.5vw, 7.5rem); /* Slightly smaller max size */
  line-height: 1.1;
  margin: 0;
  color: #fff;
  text-shadow:
    3px 3px 0 var(--spider-red),
    -3px -3px 0 var(--spider-blue);
  transform: skew(-1deg) translateZ(50px);
  position: relative;
  z-index: 50;
  text-align: left;
  width: auto;
  margin-right: 0; /* Reset margin as gap handles separation */
  margin-left: 0;
  pointer-events: none;
  letter-spacing: 0.5px;
  mix-blend-mode: hard-light;
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.6s ease;
  will-change: transform, opacity;
  min-height: 2.2em; /* Prevents layout jump during typewriter effect */
}

/* Hero specific reveal overrides to maintain 3D transforms */
#hero .reveal-item {
  transition-duration: 0.5s !important;
}
#hero .glitch-title.reveal-item {
  opacity: 0;
  transform: skew(-1deg) translateZ(50px) translateY(20px) !important;
}
#hero .glitch-title.reveal-item.revealed {
  opacity: 1;
  transform: skew(-1deg) translateZ(50px) translateY(0) !important;
}

#hero .hero-magazine-visual.reveal-item {
  opacity: 0 !important;
  transform: translateZ(20px) translateY(30px) scale(0.98) !important;
}
#hero .hero-magazine-visual.reveal-item.revealed {
  opacity: 1 !important;
  transform: translateZ(20px) translateY(0) scale(1) !important;
}


.hero-magazine-visual {
  position: relative;
  width: clamp(
    320px,
    45vw,
    650px
  ); /* Slightly reduced max width for better editorial balance */
  flex-shrink: 0; /* Prevent the image from being squashed */
  height: 90%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(20px);
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.6s ease;
  will-change: transform, opacity;
  /* Soft Fade Mask Integration */
  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      black 15%,
      black 85%,
      transparent 100%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      black 15%,
      black 80%,
      transparent 100%
    );
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      black 15%,
      black 85%,
      transparent 100%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      black 15%,
      black 80%,
      transparent 100%
    );
  mask-composite: intersect;

  /* Elegant entry animation for the image (Pure CSS) */
}

@keyframes heroImageFadeIn {
  0% {
    opacity: 0;
    transform: translateZ(20px) translateY(8px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateZ(20px) translateY(0) scale(1);
  }
}

.magazine-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Removed hard geometric pseudo-element to achieve organic integration */
.hero-magazine-visual::before {
  display: none;
}

.magazine-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 5%;
  /* Cool Steel Blue Toning: Grayscale + Sepia + Hue Rotate */
  filter: grayscale(100%) sepia(25%) hue-rotate(185deg) brightness(85%)
    contrast(115%);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1.05);
}

.hero-magazine-visual:hover .magazine-frame {
  filter: none;
}

.hero-magazine-visual:hover .magazine-frame img {
  filter: grayscale(0%) contrast(105%) brightness(100%);
  transform: scale(1);
}

/* PART 2: THE INTRODUCTION */
#hero-intro {
  background: transparent !important;
  padding: 80px 5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 10;
}

.intro-content {
  max-width: 950px;
  width: 100%;
  backdrop-filter: blur(8px);
  background: rgba(8, 11, 18, 0.4);
  padding: 4rem 3rem;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.hero-name {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 0.9;
  margin-bottom: 1rem;
  color: #ffffff;
  text-transform: uppercase;
  font-family: "Space Grotesk", sans-serif;
}

.hero-subtitle {
  font-size: clamp(0.75rem, 1.8vw, 1rem);
  color: var(--arcane-hex);
  font-weight: 700;
  margin-bottom: 2.5rem;
  letter-spacing: 3px; /* Reduzido de 5px */
  text-transform: uppercase;
  opacity: 0.9;
  line-height: 1.8;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
}

.hero-subtitle span {
  white-space: nowrap;
}

.hero-subtitle span.sep {
  opacity: 0.5;
}

.hero-text {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  line-height: 1.8;
  color: #cbd5e1;
  margin-bottom: 4rem;
  font-style: italic;
  /* Removemos text-wrap balance para evitar cortes estranhos */
}

@media (max-width: 991px) {
  #hero {
    height: auto;
    padding-top: 160px; /* Enhanced space for nav */
    min-height: auto;
    align-items: flex-start; /* Prevent vertical centering from pushing content up */
  }
  .hero-split-visual {
    flex-direction: column;
    gap: 4rem;
    justify-content: flex-start;
  }
  .glitch-title {
    text-align: center;
    margin-right: 0;
    width: 100%;
    margin-bottom: 0;
    z-index: 21; /* Over image on mobile */
    letter-spacing: 0.5px;
  }
  .hero-magazine-visual {
    width: 100%;
    max-width: 400px;
    height: 520px;
    transform: none !important;
  }
  .hero-subtitle {
    white-space: normal;
    letter-spacing: 3px;
    line-height: 1.5;
  }
  .glitch-title {
    mix-blend-mode: normal;
    text-shadow:
      2px 2px 0 var(--spider-red),
      -2px -2px 0 var(--spider-blue);
  }
}


.btn-spider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 2.5rem;
  background: var(--spider-yellow);
  color: #000;
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 2px solid #000;
  box-shadow: 8px 8px 0 var(--spider-blue);
  transform: skew(-6deg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.btn-spider::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 30%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.1) 70%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-spider:hover {
  transform: skew(-6deg) translateY(-8px) scale(1.05);
  box-shadow: 12px 12px 0 var(--spider-red);
  background: #fff;
}

.btn-spider:hover::after {
  left: 150%;
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ABOUT: Anne with an E / Perks of Being a Wallflower */
#sobre {
  background: linear-gradient(to bottom, var(--arcane-bg), #080b12);
}

.narrative-box {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.narrative-box:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.narrative-content {
  display: flex;
  flex-direction: row;
  gap: 3rem;
  align-items: center;
  justify-content: center; /* Centraliza o conteúdo horizontalmente */
}

.profile-frame {
  width: 180px;
  height: 180px;
  border-radius: 50%; /* Round on mobile */
  overflow: hidden;
  box-shadow:
    -6px 6px 0 var(--su-pink),
    6px -6px 0 var(--arcane-hex);
  border: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.profile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%; /* Foca na cabeça/rosto */
  display: block;
}

#live-github-card {
  display: block !important;
  margin: 2rem auto 0 !important;
  width: fit-content;
  text-align: center;
  border-radius: 12px;
}

/* Standardizing background colors for seamless flow */
#hero,
#tech-stack,
#soft-skills,
#sobre,
#projetos,
#game-dev,
#projetos-design,
#cta-final,
#suporte-gestao,
#tech-trends-2030,
#faq {
  background: transparent !important;
  border-top: none !important;
  border-bottom: none !important;
}

body.light-mode .narrative-box,
body.light-mode .contact-panel,
body.light-mode .design-card,
body.light-mode .testimonial-card,
body.light-mode #stardust-layer1 {
  background-image:
    radial-gradient(1px 1px at 10% 10%, rgba(15, 23, 42, 0.3) 50%, transparent),
    radial-gradient(
      1.5px 1.5px at 20% 40%,
      rgba(37, 99, 235, 0.3) 50%,
      transparent
    ),
    radial-gradient(1px 1px at 30% 80%, rgba(15, 23, 42, 0.2) 50%, transparent),
    radial-gradient(
      2px 2px at 40% 20%,
      rgba(79, 70, 229, 0.3) 50%,
      transparent
    ),
    radial-gradient(
      1.5px 1.5px at 50% 60%,
      rgba(15, 23, 42, 0.3) 50%,
      transparent
    ),
    radial-gradient(
      1px 1px at 60% 30%,
      rgba(37, 99, 235, 0.3) 50%,
      transparent
    ),
    radial-gradient(
      2px 2px at 70% 90%,
      rgba(234, 88, 12, 0.3) 50%,
      transparent
    ),
    radial-gradient(1px 1px at 80% 50%, rgba(15, 23, 42, 0.2) 50%, transparent),
    radial-gradient(
      1.5px 1.5px at 90% 10%,
      rgba(79, 70, 229, 0.3) 50%,
      transparent
    );
}

body.light-mode #stardust-layer2 {
  background-image:
    radial-gradient(
      1.5px 1.5px at 15% 25%,
      rgba(37, 99, 235, 0.4) 50%,
      transparent
    ),
    radial-gradient(1px 1px at 35% 75%, rgba(15, 23, 42, 0.2) 50%, transparent),
    radial-gradient(
      2px 2px at 65% 15%,
      rgba(234, 88, 12, 0.3) 50%,
      transparent
    ),
    radial-gradient(1px 1px at 85% 85%, rgba(15, 23, 42, 0.2) 50%, transparent);
}

body.light-mode #sobre {
  padding-bottom: 80px !important;
}

body.light-mode #hero,
body.light-mode #hero-intro,
body.light-mode #tech-stack,
body.light-mode #soft-skills,
body.light-mode #sobre,
body.light-mode #game-dev,
body.light-mode #projetos,
body.light-mode #projetos-design,
body.light-mode #cta-final,
body.light-mode #suporte-gestao,
body.light-mode #tech-trends-2030,
body.light-mode #faq {
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
}

body.light-mode .intro-content {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .hero-name {
  color: #0f172a !important;
}

body.light-mode .hero-text {
  color: #475569 !important;
}

body.light-mode .hero-subtitle {
  color: #64748b !important;
}

body.light-mode #hero-intro {
  background-color: transparent !important;
}

body.light-mode .hero-master-wrapper {
  background: transparent !important;
}

body.light-mode .narrative-text p,
body.light-mode .contact-panel p,
body.light-mode .design-header p {
  color: #475569 !important;
}

@media (max-width: 768px) {
  /* Redundant media query removed to let the main one at 1217 handle navigation */
}

.narrative-text {
  width: 100%;
  text-align: left;
}

.narrative-text h2 {
  color: var(--su-pink);
  font-size: clamp(2rem, 4vw + 0.5rem, 2.5rem);
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  text-align: center;
}

.narrative-text p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #f1f5f9;
  width: 100%;
}

/* Social Proof: Testimonials */
.testimonials-grid {
  display: flex;
  flex-direction: column; /* Stacked on mobile */
  gap: 1.5rem;
  margin-top: 3rem;
  width: 100%;
}

.testimonial-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08); /* Adicionado borda sutil */
  border-left: 4px solid var(--su-pink);
  padding: 1.5rem;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 10px;
  font-size: 10rem;
  font-family: "Playfair Display", serif;
  color: #fff;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.testimonial-text {
  font-style: italic;
  color: #d1d5db;
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  line-height: 1.6;
  margin-bottom: 1rem;
  text-align: left;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  font-family: "Space Grotesk", sans-serif;
  color: var(--arcane-gold);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  text-align: right;
}

/* SKILLS: Kurzgesagt (Flat, Vibrant, Clear) */
#tech-stack {
  background: #080b12;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

#soft-skills {
  background: #0a0d14;
}

.skills-header {
  text-align: center;
  margin-bottom: 4rem;
}

.skills-header h2 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: var(--arcane-hex);
  margin-bottom: 1.5rem;
}

.skills-header p {
  color: #a0aec0;
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto;
  text-wrap: balance;
}

.kurz-grid {
  display: flex;
  flex-direction: column; /* Stacked on mobile */
  gap: 1.5rem;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.kurz-card {
  background: var(--su-purple);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 6px 0 #7a62a3;
  width: 100%;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.kurz-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 12px 0 #7a62a3,
    0 15px 30px rgba(0, 0, 0, 0.3);
}

.kurz-card.learning {
  background: var(--su-sky);
  box-shadow: 0 6px 0 #6baaa4;
}

.kurz-card.learning:hover {
  box-shadow:
    0 12px 0 #6baaa4,
    0 15px 30px rgba(0, 0, 0, 0.3);
}

.kurz-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.kurz-card h3 svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  overflow: visible;
}

.kurz-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.kurz-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  flex-grow: 1; /* Expands to fill space on mobile */

  /* New Alignment Rules */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  position: relative; /* For tooltip */
}

/* Custom Tooltip */
.kurz-tag[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #000;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  font-family: "Space Grotesk", sans-serif;
  z-index: 100;
  pointer-events: none;
}

.kurz-tag[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Prevent Icon Distortion */
.kurz-tag img,
.kurz-tag svg {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.kurz-tag svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* =========================================
   GAME DEV STATUS TAG
   ========================================= */
.status-dev-tag {
  margin: 1.5rem auto 0 auto;
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-weight: bold;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--arcane-hex);
  text-transform: uppercase;
  letter-spacing: 1px;
  width: fit-content;
  text-align: center;
  animation: pulse-dev 4s infinite ease-in-out;
}

body.light-mode .status-dev-tag {
  border: 1px dashed rgba(0, 0, 0, 0.2);
  color: #006670;
  animation: pulse-dev-light 4s infinite ease-in-out;
}

@keyframes pulse-dev-light {
  0% {
    transform: scale(0.99);
    box-shadow: 0 0 0 0 rgba(0, 102, 112, 0.05);
    opacity: 0.85;
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 6px 0 rgba(0, 102, 112, 0.15);
    opacity: 1;
    border-color: rgba(0, 102, 112, 0.4);
  }
  100% {
    transform: scale(0.99);
    box-shadow: 0 0 0 0 rgba(0, 102, 112, 0);
    opacity: 0.85;
    border-color: rgba(0, 0, 0, 0.2);
  }
}

@keyframes pulse-dev {
  0% {
    transform: scale(0.99);
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.05);
    opacity: 0.85;
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 6px 0 rgba(0, 229, 255, 0.2);
    opacity: 1;
    border-color: rgba(0, 229, 255, 0.4);
  }
  100% {
    transform: scale(0.99);
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
    opacity: 0.85;
    border-color: rgba(255, 255, 255, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dev-tag,
  body.light-mode .status-dev-tag {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}




/* =========================================
   CONTACT / CTA PANEL (REFINED)
   ========================================= */
.contact-panel {
  background: rgba(8, 11, 18, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  max-width: 760px;
  width: 95%;
  margin-left: auto;
  margin-right: auto;
  padding: 3rem;
  border-radius: 32px;
  text-align: center;
}

body.light-mode .contact-panel {
  background: #fdfbf7; /* Off-white Ghibli */
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.contact-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 2.5rem;
}

@media (max-width: 600px) {
  .contact-links {
    grid-template-columns: 1fr;
  }
}

.contact-link {
  border-radius: 100px;
  padding: 10px 24px 10px 10px;
  font-size: 1.05rem;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

body.light-mode .contact-link {
  color: #0f172a !important; /* Always readable */
}

/* Icon Holder - Circular badge for the icon */
.icon-holder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

body.light-mode .icon-holder {
  background: rgba(255, 255, 255, 0.5);
}

.contact-link:hover {
  transform: translateY(-4px);
  filter: brightness(1.05);
}

.contact-link:hover .icon-holder {
  transform: scale(1.1) rotate(-5deg);
  background: rgba(255, 255, 255, 0.35);
}

/* Muted Ghibli / Earthy Palette */
.contact-link.email {
  background: #c27d65; /* Terracotta mud */
  box-shadow: 0 4px 15px rgba(194, 125, 101, 0.2);
}
.contact-link.whatsapp {
  background: #6b8f71; /* Sage green */
  box-shadow: 0 4px 15px rgba(107, 143, 113, 0.2);
}
.contact-link.linkedin {
  background: #475a7a; /* Night blue */
  box-shadow: 0 4px 15px rgba(71, 90, 122, 0.2);
}
.contact-link.github {
  background: #2b2b36; /* Dark slate */
  box-shadow: 0 4px 15px rgba(43, 43, 54, 0.2);
}

.contact-link svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
body.light-mode .contact-link svg {
  stroke: #0f172a;
}

/* Fix specific colors for dark button text in light mode */
body.light-mode .contact-link.github {
  color: #fff !important;
}
body.light-mode .contact-link.github svg {
  stroke: #fff;
}





/* =========================================
       MOBILE-SPECIFIC FIXES (MAX-WIDTH: 767px)
       ========================================= */
@media (max-width: 767px) {
  /* Fix Navigation & CV Button Overlap */
  nav {
    display: flex;
    position: fixed; /* Keep it fixed to ensure access to menu */
    top: 0;
    width: 100%;
    padding: 0.6rem 5%;
    background: rgba(8, 11, 18, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
    z-index: 10000;
    justify-content: space-between;
    align-items: center;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 85%;
    max-width: 350px;
    background: rgba(8, 11, 18, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 10000;
    margin: 0;
    padding: 2rem;
    overflow-y: auto;
  }

  .nav-links a:not(.btn-cv) {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 1.2rem;
    border-radius: 12px;
  }

  .btn-cv {
    width: 100%;
    justify-content: center;
    padding: 1.2rem;
    font-size: 1.1rem;
  }

  .hamburger {
    display: flex !important;
  }

  .nav-links.active {
    right: 0 !important;
    box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.7) !important;
  }

  /* Hamburger Animation */
  .hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  .hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Custom Hero fixes moved manually */

  .glitch-title {
    font-size: clamp(
      2rem,
      8vw,
      3.5rem
    ); /* Reduzido e fluido para evitar quebras bizarras */
    margin-bottom: 2rem;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    word-break: normal;
    overflow-wrap: break-word;
    padding-inline: 1rem;
  }

  .hero-magazine-visual {
    width: 100%;
    max-width: 340px;
    height: 480px;
    margin: 0 auto;
    transform: none !important;
    box-shadow: 12px 12px 0 var(--arcane-hex);
  }

  .hero-name {
    font-size: clamp(2rem, 10vw, 3.5rem);
    margin-bottom: 1.5rem;
    text-align: center;
  }

  .hero-subtitle {
    margin-bottom: 2rem;
    font-size: 0.85rem;
    letter-spacing: 2px;
    line-height: 1.6;
    text-align: center;
  }

  .hero-text {
    margin-bottom: 3rem;
    font-size: 1.1rem;
    text-align: center;
    padding: 0 10px;
  }

  /*.btn-spider {
        width: 100%;
        text-align: center;
      }*/

  /* =========================================
         FIXES DE GRID & EXCESSO DE PADDING (MOBILE)
         ========================================= */
  section:not(#hero) {
    padding: 50px 6% !important;
    width: 100%;
    overflow-x: hidden;
  }

  #hero {
    padding: 160px 6% 50px 6% !important;
    width: 100%;
    overflow-x: hidden;
    align-items: flex-start !important;
  }

  .hero-split-visual {
    justify-content: flex-start !important;
  }

  .narrative-box {
    padding: 2rem 1.5rem;
    width: 100%;
  }

  .narrative-content {
    flex-direction: column !important;
    gap: 2.5rem;
    text-align: center;
  }

  .profile-frame {
    width: 160px !important;
    height: 160px !important;
    margin: 0 auto;
  }

  .testimonials-grid {
    gap: 2rem;
    margin-top: 2rem;
  }

  #tech-trends-2030 .design-card {
    width: 100% !important;
    padding: 1.5rem !important;
    margin: 0 !important;
  }

  #tech-trends-2030 .design-card > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .kurz-grid {
    gap: 2rem;
  }

  .kurz-card {
    padding: 2rem 1rem !important;
  }

  .project-battle-grid {
    gap: 2.5rem;
  }

  /* Toggle e Toast Notification Fixes */
  .theme-toggle-btn {
    width: 48px !important;
    height: 48px !important;
    bottom: 20px !important;
    left: 20px !important;
  }

  #toast-notificacao {
    bottom: 90px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 85% !important;
    text-align: center;
    font-size: 0.9rem;
  }

  footer {
    padding-bottom: 100px !important;
  }

  .tech-label {
    font-size: 0.9rem;
  }
}

/* =========================================
       SUPER SMALL MOBILE FIXES (MAX-WIDTH: 480px)
       ========================================= */
@media (max-width: 480px) {
  /* Ajuste dos Widgets de Status/Clima */
  #status-disponibilidade,
  #widget-clima {
    width: 100% !important;
    justify-content: center !important;
    font-size: 13px !important;
    padding: 10px !important;
  }

  .contact-links {
    width: 100% !important;
  }

  /* Aumenta padding dos labels para garantir respiro no fundo do card branco */
  .kurz-card {
    padding: 1.5rem 15px !important;
  }

  /* Logo top padding fix */
  .logo {
    padding-top: 10px;
  }
}

/* =========================================
       DESKTOP & TABLET (MIN-WIDTH: 768px)
       ========================================= */
@media (min-width: 768px) {
  /* Nav */
  nav {
    position: fixed;
    flex-direction: row;
    justify-content: space-between;
    padding: 1.5rem 5%;
    background: rgba(8, 11, 18, 0.95);
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  }
  .nav-links {
    width: auto;
    gap: 2rem;
  }
  .nav-links a:not(.btn-cv) {
    font-size: 1rem;
  }
  .nav-links a:not(.btn-cv):hover {
    color: var(--su-pink);
    transform: translateY(-2px);
  }
  .btn-cv {
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
  }
  .btn-cv:hover {
    background: var(--arcane-hex);
    color: #000;
    box-shadow: 6px 6px 0 var(--arcane-hex);
    transform: translateY(-2px);
  }

  section {
    padding: 80px 5%;
  }

  /* Hero */
  .hero-content {
    align-items: flex-start;
    text-align: left;
  }
  .glitch-title {
    text-shadow:
      3px 3px 0 var(--spider-red),
      -3px -3px 0 var(--spider-blue);
  }
  .hero-text {
    margin: 0 0 2.5rem 0;
    width: 100%;
  }
  .btn-spider {
    padding: 1rem 2.5rem;
    box-shadow: 6px 6px 0 var(--spider-red);
  }
  .btn-spider:hover {
    transform: skew(-5deg) translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--spider-blue);
  }

  /* About */
  .narrative-box {
    padding: 3rem;
    border-radius: 20px;
  }
  .narrative-content {
    flex-direction: row;
    gap: 3rem;
  }
  .profile-frame {
    width: 240px;
    height: auto;
    border-radius: 12px;
    box-shadow:
      -8px 8px 0 var(--su-pink),
      8px -8px 0 var(--arcane-hex);
  }
  .profile-frame:hover {
    transform: translate(2px, -2px);
    box-shadow:
      -10px 10px 0 var(--su-pink),
      10px -10px 0 var(--arcane-hex);
  }
  .profile-frame:hover img {
    transform: scale(1.05);
  }
  .narrative-text h2 {
    text-align: left;
  }
  .narrative-text p {
    width: 100%;
  }

  /* Testimonials */
  .testimonials-grid {
    flex-direction: row;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
  }
  .testimonial-card {
    padding: 2rem;
    border-radius: 0 16px 16px 0;
  }
  .testimonial-card:hover {
    transform: translateY(-5px);
    border-left-color: var(--arcane-hex);
  }

  /* Skills */
  .kurz-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .kurz-card {
    width: calc(33.333% - 1.5rem);
    max-width: 350px;
    padding: 2rem;
    border-radius: 32px;
    box-shadow: 0 8px 0 #7a62a3;
  }
  .kurz-card:hover {
    transform: translateY(-5px);
  }
  .kurz-tags {
    justify-content: center;
  }
  .kurz-tag {
    flex-grow: 0;
    justify-content: center;
  }

  /* Projects */
  .dialogue-box {
    padding: 2rem;
    border-width: 6px;
  }
  .project-battle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  /* Contact */
  .contact-panel {
    padding: 3rem;
    border-radius: 20px;
  }
}

/* =========================================
       RETRO MODE (EVOLUÇÃO DO PIXEL ART)
       ========================================= */
/* Força ícones e imagens a não suavizarem as bordas */
/* Animação do Botão Insert Coin */
@keyframes insert-coin {
  from {
    opacity: 1;
    box-shadow: 0 0 10px #ffaa00;
  }
  to {
    opacity: 0.5;
    box-shadow: 0 0 20px #ffaa00;
  }
}

/* Scanlines Overlay */

/* Efeito VHS Sutil */
/* Retro Overlay (BIOS / Mosaic Boot) */

.ativar-retro {
  display: flex !important;
  animation: bios-boot 0.8s ease-in-out forwards;
}

@keyframes bios-boot {
  0% {
    opacity: 1;
    clip-path: inset(50% 0 50% 0);
    background: #000;
  }
  30% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    background: #000;
  }
  70% {
    opacity: 1;
    background: repeating-linear-gradient(45deg, #ffaa00, #000 10%);
    mix-blend-mode: color-burn;
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
  }
}

/* ==========================================================================
       BENTO BOX & GLASSMORPHISM OVERRIDES (V2.0)
       ========================================================================== */

/* 1. Bento Box & Glassmorphism Containers */
.narrative-box,
.testimonial-card,
.kurz-card,
.contact-panel,
#game-wrapper,
.design-card {
  padding: 3rem !important; /* Abundant padding for respiro */
  background: rgba(
    10,
    14,
    20,
    0.4
  ) !important; /* Fundo mais sólido e consistente */
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important; /* Borda levemente mais visível */
  border-radius: 32px !important;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.4s ease,
    border-color 0.4s ease !important;
  overflow: hidden !important;
}

/* Restaurar detalhe de borda esquerda dos depoimentos que é marca registrada da seção */
.testimonial-card {
  border-left: 4px solid var(--su-pink) !important;
  border-radius: 0 24px 24px 0 !important;
}

/* 2. Hover Effects para Cards (Profundidade Dinâmica) */
.testimonial-card:hover,
.kurz-card:hover,
.ut-card:hover,
.narrative-box:hover,
.design-card:hover {
  transform: translateY(-8px) !important; /* Levanta o card suavemente */
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(0, 229, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(0, 229, 255, 0.4) !important; /* Borda acende levemente */
}

/* 3. Hover Effects para Botões e Links */
.btn-cv,
.btn-spider,
.btn-projeto,
.close-search,
.theme-toggle-btn,
.contact-link {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  border-radius: 14px !important; /* Arredondando botões para combinar com o Bento Box */
}

/* Estado Active para Mobile & Touch (Botão responde "afundando") */
.btn-cv:active,
.btn-spider:active,
.btn-projeto:active,
.close-search:active,
.theme-toggle-btn:active,
.contact-link:active {
  transform: translateY(2px) scale(0.98) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
}

/* Ajuste específico para o botao do Spider Verse no Active */
.btn-spider:active {
  box-shadow: 4px 4px 0 var(--spider-red) !important;
}

/* Hover exclusivo para interfaces que possuem o mouse (Prevenção Bug Mobile) */
@media (hover: hover) and (pointer: fine) {
  .btn-cv:hover,
  .btn-spider:hover,
  .btn-projeto:hover,
  .close-search:hover,
  .theme-toggle-btn:hover,
  .faq-question:hover {
    transform: translateY(-5px) scale(1.02) !important; /* Levanta e expande levemente */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5) !important;
    filter: brightness(1.2);
  }

  /* Ajuste específico para o botão do Spider-Verse não perder sua identidade */
  .btn-spider:hover {
    box-shadow:
      8px 8px 0 var(--spider-blue),
      0 15px 25px rgba(0, 0, 0, 0.5) !important;
  }
}

/* 4. Classes de Animação (Scroll Reveal) */
.reveal-item {
  opacity: 0 !important;
  transform: translateY(30px) !important;
  transition:
    opacity 1s cubic-bezier(0.25, 1, 0.5, 1),
    transform 1s cubic-bezier(0.25, 1, 0.5, 1) !important;

  pointer-events: none !important;
}

.reveal-item.revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* Staggered Delays */
.stagger-1 {
  transition-delay: 0.1s !important;
}
.stagger-2 {
  transition-delay: 0.2s !important;
}
.stagger-3 {
  transition-delay: 0.3s !important;
}
.stagger-4 {
  transition-delay: 0.4s !important;
}
.stagger-5 {
  transition-delay: 0.5s !important;
}

/* Prevent horizontal overflow during animation */
body {
  overflow-x: hidden;
}

/* ==========================================================================
       SEARCH BAR & HAMBURGER MENU
       ========================================================================== */

/* Search Bar */
.search-container {
  text-align: center;
  margin: 0 auto 3rem auto;
  max-width: 500px;
  width: 90%;
}

#searchInput {
  width: 100%;
  padding: 14px 24px;
  border-radius: 32px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(8, 11, 18, 0.6);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#searchInput:focus {
  border-color: var(--arcane-hex);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
  transform: translateY(-2px);
}

#searchInput::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  cursor: pointer;
  padding: 10px;
  z-index: 10011;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-line {
  width: 30px;
  height: 3px;
  background-color: var(--arcane-hex);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Mobile handling for split hero */
@media (max-width: 991px) {
  #hero {
    height: auto;
    min-height: 80vh;
    padding-top: 160px; /* Increased padding to prevent overlap with fixed nav */
    align-items: flex-start;
  }
  .hero-split-visual {
    flex-direction: column;
    justify-content: flex-start;
    gap: 2rem;
  }
  .glitch-title {
    text-align: center;
    margin-bottom: 2rem;
    z-index: 120;
    text-shadow:
      2px 2px 0 var(--spider-red),
      -2px -2px 0 var(--spider-blue);
  }
  .hero-magazine-visual {
    position: relative;
    right: 0;
    top: 0;
    transform: none;
    width: 100%;
    max-width: 320px;
    height: 450px;
    margin: 0 auto;
  }
  .magazine-frame {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    box-shadow: 15px 15px 0px var(--arcane-hex);
  }
}

@media (min-width: 992px) {
  .glitch-title {
    margin-right: -15%; /* Sobreposição sutil com a foto */
  }
}

/* ==========================================================================
       PROJETOS DESIGN (GALERIA)
       ========================================================================== */
#projetos-design {
  padding: 80px 5%;
  background: linear-gradient(to bottom, #080b12, #030712);
}

.design-header {
  text-align: center;
  margin-bottom: 4rem;
}
.design-header h2 {
  font-size: clamp(2rem, 5vw + 1rem, 2.5rem);
  color: var(--arcane-hex);
  margin-bottom: 1rem;
  font-family: "Space Grotesk", sans-serif;
}
.design-header p {
  color: #a0aec0;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.design-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.img-placeholder {
  width: 100%;
  height: 200px;
  background: rgba(0, 229, 255, 0.05);
  border: 2px dashed rgba(0, 229, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 229, 255, 0.6);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.imagem-card-projeto {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: top;
  border-radius: 12px;
  margin-bottom: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.design-card:hover .img-placeholder {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--arcane-hex);
}

.design-card h3 {
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.design-card p {
  color: #d1d5db;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.design-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.btn-projeto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 16px 24px;
  min-height: 48px;
  border-radius: 50px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.4) 100%
  );
  border: 1px solid rgba(0, 229, 255, 0.5);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .btn-projeto:hover {
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(0, 0, 0, 0.6) 100%
    );
    border-color: var(--arcane-hex);
    box-shadow:
      0 0 15px rgba(0, 229, 255, 0.4),
      inset 0 0 10px rgba(0, 229, 255, 0.2);
    color: var(--arcane-hex);
  }
}

/* ========================================= */
@media screen and (max-width: 768px) {
  #projetos-design .design-grid {
    grid-template-columns: 1fr !important;
    padding: 16px !important;
    gap: 16px !important;
  }

  #projetos-design .design-card {
    padding: 16px !important;
  }

  #projetos-design .imagem-card-projeto {
    height: 220px !important;
    margin-bottom: 8px !important;
  }

  #projetos-design .btn-projeto {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
       FAQ SECTION (HYBRID ACCORDION)
       ========================================================================== */
#faq {
  padding: 80px 0;
  position: relative;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.faq-item {
  background: rgba(26, 21, 37, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.faq-item:hover {
  border-color: var(--arcane-hex);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: transparent;
  border: none;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
}

.faq-question:active {
  color: rgba(255, 255, 255, 0.7);
}

@media (hover: hover) and (pointer: fine) {
  .faq-question:hover {
    color: var(--arcane-hex);
  }
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  transition: transform 0.4s ease;
  color: var(--arcane-hex);
  line-height: 1;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq-answer-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  color: #a0aab2;
  line-height: 1.6;
  font-size: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.5rem;
  padding-top: 1.5rem;
}

/* =========================================
       LIGHT MODE
    ========================================= */
body.light-mode {
  --page-bg: #f1f5f9;
  --page-text: #0f172a;
}

body.light-mode *:focus-visible {
  outline-color: #2563eb !important; /* Azul royal vibrante da Vercel/Stripe */
}

body.light-mode .logo {
  color: #0f172a !important;
  text-shadow: none !important;
}

body.light-mode nav {
  background: #ffffff !important;
  backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .nav-links a:not(.btn-cv) {
  color: #0f172a !important;
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h1[style],
body.light-mode h2[style],
body.light-mode h3[style],
body.light-mode .hero-subtitle {

  text-shadow: none !important;
  color: #0f172a !important; /* Títulos marcantes em Black/Slate-900 */
}

body.light-mode .btn-projeto,
body.light-mode a[download],
body.light-mode button:not(.theme-toggle-btn):not(.ut-btn) {
  background: linear-gradient(
    135deg,
    #1d4ed8,
    #4f46e5
  ) !important; /* Degradê Indigo/Blue elegante */
  color: #ffffff !important;
  text-shadow: none !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25) !important; /* Sombra brilhante e conectada */
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Light Mode Button Micro-Interactions */
body.light-mode .btn-projeto:active,
body.light-mode a[download]:active,
body.light-mode button:not(.theme-toggle-btn):not(.ut-btn):active {
  transform: translateY(2px) scale(0.98) !important;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.2) !important;
}

@media (hover: hover) and (pointer: fine) {
  body.light-mode .btn-projeto:hover,
  body.light-mode a[download]:hover,
  body.light-mode button:not(.theme-toggle-btn):not(.ut-btn):hover {
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3) !important;
  }
}

body.light-mode footer,
body.light-mode .footer {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}
body.light-mode footer p,
body.light-mode footer span {
  color: #64748b !important;
}

body.light-mode .glitch-title {
  color: #0f172a !important;
}

body.light-mode .hero-name,
body.light-mode .hero-text,
body.light-mode p,
body.light-mode span,
body.light-mode small,
body.light-mode .contact-link {
  color: #475569 !important; /* Escala cinza moderna (Slate 600) para textos secundários */
}

/* Aviso 'Em breve' na galeria */
body.light-mode .design-header div[style*="margin-top: -15px"] {
  color: #475569 !important;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

/* Manter destaque do "Em Alta" e "Em Declínio" na dashboard */
body.light-mode #tech-trends-2030 span[style*="00ffff"] {
  color: #2563eb !important;
  text-shadow: none !important;
}
body.light-mode #tech-trends-2030 span[style*="ff00ff"] {
  color: #e11d48 !important;
  text-shadow: none !important;
}

/* Bento Box Reformat EXCLUINDO componentes Undertale */
body.light-mode .design-card,
body.light-mode .kurz-card,
body.light-mode .narrative-box,
body.light-mode .contact-panel {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important; /* Contraste de borda refinado */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .tech-label {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.light-mode .kurz-tag {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode .kurz-tag[data-tooltip]::before {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .contact-link {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  color: #0f172a !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body.light-mode .contact-link:hover {
  border-color: var(--arcane-hex) !important;
  color: var(--arcane-hex) !important;
  background: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow:
    0 15px 35px rgba(0, 229, 255, 0.15),
    inset 0 0 15px rgba(0, 229, 255, 0.05) !important;
}

body.light-mode .tech-bar-container {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .tech-color-cyan {
  color: #2563eb !important; /* Blue 600 */
  text-shadow: none !important;
}
body.light-mode .tech-bg-cyan {
  background: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.15),
    #2563eb
  ) !important;
  box-shadow: none !important;
}

body.light-mode .tech-color-magenta {
  color: #df2c3e !important; /* Ajustado para vermelho glitch no light mode */
  text-shadow: none !important;
}
body.light-mode .tech-bg-magenta {
  background: linear-gradient(
    90deg,
    rgba(223, 44, 62, 0.15),
    #df2c3e
  ) !important;
  box-shadow: none !important;
}

/* === CORREÇÃO FORÇADA DE FUNDOS: EVITAR SOBREPOSIÇÃO BRUTAL EM CERTAS SEÇÕES === */
body.light-mode #hero,
body.light-mode #game-dev,
body.light-mode #sobre,
body.light-mode #tech-stack,
body.light-mode #soft-skills,
body.light-mode #projetos,
body.light-mode #projetos-design,
body.light-mode #suporte-gestao,
body.light-mode #tech-trends-2030,
body.light-mode #faq,
body.light-mode #cta-final {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
}

/* Regras do Light Mode para o FAQ (Contraste Perfeito) */
body.light-mode .faq-item {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
}
body.light-mode .faq-item:hover {
  border-color: #cbd5e1 !important;
}
body.light-mode .faq-question {
  color: #0f172a !important;
  font-weight: 600 !important;
}
body.light-mode .faq-icon {
  color: #2563eb !important;
}
body.light-mode .faq-answer-content {
  color: #475569 !important;
  border-top-color: #f1f5f9 !important;
}

/* =========================================
       TECH TRENDS BARS & NUMBERS
    ========================================= */
.tech-bar-container {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tech-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 2s cubic-bezier(0.25, 1, 0.5, 1);
}

.tech-color-cyan {
  color: #00ffff;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}
.tech-bg-cyan {
  background: linear-gradient(90deg, transparent, #00ffff);
  box-shadow: 0 0 10px #00ffff;
}

.tech-color-magenta {
  color: #ff4a5a;
  text-shadow: 0 0 5px rgba(255, 74, 90, 0.5);
}
.tech-bg-magenta {
  background: linear-gradient(90deg, transparent, #ff4a5a);
  box-shadow: 0 0 10px #ff4a5a;
}

/* =========================================
       FIXES FINAIS DE LIGHT MODE (MOBILE + OVERLAY + SEARCH)
    ========================================= */
body.light-mode .nav-links {
  background: transparent !important;
  border: none !important;
}

@media (max-width: 767px) {
  body.light-mode .nav-links {
    background: #ffffff !important;
    border-left: 1px solid #e2e8f0 !important;
  }
}

body.light-mode .nav-links.active {
  box-shadow:
    0 0 0 100vw rgba(0, 0, 0, 0.3),
    -10px 0 30px rgba(0, 0, 0, 0.05) !important; /* Overlay sutil escuro */
}

body.light-mode .nav-links a:not(.btn-cv) {
  color: #0f172a !important; /* Texte limpo e escuro */
}

body.light-mode .hamburger-line {
  background-color: #0f172a !important; /* Linhas em escuro */
}

/* Suavização dos botões flutuantes e hamburger no modo claro */
@media (max-width: 767px) {
  body.light-mode .hamburger {
    background-color: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  }
}

body.light-mode body.light-mode #searchInput {
  background: rgba(
    0,
    0,
    0,
    0.03
  ) !important; /* Cinza muito translúcido para contraste */
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-mode #searchInput::placeholder {
  color: rgba(0, 0, 0, 0.5) !important;
}

body.light-mode #searchInput:focus {
  border-color: #2563eb !important;
  background: #fff !important;
}


body.light-mode #projetos .dialogue-box span {
  color: var(--spider-yellow) !important;
}

/* THEME TOGGLE BUTTON */
.theme-toggle-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(20, 25, 38, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

body.light-mode .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: #1e293b;
}

.theme-toggle-btn:hover {
  transform: scale(1.1) rotate(-5deg);
  border-color: var(--arcane-hex);
}

/* ==========================================================================
       TOAST NOTIFICATION (COPY EMAIL)
       ========================================================================== */
#toast-notificacao {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 16px 24px;
  background: rgba(20, 25, 38, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  border-left: 4px solid var(--arcane-hex);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  pointer-events: none;
}

.toast-escondido {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.toast-visivel {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s ease;
  pointer-events: auto;
}

/* Light Mode para o toast e o github card */
body.light-mode #toast-notificacao {
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  border-left-color: #005f73;
}
body.light-mode #live-github-card {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #334155 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}
body.light-mode #live-github-card strong {
  color: #005f73 !important;
  text-shadow: none !important;
}
body.light-mode #status-disponibilidade {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}
body.light-mode #status-disponibilidade #texto-status {
  color: #334155 !important;
}
body.light-mode #widget-clima {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}
body.light-mode #widget-clima #clima-icone {
  color: #005f73 !important;
}
body.light-mode #widget-clima #clima-texto {
  color: #334155 !important;
}

/* =========================================
       GLITCH OVERLAY (THEME TRANSITION - ENHANCED CYBERPUNK)
       ========================================= */
#glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000;
  pointer-events: none;
  background: rgba(3, 7, 18, 0.4); /* arcane-bg but transparent */
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: opacity 0.35s ease-in-out, backdrop-filter 0.35s ease-in-out, -webkit-backdrop-filter 0.35s ease-in-out;
}

body.light-mode #glitch-overlay {
  background: rgba(253, 251, 247, 0.4); /* light mode tint */
}

#glitch-overlay.ativar-glitch {
  opacity: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* =========================================
       ACESSIBILIDADE: REDUCE MOTION (PONTO 7)
       ========================================= */
@media (prefers-reduced-motion: reduce) {
  /* Desativa smooth scroll */
  html {
    scroll-behavior: auto !important;
  }

  /* Desativa transições arrastadas globais */
  * {
    transition-duration: 0.1s !important;
  }

  /* Remove transformações extremas */
  .btn-spider:hover,
  .btn-cv:hover {
    transform: none !important;
    animation: none !important;
  }

  /* Oculta Scanlines que podem causar tontura */

  /* Glitch: Transforma flash piscante em Fade Suave */
  .ativar-glitch {
    animation: soft-fade-overlay 0.45s ease-in-out forwards !important;
    backdrop-filter: blur(5px) !important;
  }
  .ativar-glitch::before,
  .ativar-glitch::after {
    display: none !important;
  }

  /* Retro: Transforma clip-path rasgando a tela em Fade Suave */
  .ativar-retro {
    animation: soft-fade-overlay 0.8s ease-in-out forwards !important;
    background: #110d00 !important;
    color: transparent !important; /* Esconde frase piscante */
  }

  /* Remove piscar agressivo do botão Arcade e do OMORI Shake */
  #hero::before {
    animation: none !important;
  }

  .hero-subtitle::before {
    animation: none !important;
    opacity: 1 !important;
  }

  /* Keyframe Substituto Comum -> Fade In e Out Suave */
  @keyframes soft-fade-overlay {
    0% {
      opacity: 0;
    }
    30% {
      opacity: 1;
    }
    70% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
}

/* =========================================
       PERFORMANCE: CONTENT VISIBILITY
       ========================================= */

/* Efeito OMORI Shake no Hover */

@keyframes omori-shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  20% {
    transform: translate(-2px, -1px) rotate(-1deg);
  }
  40% {
    transform: translate(1px, -2px) rotate(1deg);
  }
  60% {
    transform: translate(-1px, 2px) rotate(0deg);
  }
  80% {
    transform: translate(2px, 1px) rotate(1deg);
  }
  100% {
    transform: translate(-1px, -1px) rotate(-1deg);
  }
}
.kurz-tag {
  transition: transform 0.2s ease;
  cursor: default;
}
.kurz-tag:hover {
  transform: scale(1.1);
}
.kurz-tag img {
  transition: transform 0.2s ease;
}

#btn-topo {
  position: fixed;
  bottom: 20px;
  right: 20px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 99;
  background: var(--arcane-hex);
  color: #030712;
  border: none;
  border-radius: 50px;
  width: 50px;
  height: 50px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 229, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
#btn-topo.show {
  opacity: 1;
  pointer-events: auto;
}
#btn-topo:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 229, 255, 0.6);
}
body.light-mode #btn-topo {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}
body.light-mode #btn-topo:hover {
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.6);
}
#projetos {
  padding: 80px 5%;
  position: relative;
  z-index: 10;
}

/* =========================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ========================================= */
@media (max-width: 768px) {
  .narrative-box,
  .contact-panel,
  .design-card,
  .kurz-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(15, 20, 30, 0.95) !important;
  }

  body.light-mode .narrative-box,
  body.light-mode .contact-panel,
  body.light-mode .design-card,
  body.light-mode .kurz-card {
    background: #ffffff !important;
  }
}

/* =========================================
   ACCESSIBILITY: FOCUS STATES (Laboratório Aberto)
   ========================================= */
#projetos .btn-spider:focus-visible {
  outline: 3px dashed var(--arcane-hex) !important;
  outline-offset: 6px !important;
  transform: skew(-6deg) translateY(-4px) scale(1.02) !important;
  box-shadow: 8px 8px 0 var(--spider-blue) !important;
  background: #fff;
  color: #000;
  transition: all 0.2s ease-out;
}

body.light-mode #projetos .btn-spider:focus-visible {
  outline-color: #2563eb !important;
  background: linear-gradient(135deg, #1d4ed8, #4f46e5) !important;
  color: #fff !important;
  box-shadow:
    0 4px 14px rgba(79, 70, 229, 0.4),
    0 0 0 4px rgba(37, 99, 235, 0.2) !important;
}

/* =========================================
   SKELETON LOADER
   ========================================= */
.skeleton-text {
  display: inline-block;
  min-width: 28px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite ease-in-out;
  vertical-align: middle;
}

body.light-mode .skeleton-text {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.05) 25%,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0.05) 75%
  );
  background-size: 200% 100%;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* =========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================= */
@media (max-width: 768px) {
  nav,
  .theme-toggle-btn,
  .hamburger {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Disable heavy shadows during scroll if possible by flattening them a bit, but for now we trust disabling blur */
}

/* Enable hardware acceleration for frequently moving elements */
.project-card,
.design-card,
.theme-toggle-btn {
  will-change: transform;
}

/* =========================================
   AGGRESSIVE PERFORMANCE OPTIMIZATIONS
   ========================================= */

/* Backdrop filters on scrolling elements cause massive layout recalculations. Disable them globally. */
.narrative-box,
.contact-panel,
.design-card,
.kurz-card,
.project-card,
.testimonial-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  /* Enhance the background opacity slightly to compensate for the loss of blur */
  background: rgba(10, 14, 20, 0.85) !important;
}

body.light-mode .narrative-box,
body.light-mode .contact-panel,
body.light-mode .design-card,
body.light-mode .kurz-card,
body.light-mode .project-card,
body.light-mode .testimonial-card {
  background: rgba(255, 255, 255, 0.95) !important;
}

/* Ensure smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* =========================================
   ACCESSIBILITY & SEO
   ========================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* =========================================
   THEME BUTTON GLITCH
   ========================================= */
@keyframes theme-btn-subtle-glitch {
  0% { transform: scale(1) rotate(0deg); filter: brightness(1); }
  25% { transform: scale(0.9) rotate(-10deg); filter: brightness(1.2); }
  50% { transform: scale(1.1) rotate(10deg); filter: brightness(1.4); }
  75% { transform: scale(0.95) rotate(-5deg); filter: brightness(1.1); }
  100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}

.theme-btn-glitch {
  animation: theme-btn-subtle-glitch 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both !important;
}






/* =========================================
   EMAIL RIPPLE ANIMATION (REFINED DYNAMIC)
   ========================================= */
.contact-link.email { position: relative; overflow: hidden; }

.ripple-span {
  position: absolute;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: dynamic-ripple 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  pointer-events: none;
}

body.light-mode .ripple-span {
  background: rgba(0, 0, 0, 0.15);
}

@keyframes dynamic-ripple {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(25); opacity: 0; }
}

/* =========================================
   LIGHT MODE INLINE STYLE OVERRIDES
   ========================================= */
body.light-mode [style*="color: #fff"],
body.light-mode [style*="color: #f8fafc"] {
  color: #0f172a !important;
}

body.light-mode [style*="color: #a0aab2"],
body.light-mode [style*="color: #a0aec0"],
body.light-mode [style*="color: #d1d5db"],
body.light-mode [style*="color: #94a3b8"],
body.light-mode [style*="color: #bbb"] {
  color: #475569 !important;
}

body.light-mode [style*="color: var(--arcane-hex)"] {
  color: #0f172a !important; /* Padronizado para preto (mesma cor dos outros títulos) */
}

/* Excluímos o game-wrapper (Undertale) da sobreposição do cyan, e o que não for será preto */
body.light-mode :not(#game-wrapper) > [style*="color: #00ffff"] {
  color: #0f172a !important;
}

/* Ensure card text isn't lost if no inline style is used */
body.light-mode .design-card h3,
body.light-mode .design-card strong {
  color: #1e293b !important;
}

body.light-mode .design-card p {
  color: #475569 !important;
}
