/* ---------- Variables ---------- */
:root {
  --negro: #000;
  --blanco: #fff;
  --margen: 4rem;          /* margen lateral general */
  --ancho-contenido: 1200px;
  --fuente: "Archivo", Arial, sans-serif; /* reemplazar por la tipografía definitiva */
}

/* ---------- Reset básico ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--blanco) var(--negro);
  scrollbar-width: thin;
}

/* ---------- Scrollbar (Chrome/Edge/Safari) ---------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--negro);
}

::-webkit-scrollbar-thumb {
  background: var(--blanco);
  border-radius: 0;
}

body {
  font-family: var(--fuente);
  color: var(--blanco);
  font-weight: 200;
}

/* Capa de fondo dedicada (ver script.js): un div normal, no el
   background de body/html, para que el mix-blend-mode del texto
   pueda contrastar correctamente contra él.
   Sin transition: el JS ya cambia el color en cada scroll y una
   transición lo dejaría siempre atrasado (gris eterno). */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--negro);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Fondo negro > blanco controlado por scroll (ver script.js) ---------- */

/* El texto usa mix-blend-mode para invertirse automáticamente
   según el color de fondo detrás y mantenerse siempre legible. */
.bloque--servicios h2,
.bloque--servicios p,
.bloque--servicios dt,
.bloque--servicios dd {
  color: #fff;
  mix-blend-mode: difference;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2.5rem 0 2.5rem var(--margen);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.header__logo {
  color: var(--page-fg, #fff);
  transition: color 0.2s linear;
   display: block;
  padding-left: 2.6em;
  text-indent: -2.6em;
}

.header__pre {
  display: inline-block;
  width: 2.6em;
  text-indent: 0;
  text-transform: none;
}

.header__nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 12rem;
}

.header__nav a {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
}

/* Highlight que se revela de derecha a izquierda al hacer hover.
   Su color es el opuesto del fondo de la página en ese momento. */
.header__nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--page-fg, #fff);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.45s ease-in-out;
  pointer-events: none;
}

.header__nav a:hover::before,
.header__nav a:focus-visible::before {
  transform: scaleX(1);
}

/* Línea inferior y texto: su color es el opuesto del fondo de la
   página; al pasar el highlight por encima pasan a ser del color
   del fondo, que es el opuesto del highlight, manteniendo el
   contraste. La transición va en sincro con la del highlight. */
.header__nav a::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background-color: var(--page-fg, #fff);
  transition: background-color 0.45s ease-in-out;
}

.header__nav a span {
  position: relative;
  z-index: 1;
  display: inline-block;
  color: var(--page-fg, #fff);
  transition: color 0.45s ease-in-out;
}

.header__nav a:hover span,
.header__nav a:focus-visible span {
  color: var(--page-bg, #000);
}

.header__nav a:hover::after,
.header__nav a:focus-visible::after {
  background-color: var(--page-bg, #000);
}

.header__nav a.is-active {
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Logo en video (provisorio). Invierte el video (papel gris y tinta
   negra) y sube el contraste: fondo negro y letras blancas. */
.hero__logo {
  width: min(80vmin, 600px);
  height: auto;
  filter: invert(1) brightness(0.7) contrast(6);
}

/* ---------- Bloques de contenido ---------- */
.bloque {
  width: calc(100% - var(--margen) * 2);
  max-width: var(--ancho-contenido);
  margin: 0 auto 2rem;
}

.bloque--gif {
  min-height: 60vh;
  margin-top: 20vh;
  scroll-margin-top: 14vh;   /* al clickear "Proyectos", deja aire debajo del header */
}

.bloque--gif img {
  width: auto;
  max-width: 100%;
  max-height: 76vh;          /* el GIF entra completo en pantalla */
  margin: 0 auto;
}

.bloque--servicios {
  min-height: 60vh;
  padding-top: 20vh;
  padding-bottom: 35vh;   /* más aire antes del footer */
}

.bloque--servicios h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.servicios__intro {
  max-width: calc(50% - var(--margen) / 2);
  margin-bottom: 3rem;
  opacity: 0.8;
}

.servicios__lista {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem var(--margen);
}

.servicios__item dt {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.servicios__item dd {
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .servicios__lista {
    grid-template-columns: 1fr;
  }
  .servicios__intro {
  max-width: 100%;
  }
}

/* ---------- Espectro (sección de texto, estática) ---------- */
.bloque--texto {
  padding: 28vh 0;
  color: var(--page-fg, #fff);
  font-family: var(--fuente);
}

/* Ocupa todo el ancho entre márgenes */
.espectro {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.espectro__fila {
  display: flex;
  align-items: baseline;
  font-size: 1.1rem;
}

.espectro__izq {
  font-weight: 300;
}

/* La línea se estira y empuja las palabras a los extremos */
.espectro__linea {
  flex: 1;
  height: 1px;
  margin: 0 1.5rem;
  background: currentColor;
}

.espectro__der {
  font-weight: 700;
}

@media (max-width: 768px) {
  .espectro__fila { font-size: 0.95rem; }
  .espectro__linea { margin: 0 0.75rem; }
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  min-height: 20vh;
  background: #fff;
  color: #000;
  font-family: var(--fuente);
  overflow: hidden;
  padding-top: 7rem;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 3rem;
  padding: 0 4vw;
  align-items: start;
}

.footer__tagline {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 300;
}

.footer__imagen {
  display: block;
  width: min(14vw, 210px);
  height: auto;
  margin-top: 9rem;
  opacity: 0.9;
}

.footer__col--nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Hover de subrayado en Proyectos y Servicios */
.footer__col--nav a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s ease;
}

.footer__col--nav a:hover {
  text-decoration-color: #000;
}

.footer__col--contacto {
  display: flex;
  flex-direction: column;
  justify-self: end;
}

.footer__label {
  font-size: 0.75rem;
  font-weight: 300;
  opacity: 0.7;
  margin-top: 1.8rem;
}

.footer__label:first-child {
  margin-top: 0;
}

.footer__dato {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
}

/* Mail gigante: centrado, márgenes parejos, cortado abajo */
.footer__mail-gigante {
  display: block;
  font-size: 6.8vw;            /* valor de respaldo; el JS lo ajusta exacto */
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  height: 0.62em;
  overflow: hidden;
  margin: 6rem 4vw 0;          /* mismo margen a izquierda y derecha */
  letter-spacing: -0.01em;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  :root {
    --margen: 1.5rem;
  }

  .header {
    padding: 1.5rem 0 1.5rem var(--margen);
  }

  .header__nav {
    min-width: 8rem;
  }

  .hero__logo {
    width: 70vw;
  }

  .footer { padding-top: 4rem; }

  .footer__top {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer__imagen { width: 30vw; margin-top: 2rem; }
  .footer__col--contacto { justify-self: start; }
  .footer__mail-gigante { margin-top: 4rem; }
}