/* ¿Qué estás revisando, pillín? 👀 Para más info, cotiza asesoría: https://bitum.cl */
/* =========================================================
   34° FERIA DE SOFTWARE · SEDE CONCEPCIÓN
   Layout: una columna de 1200px con bandas de ancho completo
   separadas por cortes diagonales (los techos inclinados de la sede).
   Superficies con radio, sin desenfoques ni brillos.
   Tipografía: Archivo (display, ancho variable) + IBM Plex Sans
   (texto) + IBM Plex Mono (etiquetas y datos).
   ========================================================= */

:root {
  color-scheme: dark;
  --ink: #0b1020;          /* fondo principal: tinta azulada */
  --ink-2: #111830;        /* bandas alternas */
  --ink-3: #1a2340;        /* superficies elevadas */
  --line: #2a3454;         /* reglas y bordes */
  --fg: #f2f4fa;
  --fg-2: #aab3cc;         /* texto secundario */
  --amarillo: #f5b322;     /* bandera USM */
  --rojo: #e8333f;
  --azul: #2c5fd6;
  --azul-2: #6f94ff;       /* azul claro para texto sobre tinta */
  --r-sm: 10px; --r: 18px; --r-lg: 28px; --r-pill: 999px;
  --tilt: 3.2vw;           /* altura del corte diagonal entre bandas */
  --font-display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --container: 1200px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--fg);
  background: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--amarillo); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.05; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 700; letter-spacing: -0.015em; }
h2 em { font-style: normal; color: var(--amarillo); }
p { margin: 0 0 1em; }
.container {
  width: min(var(--container), 100%);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.section { padding-block: clamp(4rem, 9vw, 7rem); position: relative; }
/* Bandas de otro color: borde superior en diagonal, como los techos de la sede */
.section--band {
  background: var(--ink-2);
  clip-path: polygon(0 var(--tilt), 100% 0, 100% 100%, 0 100%);
  padding-top: calc(clamp(4rem, 9vw, 7rem) + var(--tilt));
  margin-top: calc(var(--tilt) * -1);
}

.eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--amarillo); margin: 0 0 0.9rem;
}
.eyebrow--light { color: var(--ink); }
.section__head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap;
  margin-bottom: 2.75rem;
}
.section__desc { max-width: 46ch; color: var(--fg-2); margin: 0; }

/* ---------- Botones (planos, sin desenfoque de fondo) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 0.85rem 1.4rem; font: 600 1rem var(--font-body);
  border: 2px solid transparent; border-radius: var(--r-pill); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--amarillo); color: var(--ink); border-color: var(--amarillo); }
.btn--primary:hover { background: #ffc94d; border-color: #ffc94d; }
.btn--ghost { background: var(--ink); border-color: var(--fg); color: var(--fg); }
.btn--ghost:hover { background: var(--fg); color: var(--ink); }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* ---------- Progreso de lectura ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1000;
  background: var(--amarillo); transform-origin: left; transform: scaleX(0);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem max(16px, env(safe-area-inset-right, 0px)) 0.9rem max(16px, env(safe-area-inset-left, 0px));
  background: transparent; border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s;
}
.nav.is-scrolled { background: var(--ink); border-bottom-color: var(--line); }
.nav__brand { display: flex; align-items: center; gap: .8rem; }
.nav__logo { height: 38px; width: auto; }
.nav__name { font: 600 0.95rem/1.15 var(--font-display); display: flex; flex-direction: column; }
.nav__name small { font: 0.72rem/1 var(--font-mono); color: var(--fg-2); letter-spacing: .06em; text-transform: uppercase; margin-top: .2rem; }
.nav__links { display: flex; align-items: center; gap: 1.5rem; font-size: .95rem; font-weight: 500; }
.nav__links a:not(.btn) { padding: .35rem .8rem; border-radius: var(--r-pill); transition: background .2s; }
.nav__links a:not(.btn):hover, .nav__links a.is-active { background: var(--ink-3); }
.nav__toggle { display: none; background: none; border: 0; width: 42px; height: 42px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; }
.nav__toggle span { display: block; height: 2px; background: var(--fg); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  --parallax: 0px; --fade: 1;
  position: relative; min-height: 100svh; display: grid; align-items: center;
  overflow: hidden; background: var(--ink); isolation: isolate;
}

/* Foto completa, revelada con un recorte rectangular que crece desde el centro */
.hero__photo {
  position: absolute; inset: 0; z-index: 1;
  background: url("../assets/sede-concepcion.jpg") center center / cover no-repeat;
  clip-path: inset(50% 50% 50% 50% round var(--r-lg));
  transform: translateY(calc(var(--parallax) * 0.6));
  transition: clip-path .7s var(--ease);
}
.hero.is-revealed .hero__photo { clip-path: inset(0 0 0 0 round 0); }

/* Silueta SVG */
.hero__svg {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;
  color: var(--amarillo);
  transform: translateY(calc(var(--parallax) * 0.6));
  transition: opacity .45s ease .35s;
}
.hero.is-revealed .hero__svg { opacity: 0; pointer-events: none; }
.hero__fill { opacity: 0; transition: opacity .45s ease; }
.hero.is-filled .hero__fill { opacity: 1; }
.hero__lines path { opacity: 0; }
.hero__lines path.thin { stroke-width: 1.2; }
/* stroke-dashoffset inicial lo fija JS con la longitud real; la animación lo lleva a 0 */
.hero.is-drawn .hero__lines path { animation: drawToZero var(--dur, 1.4s) var(--ease) var(--delay, 0s) forwards; }
.hero.is-filled .hero__lines path { stroke: #fff; transition: stroke .4s; }
@keyframes drawToZero { to { stroke-dashoffset: 0; opacity: 1; } }

/* Oscurecimiento plano para legibilidad */
.hero__shade {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: rgba(11, 16, 32, 0.62);
  opacity: 0; transition: opacity .6s ease;
}
.hero.is-revealed .hero__shade { opacity: 1; }

/* Contenido */
.hero__content {
  position: relative; z-index: 4; width: min(var(--container), 100%); margin: 0 auto;
  padding: clamp(6.5rem, 14vh, 9rem) max(16px, env(safe-area-inset-right, 0px)) clamp(7rem, 14vh, 9rem) max(16px, env(safe-area-inset-left, 0px));
  opacity: var(--fade);
}
.hero__content > * { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.hero.is-ready .hero__content > * { opacity: 1; transform: none; }
.hero.is-ready .hero__where { transition-delay: .8s; }
.hero.is-ready .hero__actions { transition-delay: 1s; }

.hero__lockup {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(1.5rem, 5vw, 5rem);
}
.hero__brand { display: flex; flex-direction: column; gap: .4rem; }
.hero__num-wrap { display: flex; align-items: flex-start; line-height: .85; }
.hero__num {
  font-family: var(--font-display); font-weight: 200; font-stretch: 75%; letter-spacing: -0.04em;
  font-size: clamp(7rem, 17vw, 17rem); color: var(--fg);
}
.hero__deg {
  font-family: var(--font-display); font-weight: 300; font-size: clamp(2.6rem, 6vw, 6rem);
  color: var(--amarillo); margin-top: .3em; margin-left: .05em;
}
/* Etiqueta tipo código: < Feria de Software USM /> */
.hero__tag {
  display: inline-flex; align-items: center; gap: .35em; font-family: var(--font-mono);
  font-size: clamp(1rem, 1.9vw, 1.5rem); color: var(--fg); padding: .5em .8em;
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-pill); width: fit-content;
}
.hero__tag-bracket { color: var(--amarillo); font-weight: 600; }
.hero__tag-text { white-space: pre; min-width: .5em; }
.hero__caret { width: .55em; height: 1.15em; background: var(--amarillo); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Titular */
.hero__title {
  display: flex; flex-direction: column; align-items: flex-start;
  font-family: var(--font-display); font-weight: 800; font-stretch: 88%;
  font-size: clamp(2.6rem, 7.2vw, 7rem); line-height: .95; letter-spacing: -0.02em;
  text-transform: uppercase; color: var(--fg);
}
.hero__line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__line > span { display: block; transform: translateY(110%); transition: transform .9s var(--ease); }
.hero.is-ready .hero__line:nth-child(1) > span { transform: none; transition-delay: .1s; }
.hero.is-ready .hero__line:nth-child(2) > span { transform: none; transition-delay: .22s; }
.hero.is-ready .hero__line:nth-child(3) > span { transform: none; transition-delay: .34s; }
.hero__line--accent { position: relative; color: var(--amarillo); overflow: visible; }
.hero__underline {
  position: absolute; left: -1%; right: -1%; bottom: -.18em; width: 102%; height: .28em;
  fill: none; stroke: var(--rojo); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 700; stroke-dashoffset: 700;
}
.hero.is-ready .hero__underline { animation: underline .9s var(--ease) 1.1s forwards; }
@keyframes underline { to { stroke-dashoffset: 0; } }

/* Fecha y lugar */
.hero__where { margin-top: clamp(2rem, 4vw, 3rem); text-align: center; }
.hero__place {
  display: inline-flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center;
  font: 800 clamp(1.2rem, 2.6vw, 2rem)/1.1 var(--font-display); font-stretch: 88%;
  text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .5rem;
}
.hero__city { color: var(--fg); }
.hero__date { color: var(--amarillo); }
.hero__sep { width: .5em; height: .5em; border-radius: 50%; background: var(--rojo); }
.hero__address { font-family: var(--font-mono); color: var(--fg-2); letter-spacing: .06em; text-transform: uppercase; font-size: clamp(.7rem, 1vw, .85rem); margin: 0; }
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 1.8rem; }

/* Cuenta regresiva */
.hero__countdown {
  position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: clamp(1.25rem, 5vh, 2.5rem); z-index: 4;
  display: flex; opacity: 0; transition: opacity .8s var(--ease) 1.2s;
  border: 1px solid var(--line); background: var(--ink); border-radius: var(--r); overflow: hidden;
}
.hero.is-ready .hero__countdown { opacity: var(--fade); }
.hero__countdown div { min-width: 76px; padding: .8rem .5rem; text-align: center; }
.hero__countdown div + div { border-left: 1px solid var(--line); }
.hero__countdown b { display: block; font: 700 1.7rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.hero__countdown span { font: .65rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--fg-2); }

/* =========================================================
   STATS
   ========================================================= */
.stats { padding-block: 2rem 0; }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { padding: 1.6rem 1.5rem; background: var(--ink-2); border-radius: var(--r); }
.stat:nth-child(odd) { border-bottom-left-radius: var(--r-lg); }
.stat:nth-child(even) { border-top-right-radius: var(--r-lg); }
.stat b { display: block; font: 300 clamp(2.4rem, 4vw, 3.6rem)/1 var(--font-display); font-stretch: 80%; color: var(--amarillo); font-variant-numeric: tabular-nums; }
.stat span { font-family: var(--font-mono); color: var(--fg-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }

/* =========================================================
   LA FERIA
   ========================================================= */
.about__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 4rem; align-items: start; }
.about__text p { color: var(--fg-2); max-width: 62ch; }
.about__text h2 { margin-bottom: 1.4rem; }
.about__points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .6rem; }
.about__points li { padding: .9rem 1.1rem .9rem 2.4rem; background: var(--ink-2); border-radius: var(--r-sm); position: relative; color: var(--fg-2); }
.about__points li b { color: var(--fg); }
.about__points li::before { content: ""; position: absolute; left: 1rem; top: 1.35rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--amarillo); }

.tilt-card { position: relative; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; }
.tilt-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.tilt-card__badge { position: absolute; left: 1rem; bottom: 1rem; padding: .6rem 1rem; background: var(--amarillo); color: var(--ink); font-family: var(--font-display); border-radius: var(--r-sm); }
.tilt-card__badge span { display: block; font: .68rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.tilt-card__badge b { font-size: 1.3rem; font-weight: 800; }
.about__timeline-mini { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--ink-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.about__timeline-mini div { padding: 1rem .9rem; }
.about__timeline-mini span { font: 600 .85rem var(--font-mono); color: var(--amarillo); }
.about__timeline-mini p { margin: .3rem 0 0; font-size: .8rem; color: var(--fg-2); line-height: 1.4; }

/* =========================================================
   PROYECTOS
   ========================================================= */
/* Grupos por categoría: visibles uno tras otro al hacer scroll */
.pgroup + .pgroup { margin-top: clamp(3rem, 6vw, 4.5rem); }
.pgroup__head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem; }
.pgroup__icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 14px 14px 14px 4px; color: var(--ink); }
.pgroup__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pgroup__icon--ia { background: #8fb0ff; } .pgroup__icon--web { background: var(--amarillo); }
.pgroup__icon--iot { background: #6fe0b0; } .pgroup__icon--salud { background: #ff8a94; }
.pgroup__head h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.pgroup__head h3 small { font: .75rem var(--font-mono); color: var(--fg-2); letter-spacing: .06em; text-transform: uppercase; }
.pgroup__head p { margin: .3rem 0 0; color: var(--fg-2); max-width: 60ch; }

.projects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.project {
  --c: var(--amarillo);
  position: relative; display: flex; flex-direction: column; gap: 1rem; min-width: 0; color: inherit;
  padding: 1.4rem; background: var(--ink); border-radius: var(--r); border: 1px solid var(--line);
  transition: transform .25s var(--ease), border-color .25s, background .25s;
}
.project--ia { --c: #8fb0ff; } .project--web { --c: var(--amarillo); }
.project--iot { --c: #6fe0b0; } .project--salud { --c: #ff8a94; }
.project:hover, .project:focus-visible { transform: translateY(-4px); border-color: var(--c); background: var(--ink-2); outline: none; }
/* Logo del equipo como protagonista; sin logo, el de la feria atenuado */
.project__logo {
  width: 100%; height: 9.5rem; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: .8rem;
  border-radius: 14px; background: var(--logo-bg, var(--ink-2)); border: 1px solid var(--line);
}
.project__logo img { max-width: 62%; max-height: 100%; object-fit: contain; }
.project__logo--ph { border-style: dashed; }
.project__logo--ph img { opacity: .28; filter: grayscale(1); transition: opacity .25s; }
.project:hover .project__logo--ph img { opacity: .5; }
/* Logos que rotan (Foram): apilados, solo el activo es visible */
.project__logo--rotating, .proyecto__logo--rotating { position: relative; }
.project__logo--rotating img, .proyecto__logo--rotating img {
  position: absolute; inset: 0; margin: auto; opacity: 0; transform: scale(.94);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.project__logo--rotating img.is-on, .proyecto__logo--rotating img.is-on { opacity: 1; transform: none; }
.project__body { display: flex; flex-direction: column; gap: .55rem; }
.project__name { font: 800 1.45rem/1.1 var(--font-display); letter-spacing: -0.01em; }
.project__desc {
  color: var(--fg-2); font-size: .92rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.project__desc--pending { font-style: italic; }
.project__stack { display: flex; flex-wrap: wrap; gap: .35rem; }
/* Chip de tecnología: logo + nombre (compartido con la ficha) */
.tech { display: inline-flex; align-items: center; gap: .4rem; font: .72rem var(--font-mono); padding: .25rem .65rem .25rem .5rem; background: var(--ink-3); color: var(--fg-2); border-radius: var(--r-pill); white-space: nowrap; }
.tech img, .tech .tech__generic { width: 14px; height: 14px; flex: none; display: inline-grid; place-items: center; }
.tech .tech__generic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.tech.more { background: transparent; border: 1px dashed var(--line); padding-left: .65rem; }
.project svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project__foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-top: auto; padding-top: .9rem; border-top: 1px dashed var(--line); }
.project__team { display: inline-flex; align-items: center; gap: .5rem; }
.project__avatars { display: inline-flex; }
.project__avatars i {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; margin-left: -8px;
  font: 700 .62rem var(--font-display); font-style: normal; color: var(--ink); background: var(--c);
  border: 2px solid var(--ink); transition: border-color .25s;
}
.project__avatars i:first-child { margin-left: 0; }
.project__avatars i:nth-child(2n) { background: var(--fg); }
.project:hover .project__avatars i { border-color: var(--ink-2); }
.project__teamcount { font: .72rem var(--font-mono); color: var(--fg-2); }
.project__go { display: inline-flex; align-items: center; gap: .3rem; font: 600 .8rem var(--font-body); color: var(--fg-2); transition: color .25s; }
.project__go svg { transition: transform .25s var(--ease); }
.project:hover .project__go { color: var(--c); }
.project:hover .project__go svg { transform: translateX(4px); }
.projects__note { margin-top: 1.5rem; color: var(--fg-2); font-size: .9rem; }

/* =========================================================
   HISTORIA: línea de tiempo horizontal
   ========================================================= */
.hline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.2rem; position: relative; counter-reset: none; }
.hline::before { content: ""; position: absolute; left: 0; right: 0; top: calc(3.4rem + 7px); height: 2px; background: var(--line); border-radius: 1px; }
.hline__item { position: relative; display: flex; flex-direction: column; gap: .6rem; padding-top: 0; }
.hline__year { display: block; font: 300 clamp(1.9rem, 2.6vw, 2.6rem)/1 var(--font-display); font-stretch: 78%; color: var(--fg-2); height: 2.6rem; }
.hline__year i { font-style: normal; margin: 0 .15em; opacity: .5; }
.hline__dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--fg-2); margin-top: .4rem; position: relative; z-index: 1; }
.hline__item p { margin: .6rem 0 0; font-size: .9rem; color: var(--fg-2); line-height: 1.5; }
.hline__item p b { color: var(--fg); font-weight: 600; }
.hline__item--ccp .hline__year { color: var(--fg); }
.hline__item--ccp .hline__dot { border-color: var(--azul-2); }
.hline__item--now .hline__year { color: var(--amarillo); font-weight: 500; }
.hline__item--now .hline__dot { background: var(--amarillo); border-color: var(--amarillo); box-shadow: 0 0 0 6px var(--ink), 0 0 0 8px var(--amarillo); }
.hline__item--now p { color: var(--fg); }
.hline__item--now p b { color: var(--amarillo); }

/* =========================================================
   CTA
   ========================================================= */
.cta {
  background: var(--amarillo); color: var(--ink);
  clip-path: polygon(0 0, 100% var(--tilt), 100% 100%, 0 100%);
  padding-top: calc(clamp(4rem, 9vw, 7rem) + var(--tilt));
}
.cta__box { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.cta__box h2 { color: var(--ink); margin-bottom: 1rem; }
.cta__box p { color: var(--ink); opacity: .8; margin: 0; max-width: 48ch; }
.cta__where { display: flex; align-items: center; gap: 1.5rem; justify-self: end; padding: 1.4rem 1.8rem; border: 2px solid var(--ink); border-radius: var(--r-lg); color: var(--ink); }
.cta__when { margin: 0; font: 200 5rem/0.9 var(--font-display); font-stretch: 75%; letter-spacing: -0.04em; display: flex; align-items: baseline; gap: .2rem; }
.cta__when small { font: 700 1rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.cta__when span { font: inherit; }
.cta__addr { margin: 0; font: 600 1.05rem/1.35 var(--font-body); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { padding: 3.5rem 0 1.5rem; color: var(--fg-2); font-size: .92rem; border-top: 1px solid var(--line); }
.footer__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.footer__label { font: .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--amarillo); margin: 0 0 .9rem; }
.footer__usm { display: inline-block; }
.footer__usm img { height: 56px; width: auto; }
.footer__orglinks { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 1rem 0 0; }
.footer__brandbox { display: flex; align-items: center; gap: 1rem; }
.footer__fesw { height: 44px; width: auto; }
.footer__brand { font: 700 1.1rem/1.2 var(--font-display); color: var(--fg); margin: 0; }
.footer__brand small { display: block; font: .78rem var(--font-body); color: var(--fg-2); margin-top: .25rem; }
.footer__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; padding-block: 2.2rem; }
.footer__site { font-style: normal; display: flex; flex-direction: column; gap: .3rem; font-size: .86rem; line-height: 1.4; }
.footer__site b { color: var(--fg); font-weight: 600; }
.footer__site a { font-family: var(--font-mono); font-size: .8rem; width: fit-content; }
.footer__site--now { padding-left: .9rem; border-left: 2px solid var(--amarillo); }
.footer__site--now b { color: var(--amarillo); }
.footer a { border-bottom: 1px solid transparent; }
.footer a:hover { color: var(--amarillo); border-bottom-color: var(--amarillo); }
.footer__credit { display: inline-flex; align-items: center; gap: .45rem; color: var(--fg-2); opacity: .75; font: 500 .78rem var(--font-body); letter-spacing: .01em; }
.footer__credit img { height: 13px; width: auto; opacity: .9; transition: opacity .2s; }
.footer a.footer__credit { border-bottom: 0; transition: opacity .2s; margin-left: auto; }
.footer a.footer__credit:hover { opacity: 1; color: var(--fg); }
.footer a.footer__credit:hover img { opacity: 1; }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .8rem; font-family: var(--font-mono); flex-wrap: wrap; gap: .5rem 1.5rem; }

/* ---------- Botón flotante "volver arriba" ---------- */
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 800;
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  background: var(--amarillo); color: var(--ink); border: 2px solid var(--amarillo);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .2s, color .2s;
}
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--ink); color: var(--amarillo); }

/* =========================================================
   REVEAL (desde estado visible: solo un leve desplazamiento)
   ========================================================= */
.reveal { transform: translateY(14px); transition: transform .6s var(--ease); }
.reveal.is-visible { transform: none; }


/* =========================================================
   FICHA DE PROYECTO (proyecto.html)
   ========================================================= */
.page-proyecto { padding-top: 0; }
.proyecto__hero { --c: var(--amarillo); padding: clamp(7rem, 16vh, 10rem) 0 clamp(3rem, 6vw, 4.5rem); background: var(--ink-2);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--tilt)), 0 100%); padding-bottom: calc(clamp(3rem, 6vw, 4.5rem) + var(--tilt)); }
.proyecto--ia { --c: #8fb0ff; } .proyecto--web { --c: var(--amarillo); } .proyecto--iot { --c: #6fe0b0; } .proyecto--salud { --c: #ff8a94; }
.proyecto__back { display: inline-block; font: 500 .9rem var(--font-body); color: var(--fg-2); margin-bottom: 2rem; }
.proyecto__back:hover { color: var(--fg); }
.proyecto__lockup { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.proyecto__logo { width: clamp(140px, 18vw, 220px); height: clamp(140px, 18vw, 220px); display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 10px; background: var(--logo-bg, var(--ink)); border: 1px solid var(--line); }
.proyecto__logo { padding: 1.2rem; }
.proyecto__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.proyecto__logo--ph { border-style: dashed; }
.proyecto__logo--ph img { opacity: .3; filter: grayscale(1); }
.proyecto__hero .eyebrow { color: var(--c); }
.proyecto__hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 800; font-stretch: 90%; letter-spacing: -0.02em; }
.proyecto__group { color: var(--fg-2); margin: .5rem 0 0; }
.proyecto__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.proyecto__body { padding-top: clamp(2rem, 4vw, 3rem); }
.proyecto__grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.proyecto__main h2 { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-2); margin: 2.4rem 0 .9rem; }
.proyecto__main h2:first-child { margin-top: 0; }
.proyecto__desc { font-size: 1.2rem; line-height: 1.55; max-width: 62ch; }
.proyecto__desc--pending { color: var(--fg-2); font-style: italic; }
.proyecto__audience { color: var(--fg-2); max-width: 62ch; }
.proyecto__video { aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--ink-2); border: 1px solid var(--line); }
.proyecto__video iframe { width: 100%; height: 100%; border: 0; display: block; }
.proyecto__team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.proyecto__team li { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; background: var(--ink-2); border-radius: var(--r-sm); }
.proyecto__team li div { display: flex; flex-direction: column; min-width: 0; }
.proyecto__team b { font-weight: 600; }
.proyecto__team li span:last-child { color: var(--fg-2); font-size: .88rem; }
.proyecto__avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50% 50% 50% 18%;
  background: var(--c, var(--amarillo)); color: var(--ink); font: 700 .9rem var(--font-display); }
.proyecto__team li:nth-child(2n) .proyecto__avatar { background: var(--fg); }
.proyecto__aside { display: grid; gap: 1rem; position: sticky; top: 6rem; }
.proyecto__card { padding: 1.4rem; background: var(--ink-2); border-radius: var(--r); }
.proyecto__card h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-2); margin-bottom: 1rem; }
.proyecto__card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; font-size: .92rem; }
.proyecto__card dt { color: var(--fg-2); } .proyecto__card dd { margin: 0; }
.proyecto__stack { display: flex; flex-wrap: wrap; gap: .4rem; }
.proyecto__stack .tech { font-size: .78rem; padding: .35rem .8rem .35rem .6rem; }
.proyecto__stack .tech img, .proyecto__stack .tech .tech__generic, .proyecto__stack .tech .tech__generic svg { width: 16px; height: 16px; }
.proyecto__links { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.proyecto__links a { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r-sm); transition: border-color .2s, background .2s; }
.proyecto__links a > svg { margin-left: auto; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--fg-2); transition: transform .2s var(--ease), color .2s; }
.proyecto__links a:hover > svg { transform: translateX(3px); color: var(--fg); }
.proyecto__linkicon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ink-3); color: var(--fg); }
.proyecto__linkicon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.proyecto__links a:hover .proyecto__linkicon { background: var(--c, var(--amarillo)); color: var(--ink); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn--icon { padding: .85rem; aspect-ratio: 1; }
.proyecto__links a:hover { border-color: var(--c, var(--amarillo)); background: var(--ink); }
.proyecto__links b { font-weight: 600; font-size: .92rem; }
.proyecto__none { margin: 0; color: var(--fg-2); font-size: .92rem; }
.proyecto__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-block: 1rem clamp(3rem, 6vw, 5rem); }
.proyecto__nav a { display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s, background .2s; }
.proyecto__nav a:hover { border-color: var(--fg-2); background: var(--ink-2); }
.proyecto__nav a.is-next { text-align: right; }
.proyecto__nav small { font: .72rem var(--font-mono); color: var(--fg-2); text-transform: uppercase; letter-spacing: .06em; }
.proyecto__nav b { font: 700 1.1rem var(--font-display); }
.proyecto__empty { padding: clamp(8rem, 20vh, 12rem) 0 6rem; text-align: center; display: grid; gap: 1rem; justify-items: center; }
.proyecto__empty h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
.proyecto__loading { padding: 12rem 0; color: var(--fg-2); text-align: center; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
  .hline { grid-template-columns: repeat(3, 1fr); }
  .hline::before { display: none; }
  .about__grid, .cta__box, .proyecto__grid { grid-template-columns: 1fr; }
  .proyecto__aside { position: static; }
  .cta__where { justify-self: start; }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; inset: 0; background: var(--ink); flex-direction: column; justify-content: center;
    font-size: 1.4rem; gap: 2rem; transform: translateY(-100%); transition: transform .4s var(--ease);
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .nav__links.is-open { transform: none; }
  .nav__name small { display: none; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .projects__grid, .proyecto__team, .proyecto__nav, .hline { grid-template-columns: 1fr; }
  .hline__item { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; }
  .hline__dot { display: none; }
  .hline__year { grid-row: 1 / 3; height: auto; }
  .proyecto__lockup { grid-template-columns: 1fr; }
  .proyecto__nav a.is-next { text-align: left; }
  .about__timeline-mini { grid-template-columns: repeat(2, 1fr); }
  :root { --tilt: 6vw; }
  .hero { grid-template-rows: 1fr auto; }
  .hero__content { padding-bottom: 2rem; }
  .hero__lockup { grid-template-columns: 1fr; gap: 1.2rem; }
  .hero__brand { align-items: center; }
  .hero__title { align-items: center; text-align: center; }
  .hero__num-wrap { justify-content: center; }
  .hero__countdown { position: static; margin: 0 max(16px, env(safe-area-inset-left, 0px)) 3rem; justify-content: center; }
  .hero__countdown div { min-width: 0; flex: 1; }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { transform: none; }
}
