/* 
  Ignacio Bravo - Design System
  Theme: Daikin Blue & Black Premium
  Status: Technical Hardened 4.0
*/

:root {
  /* Colors */
  --primary: #00A0E4; /* Daikin Blue */
  --primary-glow: rgba(0, 160, 228, 0.15);
  --bg-dark: #020617; /* Deep Slate (Pro Dark) */
  --bg-card: rgba(30, 41, 59, 0.5); /* Semi-transparent Slate */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(15, 23, 42, 0.92);
  
  /* Fonts — Nota: sin signo +, ese es solo para URLs de Google Fonts */
  --font-main: 'Inter', sans-serif;
  --font-accent: 'Space Grotesk', sans-serif; /* Fix: era 'Space+Grotesk' */

  /* Spacing */
  --section-padding: 160px;
  --container-max: 1300px;
  
  /* Effects */
  --radius-pro: 24px;
  --shadow-pro: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  --transition-pro: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Bloquear scroll cuando el menú móvil está abierto */
body.menu-open {
  overflow: hidden;
}

/* Accessiblity: Focus States */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.98) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-reveal {
  opacity: 0;
}
.animate-reveal.visible {
  animation: fadeInScale 1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-left.visible, .reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- HEADER & NAVIGATION --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  padding: 0 5%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

header::after {
  content: '';
}

header.scroll-down {
  transform: translateY(-100%);
  opacity: 0;
}

header.scroll-up {
  transform: translateY(0);
  background: var(--glass-bg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.logo {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  color: #fff;
  text-decoration: none;
}

.logo span {
  color: var(--primary);
}

.social-icon {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  color: #fff;
  transition: var(--transition-pro);
}

.social-icon:hover svg {
  opacity: 1 !important;
  color: var(--primary);
  transform: scale(1.2);
}

nav {
  justify-self: center;
}

nav ul {
  display: flex;
  list-style: none;
  gap: clamp(15px, 2vw, 40px);
  padding: 0;
  margin: 0;
}

nav a {
  text-decoration: none;
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff !important;
  transition: var(--transition-pro);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
}

nav ul li:first-child a {
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  color: var(--primary) !important;
}

nav a:hover,
nav a.active {
  color: var(--primary) !important;
  transform: scale(1.05);
}

nav a:visited {
  color: #fff !important; 
}

a:visited {
  color: inherit;
}

.btn-contact {
  background: var(--primary);
  color: #020617;
  padding: 10px 24px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition-pro);
}

.btn-contact:visited {
  color: #020617 !important;
}

.btn-contact:hover {
  background: #fff;
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid #fff;
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-ghost:visited {
  color: #fff !important;
}

.btn-ghost:hover {
  background: #fff;
  color: var(--bg-dark) !important;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 160, 228, 0.2);
}

/* --- BURGER MENU (MOBILE ONLY) --- */
.burger {
  display: none;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 10px;
  z-index: 1100;
}

.burger div {
  width: 25px;
  height: 2px;
  background: #fff;
  margin: 5px;
  transition: 0.3s;
}

/* Animación del botón hamburguesa */
.burger.toggle div:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 5px);
}
.burger.toggle div:nth-child(2) {
  opacity: 0;
}
.burger.toggle div:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -5px);
}

/* Overlay semitransparente detrás del menú móvil */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 80px 0 0 0;
  background: rgba(2, 6, 23, 0.7);
  z-index: 900;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.nav-backdrop.active {
  display: block;
  opacity: 1;
}

@media (max-width: 1100px) {
  nav {
    position: fixed;
    top: 80px;
    right: -85vw;
    width: 80vw;
    height: calc(100vh - 80px);
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-pro);
    box-shadow: -20px 0 50px rgba(0,0,0,0.6);
    border-left: 1px solid var(--border);
    z-index: 1000;
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    gap: 32px;
    text-align: center;
  }

  /* "Ignacio Bravo" más grande en móvil — es la marca, debe destacar */
  nav ul li:first-child a {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  nav a {
    font-size: 1.15rem;
  }

  .burger {
    display: block;
  }

  .btn-contact {
    display: none;
  }

  header {
    display: flex;
    justify-content: space-between;
  }

  header::after {
    display: none;
  }
}

/* --- MAIN CONTENT & HERO --- */
main {
  padding-top: 0; 
}

.hero-bg {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 5% 0;
  background-size: cover;
  background-position: center;
}

/* WebP hero: sirve imagen optimizada a navegadores modernos (95%+ soporte) */
.hero-bg.hero-webp {
  background-image: url('../img/0aa981deb171bfcaec31a7d5c0d2cfa0df0abf57.webp');
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.35) 0%, rgba(2, 6, 23, 0.92) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* --- HERO DE PÁGINAS INTERIORES (fix estructura) --- */
.page-hero-section {
  padding: 160px 5% 80px;
  text-align: center;
  max-width: var(--container-max);
  margin: 0 auto;
}

.page-hero-eyebrow {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 20px;
  display: block;
}

.page-hero-title {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-family: var(--font-accent);
  line-height: 1.1;
  color: #fff;
  margin-bottom: 24px;
}

.page-hero-description {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 700px;
  margin: 0 auto;
}

/* --- SECCIÓN DE CONTENIDO ESTÁNDAR --- */
.section-content {
  padding: 80px 5%;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* --- LAYOUT FLEX REUTILIZABLE --- */
.flex-layout {
  display: flex;
  gap: clamp(30px, 5vw, 80px);
  align-items: center;
  flex-wrap: wrap;
}

.flex-layout .flex-main {
  flex: 1.2;
  min-width: 280px;
}

.flex-layout .flex-media {
  flex: 1;
  min-width: 280px;
  text-align: center;
}

/* --- BENTO GRID SYSTEM --- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-pro);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(0, 160, 228, 0.4);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 160, 228, 0.1);
}

/* Photo Frames */
.integrated-frame {
  position: relative;
  display: inline-block;
}

.img-pro {
  border-radius: var(--radius-pro);
  box-shadow: var(--shadow-pro);
  transition: var(--transition-pro);
  max-width: 100%;
  height: auto;
}

/* Timeline System */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 60px auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background: var(--primary);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}

.timeline-item {
  padding: 20px 40px;
  position: relative;
  width: 50%;
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .card {
    grid-column: span 1 !important;
  }
  .timeline::after {
    left: 20px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 50px;
  }
  .page-hero-section {
    padding: 140px 5% 60px;
  }
}

/* --- TEXT LINKS --- */
.link-text {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: var(--transition-pro);
}

.link-text:hover {
  color: #fff;
  text-decoration-color: #fff;
}

/* --- UTILITIES & EXTRACTION --- */
.section-proposito {
  padding: 120px 5%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.section-proposito .flex-layout {
  gap: clamp(30px, 5vw, 80px); /* responsive en móvil */
}

.hero-subtitle-top {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 5px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-main-title {
  font-size: clamp(3.5rem, 10vw, 6.5rem);
  font-family: var(--font-accent);
  line-height: 0.9;
  margin-bottom: 40px;
  color: #fff;
}

.hero-glow-text {
  text-shadow: 0 0 40px var(--primary-glow);
  color: var(--primary);
}

.hero-description {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.8);
  max-width: 800px;
  margin: 0 auto 50px;
}

/* --- FOOTER WOW --- */
.site-footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 160, 228, 0.03) 100%);
  padding: 0;
  overflow: hidden;
}

/* Bloque del Libro */
.footer-book {
  display: flex;
  align-items: center;
  gap: clamp(30px, 5vw, 80px);
  padding: clamp(60px, 8vw, 100px) 5%;
  max-width: var(--container-max);
  margin: 0 auto;
  flex-wrap: wrap;
}

.footer-book-cover {
  flex-shrink: 0;
  position: relative;
}

.footer-book-cover img {
  width: clamp(100px, 15vw, 160px);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 160, 228, 0.15);
  transition: var(--transition-pro);
  transform: rotate(-2deg);
}

.footer-book-cover img:hover {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 50px rgba(0, 160, 228, 0.25);
}

.footer-book-info {
  flex: 1;
  min-width: 220px;
}

.footer-book-eyebrow {
  display: inline-block;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.footer-book-title {
  font-family: var(--font-accent);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
  color: #fff;
  margin-bottom: 12px;
}

.footer-book-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 500px;
}

.footer-book-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: #020617 !important;
  padding: 14px 32px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  transition: var(--transition-pro);
}

.footer-book-cta:hover {
  background: #fff;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 30px rgba(0, 160, 228, 0.3);
}

.footer-book-cta:visited { color: #020617 !important; }

/* Separador */
.footer-divider {
  height: 1px;
  background: var(--border);
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Parte inferior del footer */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 40px 5%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  gap: clamp(16px, 2.5vw, 32px);
  flex-wrap: wrap;
}

.footer-nav a {
  text-decoration: none;
  font-family: var(--font-accent);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #fff !important;
}

.footer-social-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.footer-copyright {
  opacity: 0.4;
  font-size: 0.8rem;
  text-align: center;
  width: 100%;
  padding-bottom: 24px;
  padding-left: 5%;
  padding-right: 5%;
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-nav {
    justify-content: center;
  }
  .footer-book {
    flex-direction: column;
    text-align: center;
  }
  .footer-book-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Card label badge */
.card-eyebrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  display: block;
}
