/* Foro de la Excelencia 2026 — estilos */
  :root{
    --black:#000000;
    --gold:#c9a24b;
    --gold-light:#e8cd82;
    --gold-dim:#7a6530;
    --ivory:#f3efe4;
    --ivory-dim:#a8a395;
    --deco:'Cinzel Decorative', serif;
    --serif:'Cinzel', serif;
    --sans:'Montserrat', sans-serif;

    /* Diseño base 1920 px → márgenes de 200 px; se adapta a laptops de 13" */
    --margen: clamp(24px, 10.4vw, 200px);
    --fs-body: clamp(14px, 1.15vw, 22px);
    --fs-title: clamp(28px, 3vw, 58px);
    --cube: clamp(416px, 46.4vw, 896px);   /* lienzo con margen para que no se corten las esquinas al rotar */
  }

  *{margin:0;padding:0;box-sizing:border-box;}
  html{scroll-behavior:smooth; overflow-y:scroll;}   /* la barra de scroll siempre visible: sin saltos de ancho */
  /* Bloqueo durante el video: la barra queda visible, sin recorrido (el documento mide una sola pantalla) */
  html.scroll-locked body{height:100vh; height:100svh; overflow:hidden;}

  @media (prefers-reduced-motion: reduce){
    html{scroll-behavior:auto;}
    *{animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important;}
  }

  body{
    background:var(--black);
    color:var(--ivory);
    font-family:var(--sans);
    font-weight:300;
    line-height:1.6;
    overflow-x:clip;
  }

  h1,h2,h3{
    font-family:var(--deco);
    font-weight:700;
    letter-spacing:0.02em;
    color:var(--gold-light);
  }

  p{color:var(--ivory);}
  a{color:inherit; text-decoration:none;}
  img{max-width:100%; display:block;}

  ::selection{background:var(--gold); color:var(--black);}
  a:focus-visible, button:focus-visible{outline:2px solid var(--gold-light); outline-offset:3px;}

  #cursor-particles{
    position:fixed; inset:0; width:100%; height:100%;
    pointer-events:none; z-index:90;
  }

  .sr-only{
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
  }

  /* Sección base: 100% del alto de pantalla, márgenes laterales iguales */
  .sec{
    position:relative;
    min-height:100vh; min-height:100svh;
    padding:0 var(--margen);
    display:flex; align-items:center; justify-content:center;
    background:var(--black);
  }

  /* ---------- Botones ---------- */
  .btn-outline{
    display:inline-block;
    border:1px solid var(--gold);
    color:var(--gold-light);
    background:transparent;
    border-radius:8px;
    letter-spacing:0.1em;
    text-transform:uppercase;
    font-weight:600;
    transition:background .35s ease, color .35s ease, border-color .35s ease, transform .3s ease, box-shadow .3s ease;
  }
  .btn-outline:hover{
    background:linear-gradient(135deg, var(--gold-light), var(--gold));
    color:var(--black);
    transform:translateY(-2px);
    box-shadow:0 12px 30px rgba(201,162,75,0.28);
  }
  .btn-outline.btn-sm{padding:9px 22px; font-size:clamp(11px,.8vw,14px);}
  .btn-outline.btn-lg{padding:13px 32px; font-size:clamp(12px,.9vw,15px);}

  /* ---------- NAV ---------- */
  #navbar{
    position:fixed;
    top:0; left:0; right:0;
    z-index:100;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:14px var(--margen) 14px clamp(16px,2vw,40px);
    background:transparent;
    border-bottom:1px solid rgba(232,205,130,0.28);
    opacity:0;
    transform:translateY(-8px);
    pointer-events:none;
    transition:opacity .9s ease, transform .9s ease, background .4s ease, padding .4s ease, backdrop-filter .4s ease;
  }
  #navbar.visible{opacity:1; transform:translateY(0); pointer-events:auto;}
  #navbar.scrolled{
    background:rgba(0,0,0,0.82);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
  }

  .logo-lockup{display:flex; align-items:center;}
  .logo-icon{height:clamp(34px,2.6vw,52px); width:auto; flex-shrink:0;}
  .logo-expand{
    display:flex;
    align-items:center;
    gap:12px;
    max-width:0;
    margin-left:0;
    opacity:0;
    overflow:hidden;
    white-space:nowrap;
    transition:max-width .55s cubic-bezier(.22,.7,.3,1), opacity .4s ease, margin-left .55s cubic-bezier(.22,.7,.3,1);
  }
  .logo-lockup:hover .logo-expand,
  .logo-lockup:focus-visible .logo-expand,
  .logo-lockup.is-open .logo-expand{
    max-width:440px;
    margin-left:14px;
    opacity:1;
  }
  .logo-bar{height:28px; width:auto;}
  .logo-wordmark{height:24px; width:auto;}

  .nav-links{
    display:flex;
    align-items:center;
    gap:clamp(14px,1.4vw,28px);
    font-size:clamp(11px,.8vw,14px);
    letter-spacing:0.08em;
    text-transform:uppercase;
    font-weight:500;
  }
  .nav-links a.nav-link{color:var(--gold-light); transition:color .3s ease;}
  .nav-links a.nav-link:hover{color:#fff;}
  .nav-divider{display:block; width:1px; height:20px; background:var(--gold-light); opacity:.7;}
  .nav-toggle{display:none;}

  @media (max-width:900px){
    .nav-links{
      position:fixed; top:0; right:0; height:100vh; width:min(78vw,320px);
      background:rgba(0,0,0,0.98);
      flex-direction:column; justify-content:center; align-items:flex-start;
      gap:26px; padding:0 40px;
      font-size:14px;
      transform:translateX(100%);
      transition:transform .4s ease;
      border-left:1px solid rgba(201,162,75,0.15);
    }
    .nav-links.open{transform:translateX(0);}
    .nav-divider{display:none;}
    .nav-toggle{
      display:flex; flex-direction:column; gap:5px;
      z-index:110; background:none; border:none; cursor:pointer; padding:6px;
    }
    .nav-toggle span{width:22px; height:1px; background:var(--ivory); transition:transform .3s ease, opacity .3s ease;}
    .nav-toggle.open span:nth-child(1){transform:translateY(6px) rotate(45deg);}
    .nav-toggle.open span:nth-child(2){opacity:0;}
    .nav-toggle.open span:nth-child(3){transform:translateY(-6px) rotate(-45deg);}
  }

  /* ---------- HERO ---------- */
  #hero{
    position:relative;
    height:100vh; height:100svh; min-height:560px;
    overflow:hidden; background:var(--black);
  }
  #hero-particles{position:absolute; inset:0; width:100%; height:100%; object-fit:cover;}
  #hero-particles{pointer-events:none;}

  /* Video del hero en Vimeo: el iframe cubre toda la seccion (equivale a object-fit:cover del <video> anterior).
     Sin z-index a proposito: respeta el orden del HTML (respaldo < video < particulas < boton). */
  .hero-vimeo{position:absolute; inset:0; overflow:hidden; pointer-events:none; container-type:size;}
  .hero-vimeo iframe{
    position:absolute; top:50%; left:50%; border:0; pointer-events:none;
    width:max(100vw, 177.78vh);  height:max(56.25vw, 100vh);          /* respaldo para navegadores sin cq */
    width:max(100cqw, 177.78cqh); height:max(100cqh, 56.25cqw);
    transform:translate(-50%,-50%);
  }

  #hero::after{
    content:"";
    position:absolute;
    left:0; right:0; bottom:0; height:22vh;
    background:linear-gradient(to bottom, transparent, var(--black));
    pointer-events:none;
  }

  /* Respaldo mientras carga el video: el logo en la posición (y proporción) del último fotograma.
     Medido del diseño de 1920×1080. Queda debajo del video y solo aparece si el video tarda más de ~1 s. */
  .hero-fallback{
    --hl:38.8vw;
    position:absolute; left:30.1%; top:27.3%;
    width:var(--hl); height:calc(var(--hl) * 0.251);
    opacity:0; animation:heroFallbackIn .6s ease 1.2s forwards;
    pointer-events:none;
  }
  .hero-fallback img{position:absolute; object-fit:contain; max-width:none;}
  .hf-icon{left:0; top:calc(var(--hl) * 0.0094); width:calc(var(--hl) * 0.1866); height:calc(var(--hl) * 0.243);}
  .hf-bar{left:calc(var(--hl) * 0.231); top:calc(var(--hl) * 0.0027); width:calc(var(--hl) * 0.0134); height:calc(var(--hl) * 0.188);}
  .hf-word{left:calc(var(--hl) * 0.293); top:0; width:calc(var(--hl) * 0.709); height:calc(var(--hl) * 0.1785);}
  @keyframes heroFallbackIn{to{opacity:1;}}

  .hero-cta{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; z-index:3;}
  .hero-cta .btn-outline{
    margin-top:calc(30vh + 50px);
    opacity:0;
    transform:translateY(10px);
    pointer-events:none;
    transition:opacity 1.1s ease, transform 1.1s ease, background .35s ease, color .35s ease, border-color .35s ease, box-shadow .3s ease;
  }
  .hero-cta .btn-outline.visible{opacity:1; transform:translateY(0); pointer-events:auto;}

  /* Solo círculo con flecha */
  .scroll-cue{
    position:absolute; bottom:clamp(20px,4vh,40px); left:50%; transform:translateX(-50%); z-index:4;
    width:44px; height:44px;
    border:1px solid var(--gold-light); border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    opacity:0; pointer-events:none;
    transition:opacity 1.1s ease, background .3s ease;
  }
  .scroll-cue.visible{opacity:1; pointer-events:auto;}
  .scroll-cue:hover{background:rgba(232,205,130,0.15);}
  .scroll-cue svg{
    width:18px; height:18px; fill:none; stroke:var(--gold-light); stroke-width:1.5;
    stroke-linecap:round; stroke-linejoin:round;
    animation:nudge 2s ease-in-out infinite;
  }
  @keyframes nudge{0%,100%{transform:translateY(-2px);} 50%{transform:translateY(3px);}}

  /* ---------- HISTORIA / CUBO ----------
     La pista mide 305vh: 100vh de entrada (el cubo sube desde abajo con fade)
     + 205vh con el escenario fijo (deslizar, flotar, zoom largo, fade mientras sube JJD). */
  #historia{
    position:relative; z-index:1;
    height:305vh; height:305svh;
    background:var(--black);
  }
  #pinnedStage{
    position:sticky; top:0;
    height:100vh; height:100svh;
    overflow:hidden;
  }

  .text-col{
    position:absolute; left:var(--margen); top:50%;
    width:calc(50% - var(--margen));
    transform:translateY(-50%);
    opacity:0; pointer-events:none;
  }
  .text-col h2{
    text-align:center;
    font-size:var(--fs-title);
    margin-bottom:clamp(16px,2vw,40px);
  }
  .text-col p{
    font-size:var(--fs-body);
    line-height:1.55;
    margin-bottom:.9em;
  }

  #cubeWrap{
    position:absolute; left:50%; top:50%;
    width:var(--cube); height:var(--cube);
    margin-left:calc(var(--cube) / -2); margin-top:calc(var(--cube) / -2);
    will-change:transform, opacity;
    opacity:0;
    pointer-events:none;
  }
  #cubeCanvas{display:block; width:100%; height:100%;}

  /* ---------- JOHN JAMES DUPUIS ---------- */
  #jjd{
    position:relative; z-index:2;
    background:transparent;                      /* el cubo se sigue viendo detrás mientras se desvanece */
    margin-top:-86vh; margin-top:-86svh;
    will-change:transform;
    min-height:100vh; min-height:100svh;
    padding:0 var(--margen);
    display:grid; grid-template-columns:1fr 1fr; align-items:stretch;
  }
  .jjd-photo{display:flex; align-items:flex-end; justify-content:center;}
  .jjd-photo img{
    height:92vh; height:92svh; width:auto; max-width:100%;
    object-fit:contain; object-position:bottom center;
  }
  .jjd-text{
    display:flex; flex-direction:column; justify-content:center;
    padding-bottom:6svh;
    opacity:0; will-change:opacity, transform;   /* lo controla el scroll: aparece después de la foto */
    text-shadow:0 0 14px rgba(0,0,0,.85);        /* legible mientras el cubo termina de desvanecerse detrás */
  }
  .jjd-text h2{
    text-align:center;
    font-size:var(--fs-title);
    margin-bottom:clamp(28px,3.4vw,72px);
  }
  .jjd-text p{
    font-size:var(--fs-body);
    line-height:1.55;
    margin-bottom:.9em;
  }
  /* Párrafos justificados sin cortar palabras con guiones */
  .text-col p, .jjd-text p{
    text-align:justify;
    text-justify:inter-character;
    hyphens:none; -webkit-hyphens:none;
    word-break:normal; overflow-wrap:normal;
    text-wrap:pretty;
  }

  /* ---------- DETALLES ---------- */
  .detalles-grid{
    width:100%;
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:1px;
    background:rgba(201,162,75,0.28);
    border:1px solid rgba(201,162,75,0.28);
  }
  .detalle-item{
    background:var(--black);
    padding:clamp(28px,3vw,60px) clamp(10px,1.2vw,24px);
    text-align:center;
    min-width:0;
  }
  .detalle-item svg{
    width:clamp(24px,2vw,38px); height:clamp(24px,2vw,38px);
    color:var(--gold-light); margin:0 auto clamp(10px,1vw,18px);
  }
  .detalle-item .label{
    font-size:clamp(11px,.8vw,15px); letter-spacing:0.12em;
    color:var(--gold-light); margin-bottom:clamp(8px,.9vw,16px);
  }
  .detalle-item .value{
    font-family:var(--serif); font-size:clamp(14px,1.1vw,22px);
    color:var(--ivory); line-height:1.4; white-space:nowrap;
  }
  .detalle-item .sub{
    margin-top:8px; font-size:clamp(10px,.72vw,14px);
    color:var(--ivory); opacity:.85; white-space:nowrap;
  }

  /* ---------- COUNTDOWN (≈500 px de alto en 1080) ---------- */
  /* Detalles y Countdown comparten sección: alto según su contenido, sin huecos grandes */
  #detalles{
    min-height:auto;
    padding-top:clamp(56px,9vh,110px);
    padding-bottom:clamp(56px,9vh,110px);
  }
  .info-inner{width:100%; display:flex; flex-direction:column;}
  .info-title{
    text-align:center;
    font-size:var(--fs-title);
    margin-bottom:clamp(28px,4vh,56px);
  }
  /* Countdown: ocupa el ancho de las dos tarjetas centrales (Sede y Formato), centrado respecto a ellas */
  .countdown-grid{
    width:50%; margin:clamp(40px,8vh,96px) auto 0;
    display:flex; justify-content:center; flex-wrap:nowrap;
    gap:clamp(6px,1vw,20px);
  }
  .cd-block{flex:1 1 0; min-width:0; text-align:center;}
  .cd-num{
    font-family:var(--deco); font-weight:400;
    font-size:clamp(26px,3vw,56px);
    color:var(--gold-light); line-height:1.1;
  }
  .cd-label{
    font-family:var(--serif); font-weight:700; letter-spacing:0.04em;
    font-size:clamp(10px,1.05vw,20px);
    color:var(--gold-light); margin-top:.2em;
  }

  /* ---------- REGISTRO ---------- */
  #registro{padding-top:96px; padding-bottom:64px;}
  .registro-inner{
    width:100%;
    display:flex; flex-direction:column; align-items:center;
  }
  .registro-title{
    text-align:center;
    font-size:clamp(24px,2.4vw,46px);
    margin-bottom:clamp(20px,2vw,36px);
  }
  .form-frame{
    width:min(350px, 100%);
    border:1px solid var(--gold-light);
    border-radius:24px;
    padding:clamp(20px,2vw,32px) 0;
    min-height:320px;
  }
  /* Formulario de JotForm en iframe: se ve igual que en el editor (ancho del formulario: 300 px) */
  .form-iframe{
    display:block; width:100%; height:700px; border:0;
    background:var(--black);
  }

  /* ---------- FOOTER ---------- */
  footer{
    min-height:clamp(52px,7vh,76px);
    padding:0 var(--margen);
    display:flex; align-items:center; justify-content:center;
    background:linear-gradient(90deg, #a8893f 0%, #e8cd82 50%, #a8893f 100%);
    color:#000;
  }
  .footer-inner{
    display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
    gap:clamp(5px,.6vw,11px);
    font-family:var(--sans); font-weight:500;
    font-size:10px;
    color:#000;
  }
  .footer-text{display:inline-flex; align-items:center; gap:clamp(5px,.6vw,11px);}
  .ft-item{white-space:nowrap;}
  .footer-lockup{display:flex; align-items:center; gap:12px;}
  .footer-lockup img{width:auto; filter:brightness(0);}
  .footer-logo{height:clamp(34px,2.4vw,46px);}
  .footer-bar{height:clamp(20px,1.5vw,28px);}
  .footer-wordmark{height:clamp(18px,1.3vw,24px);}
  .footer-space{height:clamp(40px,8vh,90px); background:var(--black);}

  /* ---------- Laptops bajas (p. ej. 1280×720) ---------- */
  @media (max-height:760px) and (min-width:861px){
    .text-col p, .jjd-text p{line-height:1.45; margin-bottom:.7em;}
  }

  /* ---------- Móvil / tablet vertical ---------- */
  @media (max-width:860px){
    :root{ --cube: clamp(352px, 99vw, 480px); }

    .hero-fallback{--hl:min(84vw, 520px); left:calc(50% - var(--hl) / 2); top:32%;}

    .text-col{
      left:6%; width:88%; top:9%;
      transform:none;
    }
    .text-col h2{margin-bottom:12px;}
    .text-col p{font-size:13px; line-height:1.5; margin-bottom:.7em;}

    #jjd{
      grid-template-columns:1fr;
      min-height:auto;
      padding:12vh var(--margen) 24px;
      align-items:start;
    }
    .jjd-photo img{height:auto; max-height:46svh; width:auto;}
    .jjd-text{padding-bottom:0; margin-top:24px;}
    .jjd-text p{font-size:14px;}

    .detalles-grid{grid-template-columns:repeat(2, 1fr);}
    .detalle-item .value, .detalle-item .sub{white-space:normal;}
    .detalle-item .value{font-size:15px;}
    .detalle-item .sub{font-size:11px;}
    .jjd-text h2{margin-bottom:18px;}

    #detalles{padding:36px var(--margen);}
    .info-title{margin-bottom:20px;}
    .countdown-grid{width:100%; margin-top:28px; flex-wrap:nowrap; justify-content:center; gap:clamp(4px,1.6vw,10px);}
    .cd-block{min-width:0; flex:1 1 0;}
    .cd-num{font-size:clamp(26px,9vw,42px);}
    .cd-label{font-size:clamp(8px,2.5vw,12px); letter-spacing:0;}
    #registro{padding-top:28px; padding-bottom:48px;}
    .registro-title{margin-bottom:16px;}

    /* Footer en dos líneas: logo arriba, texto abajo */
    footer{padding:14px 16px;}
    .footer-inner{flex-direction:column; gap:10px; text-align:center;}
    .footer-sep-first{display:none;}
    .footer-text{display:block; line-height:1.7;}
    .ft-item{display:inline-block; white-space:nowrap;}
    .ft-sep{display:inline-block; margin:0 5px;}
  }
