/* === VARIABLES CSS === */
:root {
  --primary-color: #111;
  --secondary-color: #333;
  --background-light: #f9f9f9;
  --text-light: #fff;
  --text-dark: #111;
  --text-gray: #333;
  --shadow-light: 0 2px 6px rgba(0, 0, 0, 0.06);
  --transition: all 0.3s ease;
}

/* === RESET & BASE STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: #fff;
  color: var(--text-dark);
  overflow-x: hidden;
  line-height: 1.6;
}

/* === FADE-IN ON SCROLL === */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
}

.fade-in-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delays escalonados para elementos generales */
.delay-1.visible { transition-delay: 0.1s; }
.delay-2.visible { transition-delay: 0.2s; }
.delay-3.visible { transition-delay: 0.3s; }
.delay-4.visible { transition-delay: 0.4s; }
.delay-5.visible { transition-delay: 0.5s; }
.delay-6.visible { transition-delay: 0.6s; }

/* Delays específicos para skills-grid */
@media (min-width: 769px) {
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(1) { transition-delay: 0.1s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(2) { transition-delay: 0.2s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(3) { transition-delay: 0.3s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(4) { transition-delay: 0.4s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(5) { transition-delay: 0.5s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(6) { transition-delay: 0.6s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(7) { transition-delay: 0.7s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(8) { transition-delay: 0.8s; }
}

@media (max-width: 768px) {
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(1) { transition-delay: 0.1s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(2) { transition-delay: 0.2s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(3) { transition-delay: 0.3s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(4) { transition-delay: 0.4s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(5) { transition-delay: 0.5s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(6) { transition-delay: 0.6s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(7) { transition-delay: 0.7s; }
  .skills-grid .skill-item.fade-in-scroll.visible:nth-child(8) { transition-delay: 0.8s; }
}

/* === NAVBAR MOBILE === */
.navbar {
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  z-index: 1000;
  background-color: #ffffff;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-dark);
  transition: var(--transition);
}

.logo:hover {
  color: var(--secondary-color);
}

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.nav-toggle-label span {
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.nav-content {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-buttons {
  display: flex;
  gap: 1rem;
}

.nav-links li a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  position: relative;
  transition: var(--transition);
  padding: 0.5rem 0;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  background-color: var(--primary-color);
  bottom: 0;
  left: 0;
  transition: var(--transition);
}

.nav-links li a:hover,
.nav-links li a:focus {
  color: #555;
  outline: none;
}

.nav-links li a:hover::after,
.nav-links li a:focus::after {
  width: 100%;
}

/* === HERO SECTION WITH VIDEO === */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  margin-top: 80px;
  background: none;
}

.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  min-width: 100%;
  min-height: 100%;
}

.hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
  z-index: 1;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 180px;
  box-sizing: border-box;
}

.hero-content {
  text-align: center;
  color: var(--text-light);
  padding: 0 2rem;
  max-width: 800px;
  box-sizing: border-box;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero-lead {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  font-weight: 300;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-video {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
}

/* === SECTIONS GENERAL - 90% VIEWPORT === */
.about, .experience, .results, .contact {
  min-height: 90vh; /* CAMBIO: 600px → 90vh */
  padding: 5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  scroll-margin-top: 100px;
}

.about {
  background-color: var(--background-light);
}

.experience {
  background-color: #fff;
}

.results, .contact {
  background-color: #f5f5f5;
}

/* === SKILLS SECTION (90% VIEWPORT) === */
.skills {
  min-height: 90vh;
  padding: 5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  scroll-margin-top: 100px;
  background-color: #fff;
}

.skills .container {
  flex-direction: column;
  text-align: center;
  width: 100%;
  max-width: 1200px;
}

.skills h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--text-dark);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  width: 100%;
  box-sizing: border-box;
}

.skill-item {
  background-color: #f5f5f5;
  padding: 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text-gray);
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  text-align: center;
  box-sizing: border-box;
  opacity: 0.9;
}

.skill-item:hover {
  transform: translateY(-3px);
  background-color: #e9e9e9;
  opacity: 1;
}

/* === ABOUT SECTION OPTIMIZADA === */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
}

.about-image {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background-color: #f5f5f5;
  min-height: 400px;
}

.about-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
  position: relative;
  z-index: 2;
}

.about-image img:not([src]),
.about-image img[src=""],
.about-image img[src*="undefined"] {
  min-height: 400px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

.about-image:hover img {
  transform: scale(1.05);
}

.about-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.about-text p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-gray);
}

/* === EXPERIENCE SECTION === */
.experience .container {
  flex-direction: column;
  text-align: center;
}

.experience h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--text-dark);
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}

.experience-item {
  background-color: #f5f5f5;
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  box-sizing: border-box;
}

.experience-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.experience-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
  background-color: #e9e9e9;
}

.experience-item:nth-child(3) .experience-img {
  object-position: center 45%;
}

.experience-item:hover .experience-img {
  transform: scale(1.05);
}

.experience-item h3 {
  font-size: 1.5rem;
  margin: 1.5rem 1.5rem 1rem;
  color: var(--text-dark);
  text-align: left;
}

.experience-item p {
  font-size: 1rem;
  color: var(--text-gray);
  margin: 0 1.5rem 1.5rem;
  line-height: 1.4;
  text-align: left;
}

/* === RESULTS SECTION === */
.results .container {
  flex-direction: column;
  text-align: center;
}

.results h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--text-dark);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1000px;
  width: 100%;
  box-sizing: border-box;
}

.result-item {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  box-sizing: border-box;
}

.result-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.result-item h3 {
  font-size: 1.25rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.result-item p {
  font-size: 1rem;
  color: #444;
  line-height: 1.5;
}

/* === VIEW MORE RESULTS BUTTON === */
.results-more {
  text-align: center;
  margin-top: 50px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.view-more-btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition);
  font-family: 'Outfit', sans-serif;
}

.view-more-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* === CONTACT SECTION === */
.contact .container {
  flex-direction: column;
  text-align: center;
}

.contact h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.contact p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  color: var(--text-gray);
  max-width: 600px;
  line-height: 1.6;
}

.contact-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-sizing: border-box;
  border: 2px solid transparent;
}

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

.btn.primary:hover,
.btn.primary:focus {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.btn.secondary {
  background-color: #fff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn.secondary:hover,
.btn.secondary:focus {
  background-color: #f0f0f0;
  transform: translateY(-2px);
}

.contact-socials {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-socials a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

.contact-socials a:hover,
.contact-socials a:focus {
  color: var(--secondary-color);
  background-color: rgba(0,0,0,0.05);
}

/* === FOOTER === */
footer {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 2rem;
  text-align: center;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 968px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === MOBILE STYLES (768px y menos) === */
@media (max-width: 768px) {
  .navbar {
    padding: 0.8rem 1rem;
  }
  
  .nav-toggle-label {
    display: flex;
  }
  
  .nav-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 2rem 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .nav-toggle:checked ~ .nav-content {
    display: flex;
  }
  
  .nav-links {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    width: 100%;
  }
  
  .nav-links li {
    width: 100%;
  }
  
  .nav-links li a {
    display: block;
    padding: 0.75rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
  }
  
  .nav-links li a:hover {
    background-color: #f5f5f5;
  }
  
  .nav-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }
  
  .nav-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  .hero {
    height: 100vh;
    min-height: 500px;
    margin-top: 70px;
  }
  
  .hero-overlay {
    padding-top: 150px;
  }
  
  .hero-content {
    padding: 0 1rem;
    margin-top: -20px;
  }
  
  /* Sections Mobile - 90% viewport también */
  .about, .experience, .results, .contact {
    padding: 3rem 1rem;
    min-height: 90vh; /* MANTENER 90vh EN MÓVIL */
    scroll-margin-top: 80px;
  }
  
  .skills {
    min-height: 90vh; /* MANTENER 90vh EN MÓVIL */
    padding: 3rem 1rem;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .about-image {
    min-height: 300px;
    order: 2;
  }
  
  .about-text {
    order: 1;
  }
  
  .experience-grid {
    grid-template-columns: 1fr;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .contact-socials {
    flex-direction: column;
    gap: 1rem;
  }
  
  .experience-item:nth-child(3) .experience-img {
    object-position: center 45%;
  }
  
  .results-more {
    margin-top: 40px;
    padding-top: 12px;
  }
  
  .view-more-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* === MOBILE PEQUEÑO (480px y menos) === */
@media (max-width: 480px) {
  .navbar {
    padding: 0.6rem 1rem;
  }
  
  .hero {
    height: 100vh;
    min-height: 400px;
    margin-top: 60px;
  }
  
  .hero-overlay {
    padding-top: 40px;
  }
  
  .hero-content {
    margin-top: -20px;
  }
  
  .about, .experience, .results, .skills, .contact {
    padding: 2rem 0.5rem;
    min-height: 90vh; /* MANTENER 90vh EN MÓVIL PEQUEÑO */
  }
  
  .about-image {
    min-height: 250px;
  }
  
  .btn {
    padding: 1rem 1.5rem;
    width: 100%;
    justify-content: center;
  }
  
  .nav-content {
    padding: 1.5rem 0.5rem;
  }
}

/* === ANIMACIÓN HAMBURGUER ICON === */
.nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.fade-in-scroll {
  will-change: transform, opacity;
}

.experience-item, .result-item, .skill-item {
  will-change: transform;
}

/* === VIDEO PLACEHOLDER === */
.hero-video-container:has(.hero-video[src=""]) {
  background: linear-gradient(45deg, #1a2a6c, #b21f1f, #fdbb2d);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

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

/* === FALLBACKS PARA IMÁGENES QUE NO CARGAN === */
.about-image::before {
  content: "Fede García - Sailing Coach";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #666;
  font-size: 1rem;
  text-align: center;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.about-image:has(img:not([src]))::before,
.about-image:has(img[src=""])::before {
  opacity: 1;
}