:root {
  /* Paleta azul cielo / blanco */
  --color-sky-light: #e3f2fd;
  --color-sky: #90caf9;
  --color-sky-medium: #64b5f6;
  --color-sky-dark: #42a5f5;
  --color-blue: #2196f3;
  --color-blue-dark: #1976d2;
  --color-white: #ffffff;
  --color-text: #1a202c;
  --color-text-light: #4a5568;
  --color-text-muted: #718096;
  --color-border: #e2e8f0;
  --color-shadow: rgba(33, 150, 243, 0.1);
  
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Outfit', -apple-system, system-ui, sans-serif;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  --radius: 1rem;
  --radius-sm: 0.5rem;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--color-white);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Navegación */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 10px var(--color-shadow);
}

.nav__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-blue-dark);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  gap: 2.5rem;
}

.nav__links a {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 400;
  transition: color var(--transition);
}

.nav__links a:hover {
  color: var(--color-blue);
}

/* Escena Parallax - Solo visible en el hero */
.parallax-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.parallax-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  will-change: transform;
}

/* Cielo gradiente */
.sky {
  background: linear-gradient(180deg, 
    #87ceeb 0%,
    #b4e1f7 30%,
    #d4f1f9 60%,
    #e8f6fc 100%
  );
}

/* Nubes */
.clouds-back,
.clouds-mid {
  pointer-events: none;
  z-index: 2; /* Asegurar que estén visibles sobre el cielo */
}

.cloud {
  position: absolute;
  width: auto;
  height: 16vh; /* Reducido para que no sean enormes, pero escalen */
  min-height: 120px; /* Mínimo razonable */
  max-height: 300px; /* Máximo controlado */
  animation: float 25s ease-in-out infinite;
  opacity: 1; /* Asegurar visibilidad */
  z-index: 3; /* Nubes al frente de su capa */
}

.cloud-1 {
  top: 15vh;
  left: 5%; /* Posición final cuando entra */
  animation-delay: 0s;
}

.cloud-2 {
  top: 25vh;
  right: 8%; /* Posición final cuando entra */
  left: auto;
  animation-delay: -10s;
}

.cloud-3 {
  top: 35vh;
  left: 12%; /* Posición final cuando entra */
  animation-delay: -5s;
}

.cloud-4 {
  top: 45vh;
  right: 15%; /* Posición final cuando entra */
  left: auto;
  animation-delay: -15s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  33% {
    transform: translateY(-15px) translateX(10px);
  }
  66% {
    transform: translateY(-8px) translateX(-8px);
  }
}

/* Pájaros */
.birds {
  pointer-events: none;
  z-index: 5; /* Por encima de las nubes pero debajo de la persona */
}

.bird {
  position: absolute;
  width: 100px;
  height: auto;
  opacity: 0; /* La opacidad será controlada por JavaScript al hacer scroll */
  transition: opacity 0.5s ease; /* Transición suave */
  z-index: 6;
}

.bird-1 {
  top: 80vh; /* Más abajo que las nubes */
  left: 15%;
}

.bird-2 {
  top: 90vh;
  right: 20%;
}

.bird-3 {
  top: 100vh;
  left: 60%;
}

.bird-1 {
  top: 20vh;
  left: 12%;
}

.bird-2 {
  top: 30vh;
  right: 25%;
}

.bird-3 {
  top: 40vh;
  left: 40%;
}

.bird-4 {
  top: 25vh;
  right: 15%;
}

.bird-5 {
  top: 50vh;
  left: 60%;
}

@keyframes fadeInBird {
  to {
    opacity: 1;
  }
}

/* Ciudad en primer plano - delante del retrato */
.city-foreground {
  position: absolute; /* Absolute dentro del contenedor fixed .parallax-scene */
  bottom: -520px; /* Empieza MUY ABAJO - fuera de vista al inicio */
  left: 0;
  width: 100%;
  height: clamp(500px, 70vh, 800px); /* Más alta para mejor cobertura */
  z-index: 15 !important; /* DELANTE del humano (z-index: 10) */
  pointer-events: none;
  will-change: transform, opacity;
  overflow: hidden; /* Oculta cualquier parte que se salga */
  transition: opacity 0.4s ease-out; /* Transición de fade-out más rápida */
}

.city-foreground svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: bottom;
}

/* Ajuste automático de ciudad en diferentes viewports */
@media (max-height: 700px) {
  .city-foreground {
    height: clamp(150px, 25vh, 250px);
  }
}

@media (min-height: 1000px) {
  .city-foreground {
    height: clamp(300px, 35vh, 500px);
  }
}

/* Layout */
.container {
  max-width: min(1400px, 95vw);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

.container--narrow {
  max-width: min(900px, 90vw);
}

.section {
  min-height: auto;
  display: flex;
  align-items: center;
  padding: clamp(3rem, 10vh, 6rem) 0;
  position: relative;
}

/* Hero - Altura moderada para mejor control del parallax */
.hero {
  padding-top: clamp(8rem, 15vh, 12rem);
  padding-bottom: clamp(4rem, 10vh, 8rem);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  background: transparent;
  isolation: isolate;
  min-height: 220vh; /* Aumentado para dar más margen de scroll antes de que la siguiente sección tape la imagen */
}

.hero__center {
  max-width: min(500px, 90vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 4vh, 2.5rem);
  padding: 0 clamp(1rem, 3vw, 2rem);
  margin-bottom: clamp(60px, 12vh, 120px);
  margin-top: clamp(80px, 15vh, 150px); /* Más centrado verticalmente */
  z-index: 5;
}

/* Logo personalizable */
.hero__logo {
  margin-bottom: 0;
  z-index: 8;
}

.hero__logo img {
  max-width: 400px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.logo-text {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw + 1rem, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
}

.logo-text--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.logo-layer {
  z-index: 20; /* Delante del retrato (z-index: 8) */
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* padding-top is now handled by JS for perfect alignment */
}

.logo-parallax-text {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 6vw + 1rem, 6.2rem);
  font-weight: 700;
  color: var(--color-white); /* Texto blanco para resaltar sobre la imagen */
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.2),
               0 4px 30px rgba(0, 0, 0, 0.15);
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1vw, 0.8rem);
  opacity: 0;
  position: relative;
}

.logo-parallax-text__word {
  display: inline-block;
  white-space: nowrap;
  transform: translateX(0);
}

.logo-parallax-text__separator {
  font-weight: 300;
  opacity: 0.3;
}

/* Retrato integrado sin efectos de caja - posicionado en el suelo */
.hero__portrait {
  position: absolute; /* Absolute dentro del contenedor fixed .parallax-scene */
  bottom: -950px; /* Empieza muy abajo - totalmente invisible */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  /* Height and Max-Width are now controlled by JS for perfect alignment */
  will-change: transform, opacity;
  z-index: 8 !important; /* Detrás de la ciudad (15) hasta que desaparezca */
  overflow: hidden; /* No muestra los pies flotando */
  opacity: 0; /* Invisible al inicio */
  transition: opacity 0.5s ease; /* Transición suave para aparecer */
}

/* Media queries for portrait removed as JS handles it */

.portrait__frame {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end; /* Alinea el contenido al fondo */
  justify-content: center;
}

.portrait__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
  /* Mask removed to ensure it touches the bottom line solidly */
}

.portrait__silhouette {
  width: 100%;
  height: 100%;
  opacity: 0.90; /* Un poco más visible */
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.4)); /* Sombra más pronunciada */
  transition: all 0.4s ease;
  object-fit: contain;
  object-position: bottom; /* SVG alineado desde abajo */
}

.hero__portrait:hover .portrait__silhouette {
  opacity: 0.95;
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.4));
}

.hero__portrait:hover .portrait__frame {
  transform: scale(1.02);
  transition: transform 0.4s ease;
}

/* Scroll Indicator - Fixed to viewport to be visible immediately */
.scroll-indicator {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 1;
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Hide scroll indicator when scrolling down (handled by JS class or just let it be) */
body.scrolled .scroll-indicator {
  opacity: 0;
}

.scroll-text {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  font-weight: 500;
  animation: pulse 2s infinite;
}

.scroll-line {
  width: 2px;
  height: 40px;
  background: var(--color-sky-medium);
  animation: scroll 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes scroll {
  0%, 100% { 
    transform: translateY(0); 
    opacity: 0.3; 
  }
  50% { 
    transform: translateY(20px); 
    opacity: 1; 
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn--primary {
  background: var(--color-blue);
  color: var(--color-white);
  border-color: var(--color-blue);
  box-shadow: 0 4px 14px var(--color-shadow);
}

.btn--primary:hover {
  background: var(--color-blue-dark);
  border-color: var(--color-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-shadow);
}

.btn--secondary {
  background: transparent;
  color: var(--color-blue);
  border-color: var(--color-blue);
}

.btn--secondary:hover {
  background: var(--color-sky-light);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

/* Section Headers */
.section__header {
  margin-bottom: var(--spacing-lg);
}

.section__header--center {
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--spacing-lg);
}

.label {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-blue);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3vw + 1rem, 3.5rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.section__description {
  font-size: 1.125rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* Instagram Grid 3x3 */
.work {
  background: var(--color-sky-light);
  min-height: auto;
  padding: var(--spacing-xl) 0;
  position: relative;
  z-index: 10;
  isolation: isolate;
}

.instagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(0.75rem, 2vw, 1rem);
  max-width: 900px;
  margin: 0 auto;
}

@supports (grid-template-columns: subgrid) {
  @media (min-width: 640px) {
    .instagram-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
}

.instagram-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-light);
}

.instagram-loading p {
  margin: 0;
}

.insta-card {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-white);
  cursor: pointer;
  transition: transform var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.insta-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(33, 150, 243, 0.15);
}

.insta-card__image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--color-sky-light);
}

.insta-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.insta-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(33, 150, 243, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity var(--transition);
  color: var(--color-white);
  font-weight: 600;
  padding: 1rem;
  text-align: center;
}

.insta-card:hover .insta-card__overlay {
  opacity: 1;
}

.insta-card__stats {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Video Section */
.video {
  background: var(--color-white);
  min-height: auto;
  position: relative;
  z-index: 10;
}

.video__wrapper {
  aspect-ratio: 16/9;
  background: var(--color-sky-light);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  overflow: hidden;
  position: relative;
}

.video__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video__placeholder {
  text-align: center;
  color: var(--color-text-light);
  padding: 2rem;
}

.video__placeholder svg {
  margin-bottom: 1rem;
  color: var(--color-blue);
}

.video__placeholder p {
  font-size: 0.95rem;
  margin: 0;
}

.video__no-content {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-text-light);
}

.video__no-content p {
  margin-bottom: 1rem;
}

.video__no-content a {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-blue);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all var(--transition);
}

.video__no-content a:hover {
  background: var(--color-blue-dark);
  transform: translateY(-2px);
}

/* About Section */
.about {
  background: var(--color-sky-light);
  position: relative;
  z-index: 10;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about__image {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #90caf9 0%, #64b5f6 100%);
  background-image: url('aboutme.webp');
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px var(--color-shadow);
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about__text p {
  font-size: 1.05rem;
  color: var(--color-text-light);
  line-height: 1.8;
}

/* Contact Form */
.contact {
  background: var(--color-white);
  position: relative;
  z-index: 10;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form__group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}

.form__group input,
.form__group textarea {
  padding: 1rem 1.25rem;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form__group input:focus,
.form__group textarea:focus {
  outline: none;
  border-color: var(--color-blue);
}

.form__group textarea {
  resize: vertical;
  min-height: 150px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 3rem 0;
  background: var(--color-sky-light);
}

.footer__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__content p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer__links {
  display: flex;
  gap: 2rem;
}

.footer__links a {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--color-blue);
}

/* Responsive */
@media (max-width: 968px) {
  .nav__links {
    gap: 1.5rem;
  }
  
  .city-foreground svg {
    transform: scaleX(1.2);
    transform-origin: bottom center;
  }
  
  .logo-text {
    font-size: clamp(2rem, 6vw, 2.5rem);
  }
  
  .about__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .instagram-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .section {
    padding: clamp(3rem, 8vh, 6rem) 0;
  }
  
  .bird {
    width: clamp(60px, 10vw, 70px);
  }
  
  .cloud {
    width: clamp(200px, 35vw, 300px);
  }
}

@media (max-width: 640px) {
  .nav__container {
    padding: 1rem 1.5rem;
  }
  
  .nav__links {
    gap: 1rem;
  }
  
  .nav__links a {
    font-size: 0.85rem;
  }
  
  .container {
    padding: 0 clamp(1rem, 4vw, 1.5rem);
  }
  
  .city-foreground svg {
    transform: scaleX(1.5);
    transform-origin: bottom center;
  }
  
  .section__title {
    font-size: clamp(1.75rem, 8vw, 2rem);
  }
  
  .btn {
    width: 100%;
    text-align: center;
    padding: clamp(0.875rem, 3vw, 1rem) clamp(1.5rem, 5vw, 2.5rem);
  }
  
  .instagram-grid {
    grid-template-columns: 1fr;
    gap: clamp(0.75rem, 2vw, 1rem);
  }
  
  .cloud {
    width: clamp(150px, 30vw, 200px);
  }
  
  .bird {
    width: clamp(50px, 8vw, 60px);
  }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 375px) {
  .hero__center {
    gap: 1.5rem;
  }
  
  .logo-text {
    font-size: clamp(1.75rem, 10vw, 2rem);
  }
}

/* Ajustes para pantallas muy grandes */
@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }
  
  .hero__portrait {
    max-width: 450px;
    height: 550px;
  }
  
  .city-foreground {
    height: 450px;
  }
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 350px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border: 1px solid var(--color-border);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.5s ease;
}

.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.cookie-content p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--color-text);
  line-height: 1.5;
}

.cookie-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  width: auto; /* Override full width on mobile if needed */
}

@media (max-width: 480px) {
  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
  
  .cookie-buttons {
    width: 100%;
  }
  
  .cookie-buttons .btn {
    flex: 1;
  }
}
