:root {
  --color-primary: #b97030;
  --color-primary-rgb: 185, 112, 48;
  --color-background-light: #f8fafcee;
  --color-background-dark: #080503;
  --font-display: "Plus Jakarta Sans", sans-serif;
}

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

body {
  font-family: var(--font-display);
  background-color: var(--color-background-light);
  color: #0f172a; /* text-slate-900 */
  transition:
    background-color 0.3s,
    color 0.3s;
}

.dark body {
  background-color: var(--color-background-dark);
  color: #f1f5f9; /* text-slate-100 */
}

/* Header Styles */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  backdrop-filter: blur(12px);
  background-color: rgba(248, 250, 252, 0.7);
  border-bottom: 1px solid #e2e8f0; /* slate-200 */
}

.dark .main-header {
  background-color: rgba(8, 9, 6, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  max-width: 80rem; /* max-w-7xl */
  margin: 0 auto;
  padding: 0 2.5rem; /* px-10 */
  height: 5rem; /* h-20 */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem; /* text-2xl */
  font-weight: 800; /* font-extrabold */
  letter-spacing: -0.05em; /* tracking-tighter */
}

.text-primary {
  color: var(--color-primary);
}

.nav-links {
  display: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
    align-items: center;
    gap: 2rem; /* space-x-8 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em; /* tracking-widest */
  }
}

.nav-links a {
  transition: color 0.15s;
}
.nav-links a:hover {
  color: var(--color-primary);
}

/* Components */
.btn-icon {
  padding: 0.5rem;
  border-radius: 9999px;
  transition: background-color 0.15s;
}
.btn-icon:hover {
  background-color: #e2e8f0; /* slate-200 */
}
.dark .btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background-color: var(--color-primary);
  color: black;
  padding: 0.625rem 1.5rem; /* py-2.5 px-6 */
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: transform 0.15s;
}
.btn-primary:hover {
  transform: scale(1.05);
}

/* Utilities reused */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .glass {
  background: rgba(255, 255, 255, 0.03);
}

.light-glass {
  background: rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.bg-gradient-radial {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(194, 153, 118, 0.08) 0%,
    transparent 70%
  );
}

/* Neon Glow Effect */
.card-glow {
  position: relative;
  border-radius: 2rem;
  isolation: isolate; /* Create a new stacking context */
}

section {
  isolation: isolate;
}

.card-glow::before {
  content: "";
  position: absolute;
  inset: -4px;
  background: linear-gradient(
    25deg,
    #c29976,
    transparent,
    #e17c3b,
    transparent
  );
  background-size: 400% 400%;
  border-radius: 2.3rem;
  filter: blur(20px);
  z-index: -1;
  opacity: 0.2;
  transition: opacity 0.3s ease;
  animation: glowing 4s linear infinite;
}

.card-glow:hover::before {
  opacity: 1.2;
}

.btn-site-light {
  background-color: #bb7b3b;
  color: #0b0705;
  border: 1px solid rgba(212, 163, 115, 0.3);
  transition: all 0.3s ease;
}

.btn-site-light:hover {
  background-color: #ce8541;
  box-shadow: 0 0 20px rgba(212, 163, 115, 0.4);
  color: #c9c9c9;
  transform: translateY(-2px);
  filter: brightness(1.1);
}

@keyframes glowing {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Static Neon Glow */
.static-glow {
  position: relative;
  isolation: isolate;
  background: transparent; /* Ensure transparent so pseudo-elements show */
  border-radius: 1.5rem;
}

/* The Black Background Layer ("Black Div") */
.static-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000000ad; /* Pure black as requested "toda preta" */
  border-radius: 1.5rem;
  z-index: -1;
}

/* The Theme Glow Layer */
.static-glow::before {
  content: "";
  position: absolute;
  inset: -5px;
  background: var(--color-primary);
  border-radius: 2rem;
  filter: blur(20px);
  z-index: -2;
  opacity: 0.2;
}

/* Expandable Description Styles */
.project-card .description-container {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(15, 23, 42, 0.95); /* Solid background for overlay */
}

.dark .project-card .description-container {
  background: rgba(8, 9, 6, 0.95);
}

.project-card.expanded .description-container {
  position: absolute;
  inset: 0;
  height: 100%;
  transform: translateY(0);
  z-index: 20;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Ensure the glass effect remains on the card wrapper */
.project-card {
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: 2rem;
}

/* Profile Image Styles */
.profile-wrapper {
  position: relative;
  width: 380px;
  height: 420px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transform: translateY(-15%);
}

.profile-background {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 90%;
  background: radial-gradient(
    circle at center,
    var(--color-primary),
    transparent 60%
  );
  opacity: 0.3;
  filter: blur(60px);
  z-index: 0;
  animation: blob-pulse 5s infinite ease-in-out alternate;
}

.profile-image-container {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  /* Removed overflow: hidden so image top doesn't get cut if handled by size, 
       but we want the shadow overlay to be contained. 
       Let's keep overflow hidden but ensure image fits. */
  overflow: hidden;
  border-radius: 0 0 100rem 100rem; /* Subtle curve at bottom if desired, or just none */
  border-radius: 2rem; /* Soft rounding */
  border-radius: 0; /* User said "no border", organic. Let's try fully transparent container */
}

/* Let's try to just mask the bottom of the container instead of radius */
.profile-image-container {
  overflow: hidden; /* Needed for the overlay */
  /* Make it "organic" by just being the image shape if possible, but the overlay needs a box. 
        We'll make the container rectangular but the background invisible. */
}

.profile-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.profile-overlay {
  position: absolute;
  bottom: -1px; /* Overlap slightly */
  left: 0;
  right: 0;
  height: 20%;
  width: 89%;
  display: block;
  margin: 0 1 auto;
  background: linear-gradient(to top, var(--color-background-dark), transparent);
  z-index: 20;
  pointer-events: none;
}

@keyframes blob-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.2;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.4;
  }
}

/* Button Glow Animation */
.btn-glow {
  position: relative;
  isolation: isolate;
  background: transparent;
  border-radius: 9999px;
}

/* Black Background for Button */
.btn-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000000;
  border-radius: 9999px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.1); /* Match the border style */
}

.btn-glow::before {
  content: "";
  position: absolute;
  inset: -4px; /* Larger glow for pill shape */
  background: var(--color-primary);
  filter: blur(12px);
  opacity: 0;
  z-index: -2;
  border-radius: 9999px;
  animation: btn-pulse 2s infinite;
}

@keyframes btn-pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

/* Modal Animations */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-modal-in {
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Marquee Animation */
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.animate-scroll {
  animation: scroll 30s linear infinite;
}

.marquee-container:hover .animate-scroll {
  animation-play-state: paused;
}


@keyframes wa-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(194, 153, 118, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(194, 153, 118, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(194, 153, 118, 0);
  }
}

/* Language Switch Styles */
.active-lang {
  filter: grayscale(0) !important;
  opacity: 1 !important;
}

.ease-spring {
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Luxury Contact Cards */
.luxury-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1.5rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit !important;
  margin-bottom: 1rem;
  width: 100%;
}

.luxury-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(var(--color-primary-rgb), 0.5);
  transform: translateY(-2px);
}

.luxury-card-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.luxury-card-content {
  flex: 1;
}

.luxury-card-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  color: white;
}

.luxury-card-text {
  color: #94a3b8; /* slate-400 */
  font-size: 0.95rem;
}

.luxury-card-arrow {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.luxury-card-arrow span {
  font-size: 1.25rem;
  transform: rotate(-45deg);
}

.luxury-card:hover .luxury-card-arrow {
  background: var(--color-primary);
  color: black;
}

.socials-horizontal {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.socials-horizontal a {
  color: #94a3b8;
  transition: all 0.3s ease;
}

.socials-horizontal a:hover {
  color: var(--color-primary);
  transform: scale(1.2);
}

@media (max-width: 640px) {
  .luxury-card {
    padding: 1.25rem;
    gap: 1rem;
  }
  
  .luxury-card-icon {
    width: 3rem;
    height: 3rem;
  }
  
  .luxury-card-arrow {
    width: 2.25rem;
    height: 2.25rem;
  }
}

@media (max-width: 768px) {
  .projects-container,
  .certificates-container {
    display: flex !important;
    overflow-x: auto !important;
    gap: 1.5rem !important;
    padding: 1rem 1.5rem 3rem 1.5rem !important;
    scroll-snap-type: x mandatory !important;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }

  .projects-container::-webkit-scrollbar,
  .certificates-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .projects-container > div,
  .certificates-container > div {
    flex: 0 0 82%;
    scroll-snap-align: center;
  }

  /* Adjust gap for peeking effect */
  .projects-container > div:last-child,
  .certificates-container > div:last-child {
    padding-right: 1.5rem;
  }

  /* Experience Cards Horizontal Scroll */
  .experience-scroll-container {
    display: flex !important;
    overflow-x: auto !important;
    gap: 1.5rem !important;
    padding: 1rem 1.5rem 2rem 1.5rem !important;
    scroll-snap-type: x mandatory !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem !important;
  }

  .experience-scroll-container::-webkit-scrollbar {
    display: none;
  }

  .experience-scroll-container > .group {
    flex: 0 0 82% !important;
    scroll-snap-align: center;
    margin-top: 0 !important; /* Reset Tailwind space-y margin */
  }

  .experience-scroll-container .timeline-line-glow,
  .experience-scroll-container .timeline-dot-glow {
    display: none !important;
  }

  .no-timeline-mobile {
    padding-left: 0 !important;
  }

  .no-timeline-mobile .timeline-line-glow,
  .no-timeline-mobile .timeline-dot-glow {
    display: none !important;
  }
}

.fixed {
  left: 0;
  right: 0;
}

/* Timeline Neon Effects */
.timeline-line-glow {
  background: linear-gradient(to bottom, 
    rgba(var(--color-primary-rgb), 0.5) 0%,
    rgba(var(--color-primary-rgb), 0.2) 50%,
    rgba(var(--color-primary-rgb), 0.5) 100%
  );
  box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.2);
}

.timeline-dot-glow {
  box-shadow: 
    0 0 0 4px var(--color-background-dark),
    0 0 20px rgba(var(--color-primary-rgb), 1.8),
    0 0 40px rgba(var(--color-primary-rgb), 1.4);
  border: none !important;
}
