:root {
  --color-background: #080808;
  --color-text: #f9f9f9;
  --color-primary: #5d3a6f;
  --color-secondary: #f8c9a7;
  --font-primary: "Noto Sans", sans-serif;
}

html {
  scroll-behavior: smooth;
}
body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-primary);
  margin: 0;
  overflow-x: hidden;
}

/* --- HEADER --- */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 2rem;
  z-index: 1000;
  transition: opacity 0.5s ease-out, background-color 0.3s ease;
  opacity: 0; /* Inicia oculto */
  pointer-events: none;
}
.main-header.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.main-header.has-scrolled {
  background-color: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(10px);
}
.header-container {
  width: 100%;
  max-width: 1400px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}
.logo {
  height: 40px;
}
.logo img {
  height: 100%;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}
.nav-link:hover {
  color: var(--color-secondary);
}
.cta-button {
  background-color: var(--color-text);
  color: var(--color-background);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}
.cta-button:hover {
  background-color: var(--color-secondary);
  color: var(--color-background);
}

/* --- HERO CON PINNING --- */
#hero-pin-container {
  height: 300vh; /* Aumentado para dar más tiempo a la animación y lectura */
  position: relative;
}
.hero {
  height: 100vh;
  position: sticky; /* Se pega al contenedor */
  top: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.hero-background-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(8, 8, 8, 0.6);
  z-index: 2;
}
.hero-initial-content {
  position: absolute;
  z-index: 4;
  text-align: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.hero-center-logo {
  width: clamp(100px, 20vw, 200px);
}
.scroll-down-text {
  margin-top: 1.5rem;
  opacity: 0.7;
  font-weight: 300;
  letter-spacing: 1px;
}
.hero-main-content {
  position: absolute;
  z-index: 3;
  text-align: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.hero-main-content h1 {
  font-size: clamp(2.5rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
}
.hero-main-content h1 .word {
  display: inline-block;
}
.hero-main-content .subtitle {
  font-size: 1.25rem;
  max-width: 600px;
  margin: 1.5rem auto 0;
  line-height: 1.6;
}

/* --- MARQUEE --- */
.marquee-section {
  display: flex;
  flex-direction: column;
}
.marquee {
  width: 100%;
  overflow: hidden;
  padding: 0.5rem 0;
  white-space: nowrap;
}
.marquee-content {
  display: flex;
  animation: marquee 30s linear infinite;
}
#marquee1 {
  background-color: #f9f9f9;
  color: #080808;
}
#marquee2 {
  background-color: #1a1a1a;
  color: #f9f9f9;
}
#marquee2 .marquee-content {
  animation-direction: reverse;
  animation-duration: 40s;
}
#marquee3 {
  background-color: #f9f9f9;
  color: #080808;
}
#marquee3 .marquee-content {
  animation-duration: 25s;
}
.marquee-content span {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 0 1.5rem;
  text-transform: uppercase;
  flex-shrink: 0;
}
.font-light {
  font-weight: 300;
}
.font-bold {
  font-weight: 800;
}
.font-italic {
  font-style: italic;
}

@keyframes marquee {
  from {
    transform: translateX(0%);
  }
  to {
    transform: translateX(-50%);
  }
}

/* --- SERVICIOS --- */
.services-sticky-section {
  padding: 15vh 2rem;
}
.sticky-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
}
.sticky-visual {
  position: sticky;
  top: 25vh;
  height: 50vh;
}
.sticky-visual h3 {
  font-size: 2.8rem;
  font-weight: 700;
}
.sticky-visual p {
  font-size: 1.1rem;
  max-width: 400px;
  opacity: 0.8;
  line-height: 1.7;
}
.scrolling-content {
  display: flex;
  flex-direction: column;
  gap: 8vh;
  padding-bottom: 20vh;
}
.service-item {
  padding: 1.5rem;
  border-left: 3px solid var(--color-primary);
  opacity: 0.3;
  transition: opacity 0.4s ease-in-out;
}
.service-item.is-active {
  opacity: 1;
}
.service-item h4 {
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
}
.service-item p {
  font-size: 1rem;
  opacity: 0.8;
  line-height: 1.7;
}

/* --- PORTFOLIO --- */
.portfolio-section {
  padding: 10vh 2rem;
  background-color: #111;
}
.section-title {
  font-size: 3rem;
  margin-bottom: 5rem;
  text-align: center;
}
.portfolio-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto 8rem;
  align-items: center;
}
.portfolio-item:nth-child(even) .portfolio-image {
  grid-column: 2;
}
.portfolio-item:nth-child(even) .portfolio-description {
  grid-column: 1;
  grid-row: 1;
}
.portfolio-image {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.portfolio-image img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}
.portfolio-image:hover img {
  transform: scale(1.05);
}
.portfolio-description h4 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
}
.portfolio-description p {
  font-size: 1.1rem;
  opacity: 0.8;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.portfolio-description .btn-link {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 700;
}

/* --- CTA --- */
.cta-section {
  padding: 10vh 2rem;
  text-align: center;
  background-color: #1a1a1a;
}
.cta-section h2 {
  font-size: 3rem;
  max-width: 800px;
  margin: 0 auto 1rem;
}
.cta-section p {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
}

/* --- FOOTER --- */
.main-footer {
  padding: 3rem 2rem;
  border-top: 1px solid #333;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo img {
  height: 30px;
}
.footer-links a {
  margin: 0 1rem;
  color: var(--color-text);
  text-decoration: none;
}
.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #333;
  font-size: 0.9rem;
  opacity: 0.6;
}

/* --- RESPONSIVE Y MENÚ MÓVIL --- */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 1001;
}
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background-color: #111;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.4s ease-in-out;
  }
  .main-nav.is-open {
    right: 0;
  }
  .main-nav a {
    font-size: 1.5rem;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .sticky-container {
    grid-template-columns: 1fr;
  }
  .sticky-visual {
    position: static;
    height: auto;
    text-align: center;
    margin-bottom: 3rem;
  }
  .scrolling-content {
    gap: 5vh;
  }
  .portfolio-item,
  .portfolio-item:nth-child(even) {
    grid-template-columns: 1fr;
  }
  .portfolio-item:nth-child(even) .portfolio-image,
  .portfolio-item:nth-child(even) .portfolio-description {
    grid-column: 1;
    grid-row: auto;
  }
}
