/* ============================================
   MADRE CORAJE — DESIGN SYSTEM v2.0
   TECNOLOGÍAS DE PUNTA 2026
   CSS Layers · Nesting · Container Queries
   Scroll-Driven Animations · View Transitions
   ============================================ */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600&family=Inter:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,600;1,400;1,600&display=swap');

/* === CSS LAYERS (cascada moderna) === */
@layer reset, tokens, base, layout, components, animations, utilities, dark;

/* ======================== RESET ======================== */
@layer reset {

  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--blanco, #FAF7F2);
    overflow-x: hidden;
  }

  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  ul,
  ol {
    list-style: none;
  }

  button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
  }
}

/* ======================== TOKENS ======================== */
@layer tokens {
  :root {
    /* Paleta Primaria — Rojo Bandera */
    --rojo: #CE1126;
    --rojo-hover: #E01530;
    --rojo-sutil: #D94050;
    --rojo-bg: rgba(206, 17, 38, 0.08);
    --rojo-glow: rgba(206, 17, 38, 0.25);

    /* Negro (reemplaza azul) */
    --azul: #1A1A1A;
    --azul-medio: #333333;
    --azul-deep: #111111;

    /* Neutros */
    --blanco: #FAF7F2;
    --blanco-puro: #FFFFFF;
    --beige: #F0E6D3;
    --beige-light: #F5EDE0;

    /* Amarillo Oro */
    --gold: #D4AF37;
    --gold-light: #E5C54B;
    --gold-dark: #B8960E;
    --gold-glow: rgba(212, 175, 55, 0.25);

    /* Grises */
    --carbon: #2D2D2D;
    --texto: #4A4A4A;
    --gris: #7A7A7A;
    --claro: #E0D8CC;
    --borde: #D5CEC3;

    /* Typography */
    --f-display: 'Playfair Display', Georgia, serif;
    --f-body: 'Inter', system-ui, sans-serif;
    --f-quote: 'Lora', Georgia, serif;

    /* Fluid Typography (clamp) */
    --fs-hero: clamp(3rem, 7vw, 5.5rem);
    --fs-h1: clamp(2.2rem, 4.5vw, 3.8rem);
    --fs-h2: clamp(1.8rem, 3.5vw, 3rem);
    --fs-h3: clamp(1.3rem, 2.5vw, 1.9rem);
    --fs-h4: clamp(1.1rem, 2vw, 1.4rem);
    --fs-body: clamp(0.95rem, 1.2vw, 1.1rem);
    --fs-sm: 0.875rem;
    --fs-xs: 0.8rem;

    /* Spacing */
    --s-xs: 0.5rem;
    --s-sm: 1rem;
    --s-md: 1.5rem;
    --s-lg: 2.5rem;
    --s-xl: 4rem;
    --s-2xl: 6rem;
    --s-3xl: 8rem;

    /* Layout */
    --max-w: 1200px;
    --max-narrow: 800px;
    --pad: clamp(1rem, 4vw, 2rem);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 50%;

    /* Shadows */
    --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --sh-md: 0 4px 24px rgba(0, 0, 0, 0.12);
    --sh-lg: 0 12px 48px rgba(0, 0, 0, 0.18);
    --sh-glow: 0 0 40px var(--rojo-glow);
    --sh-gold: 0 0 40px var(--gold-glow);

    /* Transitions */
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 180ms;
    --t-base: 300ms;
    --t-slow: 500ms;

    /* Z-index */
    --z-bg: -1;
    --z-base: 1;
    --z-sticky: 100;
    --z-nav: 1000;
    --z-modal: 2000;
    --z-toast: 3000;

    /* View Transition */
    view-transition-name: root;
  }
}

/* ======================== BASE ======================== */
@layer base {
  body {
    font-family: var(--f-body);
    font-size: var(--fs-body);
    color: var(--carbon);
    background: var(--blanco);
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: background var(--t-slow) var(--ease),
                color var(--t-slow) var(--ease),
                opacity 0.3s ease;
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--f-display);
    color: var(--azul);
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-wrap: balance;
  }

  h1 {
    font-size: var(--fs-h1);
    font-weight: 700;
    margin-bottom: var(--s-md);
  }

  h2 {
    font-size: var(--fs-h2);
    font-weight: 700;
    margin-bottom: var(--s-md);
  }

  h3 {
    font-size: var(--fs-h3);
    font-weight: 600;
    margin-bottom: var(--s-sm);
  }

  h4 {
    font-size: var(--fs-h4);
    font-weight: 600;
  }

  p {
    color: var(--texto);
    margin-bottom: var(--s-sm);
    max-width: 68ch;
  }

  blockquote,
  .cita {
    font-family: var(--f-quote);
    font-style: italic;
    font-size: var(--fs-h4);
    color: var(--rojo);
    border-left: 3px solid var(--gold);
    padding-left: var(--s-md);
    margin: var(--s-lg) 0;
    max-width: 56ch;
  }

  ::selection {
    background: var(--rojo);
    color: #fff;
  }

  :focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
  }

  /* Smooth image loading */
  img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s var(--ease);
  }

  img[loading="lazy"].loaded,
  img[loading="lazy"][complete] {
    opacity: 1;
  }
}

/* ======================== LAYOUT ======================== */
@layer layout {
  .container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
  }

  .container--narrow {
    max-width: var(--max-narrow);
    margin: 0 auto;
    padding: 0 var(--pad);
  }

  section {
    padding: var(--s-2xl) 0;
    position: relative;
  }

  .text-center {
    text-align: center;
  }

  .text-center p {
    margin-inline: auto;
  }

  /* CSS Grid helpers */
  .grid {
    display: grid;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-xl);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-lg);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-lg);
  }

  .grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--s-lg);
  }

  @media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 900px) and (min-width: 769px) {

    .grid-3,
    .grid-4 {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}

/* ======================== COMPONENTS ======================== */
@layer components {

  /* --- Section Headers --- */
  .section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--rojo), var(--gold));
    margin: 0 auto var(--s-lg);
    border-radius: 2px;
  }

  .section-label {
    font-family: var(--f-body);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--gold);
    margin-bottom: var(--s-xs);
    display: block;
  }

  /* --- NAVBAR --- */
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-nav);
    background: rgba(250, 247, 242, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(213, 206, 195, 0.5);
    transition: background 0.4s var(--ease),
                box-shadow 0.4s var(--ease),
                border-color 0.4s var(--ease),
                backdrop-filter 0.4s var(--ease);
  }

  .navbar.scrolled {
    background: rgba(250, 247, 242, 0.95);
    box-shadow: var(--sh-md);
    border-bottom-color: rgba(213, 206, 195, 0.8);
  }

  .navbar__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
  }

  .navbar__brand {
    display: flex;
    align-items: center;
    gap: var(--s-sm);
  }

  .navbar__brand img {
    height: 42px;
    width: auto;
  }

  .navbar__brand-text {
    display: flex;
    flex-direction: column;
  }

  .navbar__brand-name {
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rojo);
    line-height: 1.1;
  }

  .navbar__brand-subtitle {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gris);
  }

  .navbar__links {
    display: flex;
    align-items: center;
    gap: var(--s-md);
  }

  .navbar__link {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--texto);
    padding: 0.5rem 0.6rem;
    position: relative;
    border-radius: 8px;
    transition: color var(--t-base) var(--ease),
                background var(--t-base) var(--ease),
                transform 0.25s var(--ease-spring);
  }

  .navbar__link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--rojo), var(--gold));
    border-radius: 2px;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.35s var(--ease-spring);
  }

  .navbar__link:hover {
    color: var(--rojo);
    background: var(--rojo-bg);
    transform: translateY(-1px);
  }

  .navbar__link:hover::after,
  .navbar__link.active::after {
    transform: translateX(-50%) scaleX(0.7);
  }

  .navbar__link.active {
    color: var(--rojo);
    font-weight: 600;
  }

  .navbar__link.active::after {
    transform: translateX(-50%) scaleX(1);
  }

  /* --- DROPDOWN PROPUESTAS --- */
  .navbar__dropdown {
    position: relative;
  }

  .navbar__dropdown-toggle {
    font-family: var(--f-body);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--texto);
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    position: relative;
    letter-spacing: 0.01em;
    transition: color var(--t-base) var(--ease),
                background var(--t-base) var(--ease);
  }

  .navbar__dropdown-toggle::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--rojo-sutil), var(--gold));
    border-radius: 2px;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.35s var(--ease-spring);
  }

  .navbar__dropdown-toggle .dropdown-arrow {
    font-size: 0.6rem;
    transition: transform 0.3s var(--ease-spring);
    display: inline-block;
  }

  .navbar__dropdown:hover .dropdown-arrow,
  .navbar__dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
  }

  .navbar__dropdown:hover .navbar__dropdown-toggle,
  .navbar__dropdown.open .navbar__dropdown-toggle {
    color: var(--azul);
    background: rgba(240, 230, 211, 0.45);
  }

  .navbar__dropdown-toggle.active {
    color: var(--azul);
    font-weight: 600;
  }

  .navbar__dropdown-toggle.active::after {
    transform: translateX(-50%) scaleX(1);
  }

  .navbar__dropdown:hover .navbar__dropdown-toggle::after {
    transform: translateX(-50%) scaleX(0.7);
  }

  .navbar__dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 260px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--blanco-puro);
    border-radius: var(--radius);
    box-shadow: var(--sh-md);
    border: 1px solid var(--borde);
    padding: 0.6rem 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s var(--ease),
                transform 0.3s var(--ease-spring),
                visibility 0.3s;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: var(--rojo-sutil) transparent;
  }

  .navbar__dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 8px;
  }

  .navbar__dropdown:hover .navbar__dropdown-menu,
  .navbar__dropdown.open .navbar__dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .navbar__dropdown-label {
    font-family: var(--f-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--gold-dark);
    padding: 0.5rem 1.2rem 0.25rem;
    display: block;
  }

  .navbar__dropdown-label:not(:first-child) {
    margin-top: 0.3rem;
    border-top: 1px solid var(--claro);
    padding-top: 0.6rem;
  }

  .navbar__dropdown-item {
    display: block;
    padding: 0.4rem 1.2rem 0.4rem 1.6rem;
    font-size: var(--fs-sm);
    font-weight: 400;
    color: var(--texto);
    transition: background 0.2s var(--ease),
                color 0.2s var(--ease),
                padding-left 0.25s var(--ease-spring);
  }

  .navbar__dropdown-item:hover {
    background: rgba(240, 230, 211, 0.6);
    color: var(--azul);
    padding-left: 1.7rem;
  }

  .navbar__dropdown-menu .submenu {
    margin: 0;
    padding: 0;
  }

  .navbar__dropdown-menu .submenu > li {
    display: block;
  }

  .navbar__dropdown-item--section {
    font-family: var(--f-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-dark);
    padding-top: 0.65rem;
    padding-bottom: 0.35rem;
  }

  .navbar__dropdown-menu > .submenu > li:first-child > .navbar__dropdown-item--section {
    padding-top: 0.3rem;
  }

  .navbar__dropdown-menu > .submenu > li + li > .navbar__dropdown-item--section {
    border-top: 1px solid var(--claro);
    margin-top: 0.35rem;
  }

  .navbar__dropdown-menu .submenu .submenu {
    padding-bottom: 0.2rem;
  }

  .navbar__dropdown-menu .submenu .submenu .navbar__dropdown-item {
    padding-left: 2rem;
    font-size: 0.84rem;
  }

  .navbar__dropdown-menu .submenu .submenu .navbar__dropdown-item:hover {
    padding-left: 2.1rem;
  }

  /* Dropdown en móvil */
  @media (max-width: 900px) {
    .navbar__dropdown {
      width: 100%;
      transform: translateX(-20px);
      opacity: 0;
      transition: transform 0.4s var(--ease-spring),
                  opacity 0.3s var(--ease);
    }

    .navbar__links.open .navbar__dropdown {
      transform: translateX(0);
      opacity: 1;
      transition-delay: 0.11s;
    }

    .navbar__dropdown-toggle {
      font-size: 1.05rem;
      font-weight: 500;
      text-transform: none;
      letter-spacing: 0.01em;
      padding: 0.8rem 1rem;
      border-radius: var(--radius);
      width: 100%;
      justify-content: center;
      color: var(--texto);
    }

    .navbar__dropdown-toggle::after {
      display: none;
    }

    .navbar__dropdown-toggle:hover,
    .navbar__dropdown.open .navbar__dropdown-toggle {
      color: var(--rojo);
      background: var(--rojo-bg);
    }

    .navbar__dropdown-menu {
      position: static;
      transform: none;
      min-width: 100%;
      box-shadow: none;
      border: none;
      background: rgba(139, 26, 26, 0.04);
      border-radius: var(--radius);
      max-height: 0;
      overflow: hidden;
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
      padding: 0;
      transition: max-height 0.4s var(--ease-spring),
                  padding 0.3s var(--ease);
    }

    .navbar__dropdown.open .navbar__dropdown-menu {
      max-height: none;
      padding: 0.5rem 0;
      transform: none;
    }

    .navbar__dropdown-item {
      padding-left: 2rem;
    }

    .navbar__dropdown-item:hover {
      padding-left: 2.3rem;
    }

    .navbar__dropdown-item--section {
      padding-left: 1rem;
      font-size: 0.78rem;
    }

    .navbar__dropdown-menu .submenu .submenu .navbar__dropdown-item {
      padding-left: 2.2rem;
      font-size: 0.95rem;
    }

    .navbar__dropdown-menu .submenu .submenu .navbar__dropdown-item:hover {
      padding-left: 2.45rem;
    }
  }

  /* Theme toggle */
  .theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texto);
    font-size: 1.1rem;
    transition: all 0.3s var(--ease-spring);
  }

  .theme-toggle:hover {
    background: var(--rojo-bg);
    color: var(--rojo);
    transform: rotate(20deg) scale(1.1);
  }

  .theme-toggle:active {
    transform: rotate(-10deg) scale(0.95);
  }

  /* Hamburger */
  .navbar__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    padding: 4px 0;
    z-index: 10;
  }

  .navbar__hamburger span {
    display: block;
    height: 2px;
    background: var(--carbon);
    border-radius: 2px;
    transition: transform 0.4s var(--ease-spring),
                opacity 0.25s var(--ease),
                background 0.3s var(--ease);
  }

  .navbar__hamburger:hover span {
    background: var(--rojo);
  }

  .navbar__hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar__hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .navbar__hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  @media (max-width: 900px) {
    .navbar__hamburger {
      display: flex;
    }

    .navbar__links {
      position: fixed;
      top: 72px;
      left: 0;
      right: 0;
      max-height: calc(100vh - 72px);
      max-height: calc(100dvh - 72px);
      background: rgba(250, 247, 242, 0.98);
      backdrop-filter: blur(24px);
      flex-direction: column;
      align-items: center;
      padding: var(--s-lg) var(--pad);
      padding-bottom: var(--s-2xl);
      gap: var(--s-sm);
      transform: translateY(-120%);
      opacity: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      transition: transform 0.5s var(--ease-spring),
                  opacity 0.35s var(--ease);
      box-shadow: var(--sh-lg);
      border-bottom: 2px solid var(--gold);
    }

    .navbar__links.open {
      transform: translateY(0);
      opacity: 1;
    }

    .navbar__links .navbar__link {
      font-size: 1.05rem;
      padding: 0.8rem 1rem;
      border-radius: var(--radius);
      text-align: center;
      transform: translateX(-20px);
      opacity: 0;
      transition: transform 0.4s var(--ease-spring),
                  opacity 0.3s var(--ease),
                  color var(--t-base) var(--ease),
                  background var(--t-base) var(--ease);
    }

    .navbar__links.open .navbar__link {
      transform: translateX(0);
      opacity: 1;
    }

    .navbar__links.open .navbar__link:nth-child(1) { transition-delay: 0.05s; }
    .navbar__links.open .navbar__link:nth-child(2) { transition-delay: 0.08s; }
    .navbar__links.open .navbar__link:nth-child(3) { transition-delay: 0.11s; }
    .navbar__links.open .navbar__link:nth-child(4) { transition-delay: 0.14s; }
    .navbar__links.open .navbar__link:nth-child(5) { transition-delay: 0.17s; }
    .navbar__links.open .navbar__link:nth-child(6) { transition-delay: 0.20s; }
    .navbar__links.open .navbar__link:nth-child(7) { transition-delay: 0.23s; }
    .navbar__links.open .navbar__link:nth-child(8) { transition-delay: 0.26s; }
    .navbar__links.open .navbar__link:nth-child(9) { transition-delay: 0.29s; }
  }

  /* --- HERO --- */
  .hero {
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: #f5ede0;
  }

  #hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  .hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: none;
  }

  .hero__content {
    position: relative;
    z-index: 10;
    max-width: var(--max-w);
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 80px var(--pad) 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--s-md);
    align-items: center;
    box-sizing: border-box;
  }

  .hero__text {
    color: #2D2D2D;
  }

  .hero__label {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #CE1126;
    margin-bottom: var(--s-sm);
    padding: 0.4rem 1.2rem;
    border: 1px solid rgba(206, 17, 38, 0.3);
    border-radius: 30px;
    background: rgba(206, 17, 38, 0.08);
  }

  .hero__title {
    font-family: var(--f-display);
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    font-weight: 800;
    color: #1A1A1A;
    line-height: 1.02;
    margin-bottom: var(--s-sm);
    text-wrap: balance;
  }

  .hero__title em {
    font-style: italic;
    color: #CE1126;
    display: block;
  }

  .hero__subtitle {
    font-family: var(--f-quote);
    font-size: var(--fs-h4);
    font-style: italic;
    color: #4A4A4A;
    margin-bottom: var(--s-sm);
    max-width: 48ch;
    line-height: 1.4;
  }

  .hero__typing-line {
    color: #6B6B6B;
    font-size: 1rem;
    margin-bottom: var(--s-sm);
    min-height: 1.5em;
  }

  .hero__typing-line .cursor {
    animation: blink 1s infinite;
    color: #CE1126;
  }

  @keyframes blink {

    0%,
    50% {
      opacity: 1
    }

    51%,
    100% {
      opacity: 0
    }
  }

  .hero__ctas {
    display: flex;
    gap: var(--s-sm);
    flex-wrap: wrap;
  }

  .hero__portrait {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }

  .hero__portrait-img {
    width: auto;
    height: calc(100vh - 140px);
    height: calc(100dvh - 140px);
    max-height: 333px;
    border-radius: var(--radius-xl);
    object-fit: contain;
    border: 3px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px var(--gold-glow);
    animation: floatImg 4s ease-in-out infinite;
  }

  @keyframes floatImg {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
  }

  .portrait-placeholder {
    font-family: var(--f-display);
    font-size: 6rem;
    color: rgba(196, 162, 101, 0.3);
  }

  /* Retrato About — imagen real */
  .about-portrait {
    max-width: 380px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--sh-lg);
    position: relative;
  }

  .about-portrait__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: var(--radius-lg);
    transition: transform var(--t-base) var(--ease);
  }

  .about-portrait:hover .about-portrait__img {
    transform: scale(1.03);
  }

  /* Placeholder de retrato grande (legacy) */
  .portrait-placeholder-lg {
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-lg);
    box-shadow: var(--sh-lg);
    background: linear-gradient(145deg, var(--azul) 0%, var(--azul-deep) 60%, var(--rojo) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-sm);
    color: var(--gold-light);
    position: relative;
    overflow: hidden;
  }

  .portrait-placeholder-lg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(196, 162, 101, 0.15) 0%, transparent 70%);
  }

  .portrait-placeholder-lg span {
    font-family: var(--f-display);
    font-size: 5rem;
    font-weight: 700;
    opacity: 0.4;
    letter-spacing: 0.1em;
  }

  /* Placeholder genérico para imágenes faltantes */
  .img-placeholder {
    background: linear-gradient(135deg, var(--azul) 0%, var(--azul-medio) 50%, var(--rojo) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(250, 247, 242, 0.5);
    text-align: center;
    padding: var(--s-sm);
    position: relative;
  }

  .img-placeholder::before {
    content: attr(data-label);
    font-size: 2.5rem;
    position: absolute;
    opacity: 0.15;
  }

  @media (max-width: 768px) {
    .hero {
      height: auto;
      min-height: 100vh;
      min-height: 100dvh;
    }

    .hero__content {
      grid-template-columns: 1fr;
      grid-template-rows: auto auto;
      text-align: center;
      padding-top: 80px;
      padding-bottom: 20px;
      gap: var(--s-sm);
      align-items: start;
      align-content: center;
    }

    .hero__text {
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .hero__title {
      font-size: clamp(2rem, 8vw, 3rem);
      margin-bottom: 0.5rem;
    }

    .hero__subtitle {
      margin-inline: auto;
      font-size: clamp(0.9rem, 3vw, 1.1rem);
      margin-bottom: 0.5rem;
    }

    .hero__typing-line {
      margin-bottom: 0.5rem;
    }

    .hero__ctas {
      justify-content: center;
      gap: 0.5rem;
    }

    .hero__ctas .btn {
      padding: 0.6rem 1.2rem;
      font-size: 0.85rem;
    }

    .hero__portrait {
      order: -1;
      display: flex;
      justify-content: center;
    }

    .hero__portrait-img {
      max-height: 240px;
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: var(--radius-xl);
    }
  }

  @media (max-height: 700px) {
    .hero__content {
      padding-top: 65px;
      padding-bottom: 15px;
      gap: 0.75rem;
    }

    .hero__title {
      font-size: clamp(2rem, 4.5vw, 3.5rem);
      margin-bottom: 0.5rem;
    }

    .hero__subtitle {
      margin-bottom: 0.5rem;
      font-size: clamp(0.9rem, 1.8vw, 1.2rem);
    }

    .hero__typing-line {
      margin-bottom: 0.5rem;
    }

    .hero__portrait-img {
      max-height: calc(100vh - 150px);
      max-height: calc(100dvh - 150px);
    }
  }

  /* --- BUTTONS --- */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    font-family: var(--f-body);
    font-size: var(--fs-sm);
    font-weight: 600;
    border-radius: 10px;
    transition: all var(--t-base) var(--ease);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    will-change: transform;
  }

  .btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent);
    opacity: 0;
    transition: opacity var(--t-fast);
  }

  .btn:hover::before {
    opacity: 1;
  }

  .btn--primary {
    background: var(--rojo);
    color: #FAF7F2;
    box-shadow: 0 4px 20px rgba(139, 26, 26, 0.35);
  }

  .btn--primary:hover {
    background: var(--rojo-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 26, 26, 0.45);
  }

  .btn--secondary {
    background: transparent;
    color: #FAF7F2;
    border: 1.5px solid rgba(250, 247, 242, 0.45);
  }

  .btn--secondary:hover {
    background: rgba(250, 247, 242, 0.1);
    border-color: rgba(250, 247, 242, 0.8);
    transform: translateY(-2px);
  }

  [data-theme="light"] .hero__ctas .btn--secondary {
    color: #1A1A1A;
    border-color: rgba(26, 26, 26, 0.45);
    background: rgba(26, 26, 26, 0.04);
  }

  [data-theme="light"] .hero__ctas .btn--secondary:hover {
    color: #1A1A1A;
    border-color: rgba(26, 26, 26, 0.8);
    background: rgba(26, 26, 26, 0.1);
  }

  .btn--outline {
    background: transparent;
    color: #1A1A1A;
    border: 1.5px solid #1A1A1A;
  }

  .btn--outline:hover {
    background: #1A1A1A;
    color: #FAF7F2;
    transform: translateY(-2px);
  }

  .btn--gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #FAF7F2;
  }

  .btn--gold:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-gold);
  }

  .btn--sm {
    padding: 0.55rem 1.2rem;
    font-size: var(--fs-xs);
  }

  .btn--lg {
    padding: 1.1rem 2.6rem;
    font-size: 1rem;
  }

  /* --- CARD --- */
  .card {
    background: var(--blanco-puro);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--sh-sm);
    transition: all var(--t-base) var(--ease);
    border: 1px solid var(--borde);
    container-type: inline-size;
  }

  .card:hover {
    transform: translateY(-6px);
    box-shadow: var(--sh-lg);
  }

  .card__image {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    background: linear-gradient(135deg, var(--beige), var(--claro));
  }

  .card__body {
    padding: var(--s-md);
  }

  .card__tag {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--rojo);
    margin-bottom: var(--s-xs);
  }

  .card__title {
    font-size: var(--fs-h4);
    margin-bottom: var(--s-xs);
  }

  .card__desc {
    font-size: var(--fs-sm);
    color: var(--gris);
    line-height: 1.65;
  }

  .card__meta {
    font-size: var(--fs-xs);
    color: var(--gris);
    margin-top: var(--s-sm);
  }

  /* Container query: card adapts to container width */
  @container (min-width: 500px) {
    .card {
      display: grid;
      grid-template-columns: 1fr 1.5fr;
    }

    .card__image {
      aspect-ratio: auto;
      height: 100%;
    }
  }

  /* --- MENSAJE / CARTA --- */
  .mensaje {
    background: var(--beige-light);
    position: relative;
  }

  .mensaje::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 5%;
    font-family: var(--f-display);
    font-size: 14rem;
    color: var(--gold);
    opacity: 0.06;
    line-height: 1;
  }

  .mensaje__body {
    font-family: var(--f-quote);
    font-size: var(--fs-h4);
    line-height: 1.8;
    color: var(--carbon);
    max-width: 58ch;
  }

  .mensaje__firma {
    margin-top: var(--s-lg);
  }

  .mensaje__firma-nombre {
    font-family: var(--f-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--rojo);
    display: block;
  }

  .mensaje__firma-cargo {
    font-size: var(--fs-sm);
    color: var(--gris);
  }

  /* --- PILARES --- */
  .pilares {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-lg);
  }

  @media (max-width: 768px) {
    .pilares {
      grid-template-columns: 1fr;
    }
  }

  .pilar {
    text-align: center;
    padding: var(--s-xl) var(--s-md);
    border-radius: var(--radius-xl);
    background: var(--blanco-puro);
    border: 1px solid var(--borde);
    transition: all var(--t-base) var(--ease);
    position: relative;
    overflow: hidden;
    container-type: inline-size;
  }

  .pilar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rojo), var(--gold));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-out);
  }

  .pilar:hover::before {
    transform: scaleX(1);
  }

  .pilar:hover {
    box-shadow: var(--sh-lg);
    transform: translateY(-4px);
  }

  .pilar__icon {
    width: 76px;
    height: 76px;
    margin: 0 auto var(--s-md);
    border-radius: var(--radius-full);
    background: var(--rojo-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--rojo);
    transition: all var(--t-base) var(--ease-spring);
  }

  .pilar:hover .pilar__icon {
    background: var(--rojo);
    color: #FAF7F2;
    transform: scale(1.08) rotate(-3deg);
  }

  .pilar__title {
    font-size: var(--fs-h4);
    margin-bottom: var(--s-xs);
  }

  .pilar__desc {
    font-size: var(--fs-sm);
    color: var(--gris);
  }

  /* --- TIMELINE --- */
  .timeline {
    position: relative;
    padding: var(--s-lg) 0;
  }

  .timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(180deg, var(--gold), var(--rojo), var(--gold));
    transform: translateX(-50%);
  }

  .timeline__item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-xl);
    margin-bottom: var(--s-xl);
    position: relative;
  }

  .timeline__item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 20px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--rojo);
    border: 3px solid var(--gold);
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 20px var(--rojo-glow);
  }

  .timeline__item:nth-child(even) .timeline__content {
    grid-column: 2;
    text-align: left;
  }

  .timeline__item:nth-child(odd) .timeline__content {
    grid-column: 1;
    text-align: right;
  }

  .timeline__year {
    font-family: var(--f-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: var(--s-xs);
  }

  .timeline__title {
    font-size: var(--fs-h4);
    margin-bottom: var(--s-xs);
  }

  .timeline__desc {
    font-size: var(--fs-sm);
    color: var(--gris);
  }

  @media (max-width: 768px) {
    .timeline::before {
      left: 20px;
    }

    .timeline__item {
      grid-template-columns: 1fr;
      padding-left: 50px;
    }

    .timeline__item::before {
      left: 20px;
    }

    .timeline__item:nth-child(odd) .timeline__content,
    .timeline__item:nth-child(even) .timeline__content {
      grid-column: 1;
      text-align: left;
    }
  }

  /* --- COUNTERS --- */
  .counters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-lg);
  }

  @media (max-width: 768px) {
    .counters {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .counter {
    text-align: center;
    padding: var(--s-lg) var(--s-sm);
  }

  .counter__number {
    font-family: var(--f-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--rojo);
    line-height: 1;
    margin-bottom: var(--s-xs);
  }

  .counter__label {
    font-size: var(--fs-sm);
    color: var(--gris);
    font-weight: 500;
  }

  /* --- CIFRAS BANNER --- */
  .cifras-banner {
    background: linear-gradient(135deg, var(--azul-deep) 0%, var(--azul) 60%, var(--rojo) 100%);
    color: #FAF7F2;
    position: relative;
    overflow: hidden;
  }

  .cifras-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23C4A265' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }

  .cifras-banner h2 {
    color: #FAF7F2;
  }

  .cifras-banner .counter__number {
    color: var(--gold-light);
  }

  .cifras-banner .counter__label {
    color: rgba(250, 247, 242, 0.7);
  }

  /* --- STAT ROW (About section) --- */
  .stat-row {
    display: flex;
    gap: var(--s-lg);
    margin: var(--s-lg) 0;
    flex-wrap: wrap;
  }

  .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
  }

  .stat-number {
    font-family: var(--f-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--rojo);
    line-height: 1;
  }

  .stat-label {
    font-size: var(--fs-sm);
    color: var(--texto-suave);
    text-align: center;
  }

  @media (max-width: 600px) {
    .stat-row {
      justify-content: center;
    }
  }

  /* --- EJES GRID --- */
  .ejes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-md);
  }

  @media (max-width: 768px) {
    .ejes {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 480px) {
    .ejes {
      grid-template-columns: 1fr;
    }
  }

  .eje {
    padding: var(--s-lg);
    border-radius: var(--radius-lg);
    background: var(--blanco-puro);
    border: 1px solid var(--borde);
    text-align: center;
    transition: all var(--t-base) var(--ease);
    cursor: pointer;
  }

  .eje:hover {
    border-color: var(--rojo);
    transform: translateY(-4px);
    box-shadow: var(--sh-lg);
  }

  .eje__icon {
    font-size: 2.4rem;
    margin-bottom: var(--s-sm);
    display: block;
  }

  .eje__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--s-xs);
  }

  .eje__desc {
    font-size: var(--fs-xs);
    color: var(--gris);
  }

  /* --- BOOK CARDS --- */
  .books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--s-lg);
  }

  .book-card {
    text-align: center;
    transition: all var(--t-base) var(--ease);
  }

  .book-card:hover {
    transform: translateY(-8px);
  }

  .book-card__cover {
    width: 100%;
    aspect-ratio: 3/4.3;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--azul), var(--rojo));
    box-shadow: var(--sh-md);
    margin-bottom: var(--s-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light);
    font-family: var(--f-display);
    font-size: 1.05rem;
    font-weight: 600;
    padding: var(--s-md);
    position: relative;
    overflow: hidden;
    transition: all var(--t-base) var(--ease);
  }

  .book-card:hover .book-card__cover {
    box-shadow: var(--sh-lg), 0 0 40px var(--gold-glow);
    transform: rotate(-1deg);
  }

  .book-card__cover::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(196, 162, 101, 0.25);
    border-radius: 8px;
  }

  .book-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
  }

  .book-card__author {
    font-size: var(--fs-xs);
    color: var(--gris);
    margin-bottom: var(--s-xs);
  }

  .book-card__price {
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rojo);
  }

  /* --- NEWS GRID --- */
  .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--s-lg);
  }

  /* --- EVENT CARDS --- */
  .events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--s-lg);
  }

  .event-card {
    display: flex;
    gap: var(--s-md);
    padding: var(--s-md);
    background: var(--blanco-puro);
    border-radius: var(--radius-lg);
    border: 1px solid var(--borde);
    transition: all var(--t-base) var(--ease);
  }

  .event-card:hover {
    border-color: var(--rojo);
    box-shadow: var(--sh-md);
    transform: translateY(-3px);
  }

  .event-card__date {
    flex-shrink: 0;
    width: 72px;
    text-align: center;
    padding: var(--s-sm);
    background: linear-gradient(135deg, var(--rojo), var(--rojo-hover));
    border-radius: var(--radius);
    color: #FAF7F2;
  }

  .event-card__day {
    font-family: var(--f-display);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
  }

  .event-card__month {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.2rem;
  }

  .event-card__info {
    flex: 1;
  }

  .event-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
  }

  .event-card__location {
    font-size: var(--fs-xs);
    color: var(--gris);
  }

  .event-card__time {
    font-size: var(--fs-xs);
    color: var(--rojo);
    font-weight: 600;
    margin-top: var(--s-xs);
  }

  .event-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }

  .event-card__category {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-dark);
    background: var(--gold-glow);
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    width: fit-content;
  }

  .event-card__desc {
    font-size: var(--fs-sm);
    color: var(--texto-suave);
    line-height: 1.5;
  }

  .event-card__meta {
    display: flex;
    gap: var(--s-md);
    font-size: var(--fs-xs);
    color: var(--gris);
    flex-wrap: wrap;
  }

  #proximos-eventos .events-grid {
    align-items: stretch;
  }

  #proximos-eventos .event-card {
    height: 320px;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    background: linear-gradient(155deg, rgba(250, 247, 242, 0.94), rgba(240, 230, 211, 0.86));
    border: 1px solid rgba(213, 206, 195, 0.72);
    box-shadow: var(--sh-sm);
    backdrop-filter: blur(6px);
  }

  #proximos-eventos .event-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.65;
    pointer-events: none;
  }

  #proximos-eventos .event-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--sh-md), 0 0 30px var(--gold-glow);
    border-color: rgba(212, 175, 55, 0.45);
  }

  #proximos-eventos .event-card__info,
  #proximos-eventos .event-card__content {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 0;
  }

  #proximos-eventos .event-card__title {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
  }

  #proximos-eventos .event-card__desc {
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--texto);
  }

  #proximos-eventos .event-card__location,
  #proximos-eventos .event-card__meta {
    color: color-mix(in srgb, var(--gris) 78%, var(--carbon) 22%);
  }

  #proximos-eventos .event-card__date {
    width: 78px;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(206, 17, 38, 0.25);
  }

  #proximos-eventos .event-card__time,
  #proximos-eventos .event-card__meta,
  #proximos-eventos .event-card .btn,
  #proximos-eventos .event-card .badge {
    margin-top: auto;
  }

  @media (max-width: 768px) {
    #proximos-eventos .event-card {
      height: auto;
      min-height: 290px;
    }
  }

  /* --- GALLERY --- */
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--s-sm);
  }

  .gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: linear-gradient(135deg, var(--beige), var(--claro));
  }

  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
  }

  .gallery-item:hover img {
    transform: scale(1.08);
  }

  .gallery-item__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(15, 29, 53, 0.8));
    opacity: 0;
    transition: opacity var(--t-base) var(--ease);
    display: flex;
    align-items: flex-end;
    padding: var(--s-md);
  }

  .gallery-item:hover .gallery-item__overlay {
    opacity: 1;
  }

  .gallery-item__caption {
    color: #FAF7F2;
    font-size: var(--fs-sm);
    font-weight: 500;
  }

  /* --- CTA SECTION --- */
  .cta-section {
    background: linear-gradient(135deg, var(--rojo) 0%, var(--azul) 100%);
    color: #FAF7F2;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23FAF7F2' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }

  .cta-section h2 {
    color: #FAF7F2;
  }

  .cta-section p {
    color: rgba(250, 247, 242, 0.85);
    margin-inline: auto;
  }

  /* --- FORMS --- */
  .form-group {
    margin-bottom: var(--s-md);
  }

  .form-group label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--carbon);
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 1.5px solid var(--borde);
    border-radius: 10px;
    font-family: var(--f-body);
    font-size: var(--fs-body);
    background: var(--blanco-puro);
    color: var(--carbon);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
  }

  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: var(--rojo);
    box-shadow: 0 0 0 4px var(--rojo-bg);
  }

  .form-group textarea {
    resize: vertical;
    min-height: 100px;
  }

  .privacy-link {
    color: var(--rojo);
  }

  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-md);
  }

  @media (max-width: 600px) {
    .form-grid {
      grid-template-columns: 1fr;
    }
  }

  /* --- PROPUESTA CARD --- */
  .propuesta-card {
    background: var(--blanco-puro);
    border: 1px solid var(--borde);
    border-radius: var(--radius-lg);
    padding: var(--s-lg);
    transition: all var(--t-base) var(--ease);
    position: relative;
    overflow: hidden;
  }

  .propuesta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--rojo), var(--gold));
    opacity: 0;
    transition: opacity var(--t-base);
  }

  .propuesta-card:hover {
    border-color: var(--rojo);
    box-shadow: var(--sh-lg);
    transform: translateY(-4px);
  }

  .propuesta-card:hover::before {
    opacity: 1;
  }

  .propuesta-card__number {
    font-family: var(--f-display);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--gold);
    opacity: 0.3;
    line-height: 1;
    margin-bottom: var(--s-xs);
  }

  .propuesta-card__title {
    font-size: var(--fs-h4);
    margin-bottom: var(--s-sm);
  }

  .propuesta-card__desc {
    font-size: var(--fs-sm);
    color: var(--gris);
    margin-bottom: var(--s-sm);
  }

  .propuesta-card__tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
  }

  .propuesta-card__tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    background: var(--rojo-bg);
    color: var(--rojo);
  }

  /* --- ACCORDION --- */
  .accordion {
    border: 1px solid var(--borde);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .accordion__item {
    border-bottom: 1px solid var(--borde);
  }

  .accordion__item:last-child {
    border-bottom: none;
  }

  .accordion__header {
    width: 100%;
    padding: var(--s-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    color: var(--carbon);
    text-align: left;
    transition: background var(--t-fast);
  }

  .accordion__header:hover {
    background: var(--beige-light);
  }

  .accordion__icon {
    transition: transform var(--t-base) var(--ease);
    font-size: 1.2rem;
  }

  .accordion__item.open .accordion__icon {
    transform: rotate(180deg);
  }

  .accordion__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--ease-out);
  }

  .accordion__body-inner {
    padding: 0 var(--s-md) var(--s-md);
    color: var(--texto);
    font-size: var(--fs-sm);
    line-height: 1.7;
  }

  /* --- TABS --- */
  .tabs {
    display: flex;
    gap: var(--s-xs);
    margin-bottom: var(--s-lg);
    flex-wrap: wrap;
    justify-content: center;
  }

  .tab {
    padding: 0.6rem 1.5rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    border-radius: 30px;
    border: 1.5px solid var(--borde);
    color: var(--texto);
    transition: all var(--t-fast) var(--ease);
  }

  .tab:hover {
    border-color: var(--rojo);
    color: var(--rojo);
  }

  .tab.active {
    background: var(--rojo);
    border-color: var(--rojo);
    color: #FAF7F2;
  }

  /* --- PAGE HEADER --- */
  .page-header {
    background: linear-gradient(135deg, var(--azul-deep) 0%, var(--azul) 50%, var(--rojo) 100%);
    color: #FAF7F2;
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23C4A265' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }

  .page-header h1 {
    color: #FAF7F2;
    position: relative;
    z-index: 1;
  }

  .page-header p {
    color: rgba(250, 247, 242, 0.8);
    position: relative;
    z-index: 1;
    max-width: 56ch;
    margin-inline: auto;
  }

  .page-header .section-divider {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
  }

  /* --- BADGE --- */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .badge--red {
    background: var(--rojo-bg);
    color: var(--rojo);
  }

  .badge--gold {
    background: rgba(196, 162, 101, 0.15);
    color: var(--gold-dark);
  }

  .badge--blue {
    background: rgba(27, 42, 74, 0.1);
    color: var(--azul);
  }

  /* --- FOOTER --- */
  .footer {
    background: var(--azul-deep);
    color: rgba(250, 247, 242, 0.7);
    padding: var(--s-2xl) 0 var(--s-md);
    margin-bottom: 0;
    box-shadow: 0 50vh 0 50vh #111111;
  }

  .footer p {
    margin-bottom: 0;
  }

  .footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--s-xl);
    margin-bottom: var(--s-xl);
  }

  @media (max-width: 768px) {
    .footer__grid {
      grid-template-columns: 1fr 1fr;
      gap: var(--s-lg);
    }
  }

  @media (max-width: 480px) {
    .footer__grid {
      grid-template-columns: 1fr;
    }
  }

  .footer__brand-name {
    font-family: var(--f-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #FAF7F2;
  }

  .footer__brand-desc {
    font-size: var(--fs-sm);
    line-height: 1.6;
    max-width: 36ch;
    margin-top: var(--s-sm);
  }

  .footer__heading {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: #FAF7F2;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--s-sm);
  }

  .footer__link {
    display: block;
    font-size: var(--fs-sm);
    padding: 0.3rem 0;
    transition: color var(--t-fast);
  }

  .footer__link:hover {
    color: var(--gold-light);
  }

  .footer__bottom {
    border-top: 1px solid rgba(250, 247, 242, 0.1);
    padding-top: var(--s-md);
    padding-bottom: 0;
    margin-bottom: 0;
    overflow: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-xs);
    flex-wrap: wrap;
    gap: var(--s-sm);
  }

  .footer__social {
    display: flex;
    gap: var(--s-sm);
  }

  .footer__social a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(250, 247, 242, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast) var(--ease-spring);
    font-size: 1rem;
  }

  .footer__social a:hover {
    background: var(--rojo);
    color: #FAF7F2;
    transform: scale(1.15) rotate(-5deg);
  }

  /* --- LIGHTBOX --- */
  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 29, 53, 0.95);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base);
    backdrop-filter: blur(10px);
  }

  .lightbox.active {
    opacity: 1;
    pointer-events: auto;
  }

  .lightbox__close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(250, 247, 242, 0.1);
    color: #FAF7F2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--t-fast);
  }

  .lightbox__close:hover {
    background: var(--rojo);
    transform: rotate(90deg);
  }

  .lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius-lg);
  }

  body > .whatsapp-float,
  body > .back-to-top,
  body > .lightbox {
    position: fixed !important;
  }

  /* --- WHATSAPP FLOAT --- */
  .whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 4px 24px rgba(37, 211, 102, 0.45);
    z-index: var(--z-toast);
    transition: all var(--t-fast) var(--ease-spring);
    animation: pulse-wa 2.5s infinite;
  }

  .whatsapp-float:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 35px rgba(37, 211, 102, 0.55);
  }

  @keyframes pulse-wa {

    0%,
    100% {
      box-shadow: 0 4px 24px rgba(37, 211, 102, 0.45);
    }

    50% {
      box-shadow: 0 4px 35px rgba(37, 211, 102, 0.65);
    }
  }

  /* --- BACK TO TOP --- */
  .back-to-top {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background: var(--azul);
    color: #FAF7F2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: var(--z-toast);
    opacity: 0;
    pointer-events: none;
    transition: all var(--t-base) var(--ease);
    box-shadow: var(--sh-md);
  }

  .back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .back-to-top:hover {
    background: var(--rojo);
    transform: translateY(-4px);
  }

  /* --- SWIPER OVERRIDES --- */
  .swiper {
    width: 100%;
    padding-bottom: 50px !important;
  }

  .swiper-pagination-bullet {
    background: var(--rojo) !important;
    opacity: 0.3 !important;
  }

  .swiper-pagination-bullet-active {
    opacity: 1 !important;
  }

  .swiper-button-next,
  .swiper-button-prev {
    color: var(--rojo) !important;
  }
}

/* ======================== ANIMATIONS ======================== */
@layer animations {

  /* GSAP-powered reveals (initial state) */
  .gsap-reveal {
    opacity: 0;
    transform: translateY(40px);
  }

  .gsap-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
  }

  .gsap-reveal-right {
    opacity: 0;
    transform: translateX(50px);
  }

  .gsap-reveal-scale {
    opacity: 0;
    transform: scale(0.9);
  }

  /* Fallback without JS */
  @media (prefers-reduced-motion: reduce) {

    .gsap-reveal,
    .gsap-reveal-left,
    .gsap-reveal-right,
    .gsap-reveal-scale {
      opacity: 1;
      transform: none;
    }
  }

  /* Magnetic button effect (via JS) */
  .magnetic {
    transition: transform 0.2s var(--ease-spring);
  }

  /* Scroll-driven animations (CSS native 2026) */
  @supports (animation-timeline: scroll()) {
    .scroll-fade-in {
      animation: scroll-reveal linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 90%;
    }

    @keyframes scroll-reveal {
      from {
        opacity: 0;
        transform: translateY(30px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Progress bar (scroll indicator) */
    .scroll-progress {
      position: fixed;
      top: 72px;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--rojo), var(--gold));
      transform-origin: left;
      z-index: calc(var(--z-nav) + 1);
      animation: grow-progress linear;
      animation-timeline: scroll();
    }

    @keyframes grow-progress {
      from {
        transform: scaleX(0);
      }

      to {
        transform: scaleX(1);
      }
    }
  }

  /* Stagger */
  .delay-1 {
    --delay: 0.1s;
  }

  .delay-2 {
    --delay: 0.2s;
  }

  .delay-3 {
    --delay: 0.3s;
  }

  .delay-4 {
    --delay: 0.4s;
  }

  .delay-5 {
    --delay: 0.5s;
  }

  .delay-6 {
    --delay: 0.6s;
  }
}

/* ======================== UTILITIES ======================== */
@layer utilities {
  .bg-beige {
    background: var(--beige-light);
  }

  .mt-sm {
    margin-top: var(--s-sm);
  }

  .mt-md {
    margin-top: var(--s-md);
  }

  .mt-lg {
    margin-top: var(--s-lg);
  }

  .mb-sm {
    margin-bottom: var(--s-sm);
  }

  .mb-md {
    margin-bottom: var(--s-md);
  }

  .mb-lg {
    margin-bottom: var(--s-lg);
  }

  .gap-sm {
    gap: var(--s-sm);
  }

  .gap-md {
    gap: var(--s-md);
  }

  .pos-rel {
    position: relative;
    z-index: 1;
  }
}

/* ======================== DARK MODE ======================== */
@layer dark {
  [data-theme="dark"] {
    --blanco: #722F37;
    --blanco-puro: #7A343D;
    --beige: #6B2B33;
    --beige-light: #7A343D;
    --carbon: #FAF7F2;
    --texto: #E8DED0;
    --gris: #C8B8A8;
    --claro: #8B4049;
    --borde: #944550;
    --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --sh-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --sh-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
  }

  [data-theme="dark"] .navbar {
    background: rgba(114, 47, 55, 0.92);
    border-bottom-color: rgba(212, 175, 55, 0.15);
  }

  [data-theme="dark"] .navbar__links {
    background: rgba(114, 47, 55, 0.98);
  }

  [data-theme="dark"] .navbar__brand-name {
    color: var(--gold-light);
  }

  [data-theme="dark"] .navbar__link:hover {
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.1);
  }

  [data-theme="dark"] .navbar__link.active {
    color: var(--gold-light);
  }

  [data-theme="dark"] .navbar__link:hover::after,
  [data-theme="dark"] .navbar__link.active::after {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
  }

  [data-theme="dark"] .navbar__dropdown-toggle.active {
    color: var(--gold-light);
  }

  [data-theme="dark"] .navbar__dropdown.open .navbar__dropdown-toggle {
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.12);
  }

  [data-theme="dark"] .navbar__dropdown-menu {
    background: rgba(114, 47, 55, 0.98);
    border-color: rgba(212, 175, 55, 0.25);
    scrollbar-color: var(--gold-light) transparent;
  }

  [data-theme="dark"] .navbar__dropdown-label {
    color: var(--gold-light);
    border-top-color: rgba(212, 175, 55, 0.2);
  }

  [data-theme="dark"] .navbar__dropdown-item {
    color: rgba(250, 247, 242, 0.9);
  }

  [data-theme="dark"] .navbar__dropdown-item:hover {
    color: #FAF7F2;
    background: rgba(250, 247, 242, 0.08);
  }

  [data-theme="dark"] .badge--red {
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold-light);
  }

  [data-theme="dark"] .badge--gold {
    background: rgba(212, 175, 55, 0.2);
    color: #FAF7F2;
  }

  [data-theme="dark"] .badge--blue {
    background: rgba(250, 247, 242, 0.12);
    color: #FAF7F2;
  }

  [data-theme="dark"] h1,
  [data-theme="dark"] h2,
  [data-theme="dark"] h3,
  [data-theme="dark"] h4 {
    color: #FAF7F2;
  }

  [data-theme="dark"] blockquote,
  [data-theme="dark"] .cita {
    color: var(--gold-light);
  }

  [data-theme="dark"] .mensaje {
    background: #5E2730;
  }

  [data-theme="dark"] .bg-beige {
    background: #5E2730;
  }

  [data-theme="dark"] .counter__number {
    color: var(--gold-light);
  }

  [data-theme="dark"] .form-group input,
  [data-theme="dark"] .form-group select,
  [data-theme="dark"] .form-group textarea {
    background: #6B2B33;
    border-color: var(--borde);
    color: #FAF7F2;
  }

  [data-theme="dark"] .hero {
    background: #722F37;
  }

  [data-theme="dark"] .hero__text {
    color: #FAF7F2;
  }

  [data-theme="dark"] .hero__title {
    color: #FAF7F2;
  }

  [data-theme="dark"] .hero__title em {
    color: var(--gold-light);
  }

  [data-theme="dark"] .hero__subtitle {
    color: rgba(250, 247, 242, 0.85);
  }

  [data-theme="dark"] .hero__typing-line {
    color: rgba(250, 247, 242, 0.9);
  }

  [data-theme="dark"] .event-card__time {
    color: var(--gold-light);
  }

  [data-theme="dark"] #proximos-eventos .event-card {
    background: linear-gradient(155deg, rgba(122, 52, 61, 0.92), rgba(107, 43, 51, 0.88));
    border-color: rgba(212, 175, 55, 0.22);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.34);
  }

  [data-theme="dark"] #proximos-eventos .event-card:hover {
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45), 0 0 28px rgba(212, 175, 55, 0.18);
  }

  [data-theme="dark"] #proximos-eventos .event-card__title {
    color: #FAF7F2;
  }

  [data-theme="dark"] #proximos-eventos .event-card__desc {
    color: rgba(250, 247, 242, 0.9);
  }

  [data-theme="dark"] #proximos-eventos .event-card__location,
  [data-theme="dark"] #proximos-eventos .event-card__meta {
    color: rgba(250, 247, 242, 0.78);
  }

  [data-theme="dark"] .book-card__price {
    color: var(--gold-light);
  }

  [data-theme="dark"] #madre-coraje p[style*="color:var(--rojo)"] {
    color: var(--gold-light) !important;
  }

  [data-theme="dark"] .privacy-link {
    color: var(--gold-light) !important;
  }

  [data-theme="dark"] .hero__label {
    color: var(--gold-light);
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.1);
  }

  [data-theme="dark"] #agenda .section-label {
    color: var(--gold-light);
  }

  [data-theme="dark"] #agenda h2 {
    color: #FAF7F2;
  }

  [data-theme="dark"] #agenda .event-card__location {
    color: rgba(250, 247, 242, 0.82);
  }

  [data-theme="dark"] #agenda .event-card__time {
    color: var(--gold-light);
  }

  [data-theme="dark"] .card__tag {
    color: var(--gold-light);
  }

  [data-theme="dark"] .btn--outline {
    color: #FAF7F2;
    border-color: rgba(250, 247, 242, 0.75);
    background: rgba(250, 247, 242, 0.06);
  }

  [data-theme="dark"] .btn--outline:hover {
    background: #FAF7F2;
    color: #722F37;
    border-color: #FAF7F2;
  }
}