@import url("https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap");

/* ==============================================
           ROOT VARIABLES
           ============================================== */
@font-face {
  font-family: "Futura ND Medium";
  src: url(../assets/fonts/Futura-Medium.otf);
}

@font-face {
  font-family: "futura-bold";
  src: url(../assets/fonts/Futura-Bold.otf);
}

@font-face {
  font-family: "futura-Book";
  src: url(../assets/fonts/Futura-Book.otf);
}

:root {
  --primary-red: #e42f2c;
  --primary-blue: #1a2b4a;
  --secondary-blue: #2c3e5f;
  --accent-blue: #3a5a8f;
  --dark-navy: #0d1829;
  --light-gray: #f5f7fa;
  --medium-gray: #e8edf4;
  --white: #ffffff;
  --text-dark: #1a1a1a;
  --text-gray: #4a4a4a;

  --font-menu: "Futura ND Medium", sans-serif;
  --font-title: "futura-bold", sans-serif;
  --font-content: "Futura-Book", sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* ==============================================
           HERO SECTION
           ============================================== */
.hero {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* Imagen fondo */
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
}

/* Texto del hero alineado a la izquierda */
.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  text-align: left;
  padding-left: 8%;
  max-width: 600px;
}

/* Título */
.hero-contacto-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 800;
  margin-top: 150px;
  margin-right: 50px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 5px;
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: 700;
}

/* ==============================================
           BREADCRUMB
           ============================================== */
.breadcrumb-section {
  background: var(--white);
  padding: 15px 0;
  border-bottom: 1px solid rgba(228, 47, 44, 0.1);
}

.breadcrumb {
  margin: 0;
  background: transparent;
  padding: 0;
}

.breadcrumb-item a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
}

.breadcrumb-item a:hover {
  color: var(--primary-red);
  transform: translateX(5px);
}

.breadcrumb-item.active {
  color: var(--text-gray);
}

/* ==============================================
           MAIN STORY SECTION
           ============================================== */
.story-section {
  padding: 80px 0 60px;
  background: linear-gradient(
    to bottom,
    var(--white) 0%,
    var(--light-gray) 100%
  );
  position: relative;
  overflow: hidden;
}

.story-section::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(228, 47, 44, 0.05) 0%,
    transparent 70%
  );
  top: -200px;
  right: -200px;
  animation: pulse 8s ease-in-out infinite;
}

.story-section::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(26, 43, 74, 0.05) 0%,
    transparent 70%
  );
  bottom: -100px;
  left: -100px;
  animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.story-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 60px;
  position: relative;
  z-index: 1;
}

.story-title {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 300px;
  line-height: 1.1;
  margin: 0;
  color: var(--text-dark);
  margin-top: 100px;
  animation: fadeInLeft 1s ease-out;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes expandWidth {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.story-content {
  position: relative;
  background: var(--white);
  padding: 50px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  animation: fadeInRight 1s ease-out 0.3s backwards;
  transition: all 0.5s ease;
}

.story-content h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 1000;
  color: var(--text-dark);
  margin-bottom: 30px;
  line-height: 1.2;
  position: relative;
  padding-bottom: 20px;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.story-content:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 80px rgba(228, 47, 44, 0.15);
}

@keyframes expandHeight {
  to {
    height: 100%;
  }
}

.story-text {
  font-family: var(--font-content);
  font-size: 17px;
  line-height: 2;
  color: var(--text-gray);
  text-align: justify;
  margin: 0;
}
/* ==============================================
           LEGACY SECTIONS - SEAMLESS FLOW
           ============================================== */
.legacy-section {
  padding: 60px 0;
  position: relative;
  overflow: hidden;
  background: var(--light-gray);
  transition: background 0.5s ease;
}

.legacy-section:nth-child(odd) {
  background: var(--white);
}

/* Animated background shapes */
.legacy-section::before,
.legacy-section::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.03;
  animation: float 15s ease-in-out infinite;
}

.legacy-section::before {
  width: 500px;
  height: 500px;
  background: var(--primary-red);
  top: -150px;
  right: -150px;
}

.legacy-section::after {
  width: 350px;
  height: 350px;
  background: var(--primary-blue);
  bottom: -100px;
  left: -100px;
  animation-delay: 2s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

.legacy-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Reverse layout for even sections */
.legacy-section:nth-child(even) .legacy-container {
  direction: rtl;
}

.legacy-section:nth-child(even) .legacy-text {
  direction: ltr;
}

/* Override for familia section - text on left, image on right */
.familia-section .legacy-container {
  direction: rtl !important;
}

.legacy-text {
  position: relative;
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
}

.legacy-text.visible {
  animation: slideIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.legacy-text h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 1000;
  color: var(--text-dark);
  margin-bottom: 30px;
  line-height: 1.2;
  position: relative;
  padding-bottom: 20px;
}

@keyframes expandLine {
  to {
    width: 100%;
  }
}

.legacy-text p {
  font-family: var(--font-content);
  font-size: 17px;
  line-height: 2;
  color: var(--text-gray);
  margin-bottom: 20px;
  text-align: justify;
}

.legacy-text strong {
  font-weight: 700;
  color: var(--primary-blue);
}

/* Image containers with stunning effects */
.legacy-image,
.legal-image {
  width: 100%;
  height: 500px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  opacity: 0;
  animation: fadeInScale 1s ease-out 0.3s forwards;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.legacy-image::before,
.legal-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.legacy-image::after,
.legal-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  z-index: 1;
}

.legacy-image img,
.legal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.legacy-image:hover img,
.legal-image:hover img {
  transform: scale(1.15) rotate(2deg);
}

.legacy-image:hover,
.legal-image:hover {
  box-shadow: 0 30px 80px rgba(228, 47, 44, 0.3);
  transform: translateY(-15px);
}

/* ==============================================
           FINAL SECTION - CLEAN VIDEO
           ============================================== */
.final-section {
  position: relative;
  width: 100%;
  height: 70vh; /* puedes ajustar */
  overflow: hidden;
}

.final-bg {
  position: absolute;
  inset: 0;
  filter: brightness(0.9);
  z-index: 1;
}

.final-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* clave para que se vea como fondo */
}

.final-content {
  position: relative;
  z-index: 2;
  display: flex;
  /* justify-content: center;
  align-items: center; */
  justify-content: left;
  align-items: baseline;
  padding: 3%;
  height: 100%;
}

.final-logo {
  max-width: 220px;
  filter: drop-shadow(0 15px 50px rgba(0, 0, 0, 0.7));
  /* animation: floatGlow 6s ease-in-out infinite; */
}

/* @keyframes floatGlow {
  0%, 100% {
    transform: translateY(0);
    filter: drop-shadow(0 15px 50px rgba(0, 0, 0, 0.7));
  }
  50% {
    transform: translateY(-25px);
    filter: drop-shadow(0 25px 70px rgba(228, 47, 44, 0.5));
  }
} */

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

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

/* ==============================================
           RESPONSIVE DESIGN
           ============================================== */
@media (max-width: 1200px) {
  .story-grid,
  .legacy-container {
    gap: 60px;
    padding: 0 40px;
  }

  .story-title {
    font-size: 2.5rem;
  }

  .legacy-text h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 992px) {
  .hero {
    height: 240px;
  }

  .hero-contacto-title {
    font-size: 3rem;
  }

  .story-grid,
  .legacy-container {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .story-title {
    font-size: 2.2rem;
  }

  .story-content {
    padding: 40px;
  }

  .legacy-text h2 {
    font-size: 1.6rem;
  }

  .legacy-section {
    padding: 50px 0;
  }

  .legacy-section:nth-child(even) .legacy-container {
    direction: ltr;
  }

  .legacy-image,
  .legal-image {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .hero {
    height: 240px;
  }

  .hero-content {
    padding-left: 5%;
    padding-right: 5%;
  }

  .hero-contacto-title {
    font-size: 2.5rem;
  }

  .story-section {
    padding: 60px 0 40px;
  }

  .story-grid,
  .legacy-container {
    padding: 0 30px;
    gap: 40px;
  }

  .story-title {
    font-size: 1.9rem;
  }

  .story-title::after {
    width: 100%;
    height: 4px;
    margin-top: 20px;
  }

  .story-content {
    padding: 30px;
    border-radius: 15px;
  }

  .story-text,
  .legacy-text p {
    font-size: 16px;
    line-height: 1.9;
  }

  .legacy-text h2 {
    font-size: 1.6rem;
  }

  .legacy-section {
    padding: 40px 0;
  }

  .legacy-image,
  .legal-image {
    height: 320px;
    border-radius: 15px;
  }

  .final-content {
    position: relative;
    z-index: 2;
    display: flex;
    /* justify-content: center;
  align-items: center; */
    justify-content: left;
    align-items: baseline;
    padding: 3%;
    height: 100%;
  }

  .final-logo {
    max-width: 240px;
  }
}

@media (max-width: 576px) {
  .hero {
    height: 240px;
  }

  .hero-contacto-title {
    font-size: 2rem;
  }

  .story-title {
    font-size: 1.7rem;
  }

  .story-content {
    padding: 25px;
  }

  .story-content::before {
    width: 4px;
  }

  .legacy-text h2 {
    font-size: 1.6rem;
  }

  .legacy-text h2::after {
    width: 100%;
    height: 3px;
  }

  .story-text,
  .legacy-text p {
    font-size: 15px;
    line-height: 1.8;
  }

  .legacy-image,
  .legal-image {
    height: 280px;
    border-radius: 12px;
  }

  .final-section {
    min-height: 500px;
  }

  .final-content {
    padding: 60px 20px;
  }

  .final-logo {
    max-width: 180px;
  }
}

/* ==============================================
           ACCESSIBILITY & PERFORMANCE
           ============================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a:focus,
button:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
}

@media print {
  .hero,
  .final-section,
  .breadcrumb-section {
    display: none;
  }

  .story-section,
  .legacy-section {
    page-break-inside: avoid;
  }
}
