/* --- Base Styles & Variables --- */
:root {
  --bg-color: #0d0d1a; /* Very dark blue/black */
  --card-bg-color: #1a1a2e; /* Slightly lighter dark blue */
  --navbar-bg-color: #1f1f33;
  --primary-text-color: #e0e0ff; /* Light lavender/white */
  --secondary-text-color: #a0a0cc; /* Muted lavender/grey */
  --accent-color: #6c63ff; /* A placeholder purple accent */
  --glow-color: rgba(108, 99, 255, 0.1);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-radius-sm: 8px;
  --border-radius-md: 15px;
  --border-radius-lg: 25px;
  --font-family: 'Poppins', sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--primary-text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--primary-text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

h1, h2, h3 {
  margin-bottom: 0.8em;
  line-height: 1.2;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.2rem; }

p {
  margin-bottom: 1em;
  color: var(--secondary-text-color);
}

section {
  padding: 80px 0;
  position: relative; /* For pseudo-elements like glows */
}

/* --- Utility Classes --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--secondary-text-color);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  margin-right: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.tag-light {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--secondary-text-color);
  padding: 4px 10px;
  border-radius: 20px; /* Pill shape */
  font-size: 0.8rem;
  margin-bottom: 15px;
  display: inline-block;
}

.cta-button {
  background-color: var(--primary-text-color);
  color: var(--bg-color);
  padding: 12px 25px;
  border-radius: var(--border-radius-lg); /* Pill shape */
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: inline-block;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  background-color: #c0c0f0; /* Lighter hover */
  color: var(--bg-color);
  transform: translateY(-2px);
}

.cta-button.outline {
  background-color: transparent;
  color: var(--primary-text-color);
  border: 1px solid var(--primary-text-color);
}
.cta-button.outline:hover {
   background-color: rgba(255, 255, 255, 0.1);
   color: var(--primary-text-color);
}

/* --- Rotating Badge --- */
.rotating-badge {
  position: fixed;
  top: 150px; /* Adjust as needed */
  right: 30px; /* Adjust as needed */
  width: 100px;
  height: 100px;
  color: var(--secondary-text-color);
  animation: rotate 10s linear infinite;
  z-index: 100;
}

.rotating-badge svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


/* --- Navbar --- */
.navbar {
  padding: 15px 0;
  position: sticky; /* Or fixed, depending on desired behavior */
  top: 20px; /* Spacing from top */
  z-index: 1000;
  width: calc(100% - 60px); /* Adjust width for spacing */
  max-width: 1200px; /* Match container */
  margin: 20px auto 0 auto; /* Center it */
  background-color: var(--navbar-bg-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-text-color);
}
.logo:hover {
  color: var(--primary-text-color); /* Prevent accent color on hover */
}

.nav-links ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-weight: 500;
  color: var(--secondary-text-color);
}

.nav-links a:hover,
.nav-links a.active { /* Add active class via JS if needed */
  color: var(--primary-text-color);
}

/* --- Hero Section --- */
.hero-section {
  min-height: 90vh;
  display: flex;
  align-items: center;
  text-align: center;
  padding-top: 150px; /* Account for navbar */
  padding-bottom: 100px;
  position: relative; /* For pseudo-elements */
  overflow: hidden;
}

.hero-content {
  position: relative; /* To stay above pseudo-elements */
  z-index: 2;
}

.hero-section h1 {
  margin-bottom: 0.3em;
}

.hero-section .subtitle {
  font-size: 1.2rem;
  color: var(--secondary-text-color);
  margin-bottom: 30px;
}

.skill-tags {
  margin-bottom: 30px;
}

.social-icons {
  margin-top: 30px;
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.social-icon {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--secondary-text-color);
  width: 45px;
  height: 45px;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
  background-color: var(--accent-color);
  color: var(--primary-text-color);
}

.scroll-down {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--secondary-text-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  line-height: 40px; /* Center icon vertically */
  text-align: center;
  margin-top: 20px;
  transition: background-color 0.3s ease;
}
.scroll-down:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--primary-text-color);
}

/* Hero Background Effects */
.hero-grid-bg, .contact-grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
      linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px; /* Grid size */
  opacity: 0.5;
  z-index: 0;
}

.hero-glow, .contact-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
  opacity: 0.7;
  z-index: 1;
  pointer-events: none; /* Allow clicks through */
}


/* --- Skills Section --- */
.skills-section .section-subtitle {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  margin-bottom: 40px;
}

.skills-section h2 {
  text-align: center;
}
.skills-section .tag-light {
  display: block;
  width: fit-content;
  margin: 0 auto 15px auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.tool-card {
  background-color: var(--card-bg-color);
  padding: 30px;
  border-radius: var(--border-radius-md);
  text-align: center;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.tool-card .tool-icon {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 15px;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.expertise-card {
  background-color: var(--card-bg-color);
  padding: 30px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
   transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.expertise-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.expertise-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.expertise-card h3 {
  margin-bottom: 0;
  color: var(--primary-text-color);
}

.expert-badge {
  background-color: rgba(108, 99, 255, 0.1); /* Accent bg */
  color: var(--accent-color);
  padding: 4px 10px;
  border-radius: 20px; /* Pill shape */
  font-size: 0.8rem;
  font-weight: 500;
}

/* --- Portfolio Section --- */
/* --- Portfolio Section Enhancements --- */
.portfolio-section .section-header {
  /* Refuerzo de espacio y alineación */
  margin-bottom: 60px;
}
.portfolio-section .section-header h2 {
  font-size: 2.8rem;
}
.portfolio-section .section-header .cta-button {
  padding: 10px 20px;
}

/* Grid ligeramente más amplio */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

/* Cada tarjeta se convierte en un lienzo interactivo */
.portfolio-item {
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.portfolio-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* Imagen de fondo con zoom suave */
.portfolio-item-image {
  width: 100%;
  height: 250px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.5s ease;
}
.portfolio-item:hover .portfolio-item-image {
  transform: scale(1.1);
}

/* Overlay con semitransparencia */
.portfolio-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(13,13,26,0.9) 30%, rgba(13,13,26,0.6) 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}
.portfolio-item:hover .overlay {
  opacity: 1;
}

/* Header info sobre la imagen */
.portfolio-item .header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.portfolio-item .portfolio-icon {
  font-size: 1.6rem;
  color: var(--accent-color);
}
.portfolio-item h3 {
  color: var(--primary-text-color);
  font-size: 1.1rem;
  margin: 0;
}

/* Etiquetas más llamativas */
.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.portfolio-tags .p-tag {
  background-color: var(--accent-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
}

/* --- Contact Section --- */
.contact-section {
  padding-bottom: 50px; /* More space before footer */
}

.contact-box {
  background-color: var(--navbar-bg-color); /* Use navbar color for contrast */
  padding: 50px;
  border-radius: var(--border-radius-lg);
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative; /* For background elements */
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.contact-box .contact-grid-bg, .contact-box .contact-glow {
  opacity: 0.3; /* Less prominent background */
}

.contact-box h2 {
  margin-bottom: 15px;
}
.contact-box p {
  margin-bottom: 30px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.subscribe-form {
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
}

.subscribe-form input[type="email"] {
  flex-grow: 1;
  padding: 12px 20px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--primary-text-color);
  font-family: inherit;
  font-size: 1rem;
}
.subscribe-form input[type="email"]::placeholder {
  color: var(--secondary-text-color);
}
.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.3);
}

.subscribe-form .cta-button {
  flex-shrink: 0; /* Prevent button shrinking */
}

/* --- Footer --- */
.footer {
  padding: 30px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 50px; /* Space above footer */
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--secondary-text-color);
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--secondary-text-color);
  margin-left: 20px;
}
.footer-links a:hover {
  color: var(--primary-text-color);
}


/* --- Responsive Design --- */
@media (max-width: 992px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2rem; }

  .navbar {
      width: calc(100% - 40px);
      top: 10px;
      margin-top: 10px;
  }
  .nav-container {
      padding: 0 15px;
  }
  .nav-links { display: none; } /* Simple hide for mobile, needs burger menu logic */
  .cta-button { padding: 10px 20px; font-size: 0.9rem; }

  .rotating-badge { display: none; } /* Hide badge on smaller screens */

  .hero-section { padding-top: 120px; }

  .portfolio-section .section-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 15px;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.8rem; }
  section { padding: 60px 0; }

  .expertise-grid, .portfolio-grid, .tools-grid {
      grid-template-columns: 1fr; /* Stack cards */
  }

  .subscribe-form {
      flex-direction: column;
      gap: 15px;
  }
   .subscribe-form .cta-button {
       width: 100%;
   }

  .contact-box { padding: 40px 30px; }

  .footer-content {
      flex-direction: column;
      gap: 10px;
      text-align: center;
  }
  .footer-links { margin-top: 10px; }
  .footer-links a { margin: 0 10px; }
}

@media (max-width: 576px) {
   h1 { font-size: 2rem; }
   .hero-section .subtitle { font-size: 1rem; }
   .tag { font-size: 0.8rem; padding: 5px 10px; }
   .social-icon { width: 40px; height: 40px; font-size: 1rem;}
   .contact-box { padding: 30px 20px; }
   .navbar .logo { font-size: 1.3rem; }
   .navbar { width: calc(100% - 20px); }
}