/* =============================================================
   0. Fuentes propias (Ripple)
   ============================================================= */
@font-face {
  font-family: "Ripple";
  src: url("assets/fonts/Ripple-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ripple";
  src: url("assets/fonts/Ripple-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ripple";
  src: url("assets/fonts/Ripple-Heavy.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #0b090c;
  --bg-2: #050405;
  --orange: #ff5a1f;
  --red: #e63757;
  --purple: #7a2e9e;
  --white: #f7f5f4;
  --dim: rgba(247, 245, 244, 0.68);
  --dim-2: rgba(247, 245, 244, 0.38);
  --line: rgba(247, 245, 244, 0.14);
  --silver: linear-gradient(180deg, #f4f4f4 0%, #9a9a9a 45%, #f4f4f4 55%, #6f6f6f 100%);

  --display: "Ripple", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.01em; }
ul { list-style: none; padding: 0; }
::selection { background: var(--orange); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--white); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--orange);
}

.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;
}

/* reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal[data-split] { opacity: 1; transform: none; } /* red de seguridad si el JS falla */
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* si por algún motivo main.js no llega a correr, el contenido igual se ve */
html:not(.is-ready) [data-reveal] { opacity: 1 !important; transform: none !important; }
html:not(.is-ready) .hero-theme { opacity: 1 !important; transform: none !important; }

/* =============================================================
   4. Typography
   ============================================================= */
h1, .h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 6.4rem);
  text-transform: uppercase;
}
h2, .h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.4vw, 2.9rem);
  text-transform: uppercase;
}
h3, .h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}
.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--dim);
  max-width: 46ch;
}

/* =============================================================
   5. Componentes
   ============================================================= */

/* logo real (imagen) */
.logo-nav { height: 34px; width: auto; display: block; }
.logo-hero { height: 44px; height: clamp(38px, 6vw, 56px); width: auto; margin-top: .3rem; }
.logo-footer { height: 44px; width: auto; }
.nav-logo { display: flex; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: 0.95em 1.9em;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .35s var(--ease-out);
}
.btn-primary {
  background: linear-gradient(120deg, var(--orange), var(--red));
  color: var(--white);
  box-shadow: 0 8px 30px -8px rgba(230, 55, 87, 0.55);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -8px rgba(230, 55, 87, 0.7); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--white);
}
.btn-ghost:hover { transform: translateY(-1px); border-color: var(--white); background: rgba(255,255,255,0.06); }
.btn[data-disabled="true"] {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(1);
}

.badge {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--display); font-weight: 700; font-size: .72rem;
  letter-spacing: .18em; text-transform: uppercase;
  padding: .5em 1em; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }

/* =============================================================
   6. Secciones
   ============================================================= */

/* --- nav --- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 1.1rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(5,4,5,0.85), transparent 100%);
  backdrop-filter: blur(0px);
  transform: translateY(-100%);
  transition: transform .5s var(--ease-out), background .4s ease, backdrop-filter .4s ease;
}
.nav.is-visible { transform: translateY(0); }
.nav.is-solid { background: rgba(8,6,8,0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--red));
  transition: width .1s linear;
}
.nav-links { display: none; gap: 2.1rem; font-family: var(--display); font-weight: 700; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.nav-links a { position: relative; color: var(--dim); transition: color .3s var(--ease-out); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px;
  background: var(--orange); transition: right .35s var(--ease-out);
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { right: 0; }
.nav .btn { padding: .7em 1.4em; font-size: .78rem; }

/* --- hero --- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 8rem var(--gutter) 4rem;
  overflow: hidden;
  isolation: isolate;
}
.hero-glow { position: absolute; inset: 0; z-index: -2; background: var(--bg); overflow: hidden; }
.glow-blob {
  position: absolute; width: 140vw; height: 140vw; max-width: 1400px; max-height: 1400px;
  background: conic-gradient(from 180deg at 50% 50%,
    transparent 0deg, var(--orange) 8deg, transparent 22deg,
    transparent 158deg, var(--purple) 172deg, transparent 188deg,
    transparent 338deg, var(--red) 352deg, transparent 360deg);
  filter: blur(60px);
  opacity: 0.5;
}
.glow-blob-a { top: -55%; left: 50%; transform: translateX(-50%); }
.glow-blob-b { bottom: -60%; left: 50%; transform: translateX(-50%) rotate(180deg); }

.hero-grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.scroll-cue {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  width: 22px; height: 36px; border: 1px solid var(--line); border-radius: 999px;
}
.scroll-cue span {
  display: block; width: 4px; height: 8px; margin: 6px auto 0;
  background: var(--orange); border-radius: 999px;
  animation: scroll-cue-move 2s ease-in-out infinite;
}
@keyframes scroll-cue-move {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

.hero-eyebrow-block { display: flex; flex-direction: column; align-items: center; gap: .7rem; margin-bottom: 2.4rem; }
.hero-years {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

/* --- ECOS: un único momento de entrada, con la X de la marca como firma --- */
.hero-title-wrap { position: relative; display: inline-flex; }

.hero-theme {
  position: relative;
  z-index: 2;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(4rem, 18vw, 11rem);
  line-height: .85;
  letter-spacing: -0.02em;
  margin: 0.6rem 0 1.1rem;
  color: var(--white);
  transform-origin: 50% 55%;
  opacity: 0;
  transform: scale(0.94);
}
.hero-title-wrap.is-live .hero-theme {
  animation: title-settle 0.9s var(--ease-out) forwards;
}
@keyframes title-settle {
  0% { opacity: 0; transform: scale(0.94); }
  60% { opacity: 1; transform: scale(1.015); }
  100% { opacity: 1; transform: scale(1); }
}

.hero-echo {
  position: absolute;
  inset: -30% -12%;
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.echo-ring {
  position: absolute;
  width: 46%; aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 90, 31, 0.55);
  opacity: 0;
}
.echo-ring-2 { border-color: rgba(230, 55, 87, 0.45); }

.echo-x {
  position: absolute;
  width: 120%; height: 120%;
  background:
    linear-gradient(45deg, transparent 47%, var(--orange) 49.2%, var(--red) 50.5%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, var(--purple) 49.2%, var(--red) 50.5%, transparent 53%);
  filter: blur(18px);
  opacity: 0;
}

/* Un único destello al cargar — no un loop constante */
.hero-title-wrap.is-live .echo-ring-1 { animation: echo-ring-out 1.5s var(--ease-soft) forwards; }
.hero-title-wrap.is-live .echo-ring-2 { animation: echo-ring-out 1.5s var(--ease-soft) 0.18s forwards; }
.hero-title-wrap.is-live .echo-x { animation: echo-x-flash 1.1s var(--ease-soft) forwards; }

@keyframes echo-ring-out {
  0% { transform: scale(0.4); opacity: 0; }
  22% { opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes echo-x-flash {
  0% { transform: scale(0.7); opacity: 0; }
  35% { transform: scale(1.02); opacity: 0.55; }
  100% { transform: scale(1.1); opacity: 0; }
}

.hero-theme-copy { max-width: 52ch; color: var(--dim); font-size: clamp(1rem, 1.7vw, 1.2rem); margin-bottom: 2.8rem; }

.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 1.9rem 2.6rem;
  margin-bottom: 2.6rem;
}
.hero-meta-item { display: flex; align-items: center; gap: .7rem; text-align: left; }
.hero-meta-item svg { width: 30px; height: 30px; flex: none; color: var(--orange); }
.hero-meta-item strong { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.15; }
.hero-meta-item span { display: block; color: var(--dim); font-size: clamp(.92rem, 1.4vw, 1.02rem); margin-top: .15rem; }
a.hero-meta-item { color: inherit; text-decoration: none; }
a.hero-meta-item:hover strong, a.hero-meta-item:focus-visible strong { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* --- video --- */
.video {
  padding: 6.5rem var(--gutter);
  border-top: 1px solid var(--line);
}
.video-head { max-width: 640px; margin: 0 auto 2.6rem; text-align: center; }
.video-head .eyebrow { display: block; margin-bottom: .8rem; }
.video-frame {
  max-width: 960px; margin: 0 auto;
  height: 0;
  padding-top: 56.25%; /* respaldo 16:9 para navegadores sin soporte de aspect-ratio */
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,90,31,.12), rgba(122,46,158,.12));
  position: relative;
}
@supports (aspect-ratio: 16 / 9) {
  .video-frame { height: auto; padding-top: 0; aspect-ratio: 16 / 9; }
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.video-frame .video-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  color: var(--dim-2); font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .85rem;
}

.video-thumb {
  position: absolute; inset: 0;
  display: block;
}
.video-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease-out), filter .5s var(--ease-out);
}
.video-thumb:hover img { transform: scale(1.03); filter: brightness(0.85); }
.play-button {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 9, 12, 0.55);
  border: 1.5px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(4px);
  transition: transform .35s var(--ease-out), background .35s var(--ease-out);
}
.play-button svg { width: 26px; height: 26px; color: var(--white); margin-left: 3px; }
.video-thumb:hover .play-button { transform: translate(-50%, -50%) scale(1.08); background: rgba(230, 55, 87, 0.85); }
/* --- inscripcion --- */
.inscripcion {
  padding: 6.5rem var(--gutter);
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.inscripcion-card {
  max-width: 920px; margin: 0 auto;
  display: grid; gap: 2.6rem;
  grid-template-columns: 1fr;
  align-items: center;
  padding: clamp(2rem, 5vw, 3.4rem);
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(255,90,31,.09), rgba(230,55,87,.05) 45%, transparent 80%);
  text-align: center;
}
.inscripcion-card .h2 { margin-bottom: 1rem; }
.inscripcion-card .lede { margin: 0 auto 1.8rem; }
.countdown { display: flex; gap: 1.1rem; justify-content: center; margin-bottom: 2.2rem; flex-wrap: wrap; }
.countdown-item { min-width: 74px; }
.countdown-item strong { display: block; font-family: var(--display); font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.countdown-item strong.tick { animation: tick-pulse .4s var(--ease-out); }
@keyframes tick-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.18); color: var(--orange); } 100% { transform: scale(1); } }
.countdown-item span { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim-2); }
.inscripcion-mecanica { max-width: 54ch; margin: 0 auto; color: var(--dim); font-size: .95rem; line-height: 1.65; }
.inscripcion-nota { margin-top: 1.4rem; font-size: .84rem; color: var(--dim-2); }

.form-embed {
  margin-top: 2.4rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.form-embed iframe { display: block; width: 100%; height: 760px; border: 0; }
@media (max-width: 600px) {
  .form-embed iframe { height: 900px; }
}

/* --- oradores --- */
.oradores { padding: 6.5rem var(--gutter); border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin: 0 auto 3rem; text-align: center; }
.section-head .eyebrow { display: block; margin-bottom: .8rem; }
.oradores-grid {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(2, 1fr);
}
.orador-card {
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.orador-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.orador-card .orador-info { padding: 1.1rem 1.2rem 1.3rem; }
.orador-card h3 { margin-bottom: .25rem; }
.orador-card p { color: var(--dim); font-size: .88rem; }

.placeholder-panel {
  max-width: 640px; margin: 0 auto;
  text-align: center;
  padding: 2.6rem 2rem;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--dim-2);
}
.placeholder-panel strong { display: block; color: var(--dim); font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }

/* --- aviso importante del sorteo --- */
.inscripcion-importante {
  max-width: 60ch; margin: -1.2rem auto 0; padding: 1rem 1.2rem;
  border-left: 3px solid var(--orange); border-radius: 4px;
  background: rgba(255, 90, 31, .08);
  color: var(--dim); font-size: .95rem; line-height: 1.55; text-align: left;
}
.inscripcion-importante strong { color: var(--white); }

/* --- sponsors --- */
.sponsors { padding: 6.5rem var(--gutter); border-top: 1px solid var(--line); }
.sponsors-title { font-family: var(--display); }
.sponsor-tier { margin-bottom: 2.6rem; text-align: center; }
[data-sponsors-groups] { margin-top: 2.4rem; }
.sponsor-tier h3 { text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 1.4rem; }
.sponsor-logos { display: flex; flex-wrap: wrap; gap: 1.6rem; align-items: stretch; justify-content: center; }
.sponsor-logos a {
  display: flex; align-items: center; justify-content: center;
  padding: 1.6rem 2.6rem;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.45);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.sponsor-logos img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Cada categoría tiene su tamaño de tarjeta: los logos se ajustan adentro sin deformarse */
.sponsor-tier--grande .sponsor-logos a { width: 260px; height: 130px; padding: 1.6rem 2rem; }
.sponsor-tier--mediano .sponsor-logos a { width: 210px; height: 105px; padding: 1.3rem 1.6rem; }
.sponsor-tier--chico .sponsor-logos a { width: 165px; height: 85px; padding: 1rem 1.2rem; }
.sponsor-tier--chico .sponsor-logos { gap: 1.1rem; }
@media (max-width: 600px) {
  .sponsor-tier--grande .sponsor-logos a { width: min(100%, 260px); }
  .sponsor-tier--mediano .sponsor-logos a { width: calc(50% - .8rem); height: 90px; }
  .sponsor-tier--chico .sponsor-logos a { width: calc(50% - .55rem); height: 76px; }
}
.sponsor-logos a:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -12px rgba(0,0,0,0.55); }

/* --- redes --- */
.redes { padding: 4.5rem var(--gutter); border-top: 1px solid var(--line); text-align: center; }
.redes h2 { margin-bottom: 1.6rem; }
.redes-list { display: flex; gap: 1.2rem; justify-content: center; }
.redes-list a {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line);
  transition: transform .3s var(--ease-out), border-color .3s var(--ease-out), background .3s var(--ease-out);
}
.redes-list a:hover { border-color: var(--orange); background: rgba(255,90,31,.12); }
.redes-list svg { width: 22px; height: 22px; }

/* --- footer --- */
.footer {
  padding: 3rem var(--gutter);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.4rem;
}
.footer-meta { color: var(--dim-2); font-size: .82rem; max-width: 46ch; }
.footer-licencia { display: block; color: var(--dim); margin-bottom: .35rem; }
.footer-tedx { display: flex; align-items: center; }

/* =============================================================
   7. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .nav-links { display: flex; }
  .oradores-grid { grid-template-columns: repeat(4, 1fr); }
  .inscripcion-card { grid-template-columns: 1fr; }
}

@media (min-width: 960px) {
  .hero-meta { gap: 2.2rem 3.6rem; }
}

/* =============================================================
   8. Reduced motion — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-theme { opacity: 1; transform: none; }
  .hero-title-wrap.is-live .hero-theme { animation: none; }
  .hero-title-wrap.is-live .echo-ring-1,
  .hero-title-wrap.is-live .echo-ring-2,
  .hero-title-wrap.is-live .echo-x { animation: none; opacity: 0; }
  .scroll-cue span { animation: none; }
  .hero-grain { display: none; }
}
