/* ============================================================
   Instituto Escala - landing page
   Paleta: tinta #1A1A1A · papel #FFFFFF · rojo #E03028 · hueso #EAE8E2
   Tipografía: Archivo variable (wdth 62-125, wght 100-900)
   ============================================================ */

:root {
  --ink: #1A1A1A;
  --paper: #FFFFFF;
  --red: #E03028;
  --bone: #EAE8E2;
  --pad-x: 44px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Archivo, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: var(--bone); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }

@keyframes rise    { from { transform: translate(-50%, 102%); } to { transform: translate(-50%, 0); } }
@keyframes lineup  { from { transform: translateY(115%); }      to { transform: translateY(0); } }
@keyframes marquee { from { transform: translateX(0); }         to { transform: translateX(-50%); } }
@keyframes bob     { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---- Piezas compartidas ---- */

/* Medio sol de la marca */
.sun-mark { background: var(--red); flex: none; }
.sun-mark-lg { width: 18px; height: 9px; border-radius: 18px 18px 0 0; }
.sun-mark-sm { width: 14px; height: 7px; border-radius: 14px 14px 0 0; }

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-name {
  font-stretch: 125%;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.section-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.45em;
  text-transform: uppercase;
}

.accent { color: var(--red); }

.lineup-mask, .reveal-mask { display: block; overflow: hidden; }

/* ---- Cursor custom ---- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: var(--paper);
  mix-blend-mode: difference;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-100px, -100px);
  display: none;
}
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor * { cursor: none !important; }

/* ---- 01 · Hero ---- */

.hero {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.nav {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px var(--pad-x);
}

.nav-links { display: flex; align-items: center; gap: 44px; }

.nav-link {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.nav-link-accent { color: var(--red); }

.hero-sun {
  position: absolute;
  left: 50%;
  bottom: -14vw;
  width: 38vw;
  min-width: 340px;
  transform: translate(-50%, 0);
  animation: rise 1.2s var(--ease-out) 0.35s both;
  z-index: 3;
}
.hero-sun svg { display: block; }

.hero-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4.5vh;
  padding-bottom: 14vh;
}

.hero-kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  text-align: center;
  animation: lineup 0.9s var(--ease-out) 0.4s both;
}
.hero-main .lineup-mask { padding: 0 24px; }

.hero-title { margin: 0; width: 100%; text-align: center; line-height: 0.82; }

.hero-word {
  display: block;
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(4rem, 13vw, 12.5rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hero-foot {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 28px var(--pad-x);
}

.hero-place {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: lineup 0.9s var(--ease-out) 1s both;
}

.hero-arrow { display: inline-block; font-size: 20px; font-weight: 900; line-height: 1; }
.hero-arrow-inner { display: block; animation: bob 2.4s ease-in-out infinite; }

/* ---- 02 · Marquee ---- */

.marquee-band { background: var(--ink); overflow: hidden; padding: 17px 0; }

.marquee {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}

.marquee-rep {
  display: flex;
  align-items: center;
  gap: 52px;
  padding-right: 52px;
  flex: none;
}

.marquee-word {
  color: var(--bone);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.42em;
  white-space: nowrap;
  text-transform: uppercase;
}

/* ---- 03 · Manifiesto ---- */

.manifiesto {
  background: var(--ink);
  color: var(--bone);
  padding: 24vh 7vw;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 4fr;
  gap: 6vw;
  align-items: start;
}

.manifiesto-label {
  position: sticky;
  top: 14vh;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.manifiesto-line {
  margin: 0 0 11vh;
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.7vw, 4rem);
  line-height: 1.12;
  text-transform: uppercase;
  max-width: 24ch;
}
.manifiesto-line-last { margin-bottom: 0; }

/* ---- 04 · Cursos ---- */

.cursos { background: var(--paper); padding-top: 18vh; }

.cursos-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 var(--pad-x) 56px;
}

.cursos-title {
  display: block;
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cursos-count { font-size: 11px; font-weight: 700; letter-spacing: 0.4em; }

.curso-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: clamp(100px, 11vw, 170px) 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 56px var(--pad-x);
  border-top: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: background 0.35s;
}
.curso-row-last { border-bottom: 1px solid var(--ink); }

.curso-row:hover { background: var(--ink); color: var(--bone); }

.row-sun {
  position: absolute;
  left: var(--pad-x);
  bottom: 0;
  width: 130px;
  height: 65px;
  background: var(--red);
  border-radius: 130px 130px 0 0;
  transform: translateX(-280%);
  transition: transform 0.55s var(--ease-out);
  z-index: 0;
}
.curso-row:hover .row-sun { transform: translateX(0); }

.curso-num {
  position: relative;
  z-index: 1;
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 1;
  -webkit-text-stroke: 1.25px var(--ink);
  color: transparent;
}
.curso-row:hover .curso-num { -webkit-text-stroke-color: var(--bone); }

.curso-name {
  position: relative;
  z-index: 1;
  font-stretch: 118%;
  font-weight: 900;
  font-size: clamp(1.4rem, 2.9vw, 2.9rem);
  line-height: 1.02;
  text-transform: uppercase;
}

.curso-tag {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  justify-self: end;
}

.curso-tag-badge {
  border: 1px solid var(--red);
  color: var(--red);
  padding: 8px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
}

/* ---- 05 · Curso insignia ---- */

.insignia {
  background: var(--paper);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

.insignia-side { grid-column: 1 / span 4; border-right: 1px solid var(--ink); }

.insignia-side-sticky {
  position: sticky;
  top: 12vh;
  display: flex;
  justify-content: center;
  padding: 16vh 0;
}

.insignia-num {
  display: block;
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(7rem, 16vw, 18rem);
  line-height: 0.8;
  -webkit-text-stroke: 2px var(--ink);
  color: transparent;
}

.insignia-body {
  grid-column: 5 / span 8;
  padding: 16vh 8vw 16vh 5vw;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.section-tag-ink { color: var(--ink); }

.insignia-title-wrap { margin: 0; overflow: hidden; }

.insignia-title {
  display: block;
  font-stretch: 118%;
  font-weight: 900;
  font-size: clamp(1.9rem, 3.9vw, 3.9rem);
  line-height: 1;
  text-transform: uppercase;
}

.insignia-desc {
  margin: 0;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 400;
  line-height: 1.75;
  max-width: 46ch;
}

.insignia-specs { display: flex; flex-direction: column; }

.spec-row {
  display: grid;
  grid-template-columns: clamp(150px, 17vw, 230px) 1fr;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--ink);
}
.spec-row-last { border-bottom: 1px solid var(--ink); }

.spec-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  align-self: center;
}

.spec-value {
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.insignia-cta {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
}

/* ---- 06 · CTA final ---- */

.cta {
  background: var(--ink);
  color: var(--bone);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9vh;
  padding: 12vh 6vw;
  overflow: hidden;
}

.cta-title { margin: 0; text-align: center; }

.cta-line {
  display: block;
  font-stretch: 120%;
  font-weight: 900;
  font-size: clamp(2.4rem, 6.8vw, 6.8rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.cta-magnet { display: block; }

.cta-circle {
  width: clamp(190px, 22vw, 290px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--bone);
  font-weight: 700;
  font-size: clamp(12px, 1vw, 14px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.cta-circle:hover { color: var(--bone); }

.cta-note {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

/* ---- 07 · Footer ---- */

.footer { background: var(--paper); border-top: 1px solid var(--ink); }

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12vh var(--pad-x);
  border-bottom: 1px solid var(--ink);
}
.footer-logo svg { display: block; max-width: 70vw; height: auto; }

.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); }

.footer-cell {
  border-right: 1px solid var(--ink);
  padding: 48px var(--pad-x);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.footer-cell-brand { min-height: 240px; }
.footer-cell-base { border-right: none; }

.footer-copy { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; }

.footer-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.footer-links { display: flex; flex-direction: column; gap: 12px; }

.footer-link {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.footer-link-plain { text-transform: none; letter-spacing: 0.05em; }

.footer-base { display: flex; flex-direction: column; gap: 8px; }
.footer-city { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.footer-coords { font-size: 11px; font-weight: 500; letter-spacing: 0.18em; }

/* ============================================================
   Animaciones de entrada (activas solo con JS + motion permitido:
   el JS agrega .fx a <html>; sin JS todo queda visible)
   ============================================================ */

.fx [data-reveal] {
  transform: translateY(115%);
  transition: transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.fx [data-reveal].is-in { transform: translateY(0); }

.fx [data-fadein] {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s ease, transform 0.9s var(--ease-out), background 0.35s;
}
.fx [data-fadein].is-in { opacity: 1; transform: translateY(0); }

.fx [data-scalein] {
  transform: scale(0.55);
  transition: transform 1.3s var(--ease-out);
}
.fx [data-scalein].is-in { transform: scale(1); }

/* ---- Movimiento reducido ---- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-sun, .hero-kicker, .hero-place, .hero-arrow-inner, .marquee {
    animation: none;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  :root { --pad-x: 24px; }

  .nav { padding: 20px var(--pad-x); }
  .nav-links { gap: 22px; }

  .hero-sun { min-width: 300px; bottom: -120px; }

  .manifiesto {
    grid-template-columns: 1fr;
    gap: 8vh;
    padding: 16vh var(--pad-x);
  }
  .manifiesto-label { position: static; }
  .manifiesto-line { margin-bottom: 8vh; }
  .manifiesto-line-last { margin-bottom: 0; }

  .cursos { padding-top: 12vh; }
  .cursos-head { padding-bottom: 36px; }

  .curso-row {
    grid-template-columns: 64px 1fr;
    gap: 12px 20px;
    padding: 36px var(--pad-x);
  }
  .curso-tag { grid-column: 2; justify-self: start; }
  .row-sun { width: 96px; height: 48px; border-radius: 96px 96px 0 0; }

  .insignia { display: block; }
  .insignia-side { border-right: none; }
  .insignia-side-sticky { position: static; justify-content: flex-start; padding: 10vh var(--pad-x) 0; }
  .insignia-num { font-size: clamp(6rem, 24vw, 9rem); }
  .insignia-body { padding: 6vh var(--pad-x) 12vh; gap: 36px; }
  .spec-row { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-cell { border-right: none; border-top: 1px solid var(--ink); padding: 36px var(--pad-x); }
  .footer-cell-brand { min-height: 0; border-top: none; }
  .footer-cell:nth-child(2) { border-top: none; }
}

@media (max-width: 560px) {
  /* El sol del hero pasa por detrás de la barra inferior: en difference
     el texto #E5E5E5 se ve tinta sobre blanco y hueso sobre el sol */
  .hero-foot { mix-blend-mode: difference; }
  .hero-place, .hero-arrow { color: #E5E5E5; }

  .nav-links { gap: 16px; }
  .nav-link { letter-spacing: 0.18em; }
  .nav .brand-name { display: none; }
  .footer .brand-name { letter-spacing: 0.2em; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-cell:nth-child(2) { border-top: 1px solid var(--ink); }
  .footer-logo svg { width: 220px; height: 220px; }
}
