/* =============================================================================
   baizzen — pantalla en construcción
   Cada valor de este archivo sale de DIRECCION-DE-ARTE.md. Si algo no está ahí,
   o se agrega ahí con su razón, o se saca de acá.
   ========================================================================== */

:root {
  /* Color — DA §5. Paleta del manual de identidad, lámina 05. */
  --noche:        #090D16;  /* dominante */
  --tinta:        #0E131C;  /* estructura: andamio */
  --azul:         #1F57FF;  /* acento, NUNCA texto sobre noche (2,9:1) */
  --azul-claro:   #5CA1FF;  /* acento de texto y símbolo (6,8:1) */
  --blanco:       #FFFFFF;
  --gris:         #8A94A6;  /* gris editorial de la lámina, tintado al azul (6,1:1) */
  --linea:        rgba(138, 148, 166, .16);  /* el gris al 16% — hairline, DA §7 */

  /* Tipografía — DA §4 */
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Ritmo — DA §6. Escala base 8px. */
  --margen: clamp(24px, 5vw, 64px);

  /* Geometría — DA §2 ref.2 / §10. 44,1° medido en el path del símbolo.
     El gradiente va a 180 − 44 = 136deg para que la raya quede a 44°. */
  --andamio-angulo: 136deg;
  --andamio-paso: 48px;                 /* periodo perpendicular */
  --andamio-recorrido: 69.11px;         /* 48 / sin(44°) → bucle sin costura */
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--margen);
  gap: var(--margen);

  background: var(--noche);
  color: var(--blanco);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;

  position: relative;
  overflow: hidden;
}

/* --- Andamio: hairlines al ángulo del símbolo, a sangre. DA §6, §9.2 ------- */
.andamio {
  position: fixed;
  inset: -240px;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    var(--andamio-angulo),
    transparent 0 calc(var(--andamio-paso) - 1px),
    var(--tinta) calc(var(--andamio-paso) - 1px) var(--andamio-paso)
  );
  animation: deriva 24s linear infinite;
}

@keyframes deriva {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--andamio-recorrido)); }
}

/* --- Cornisa: el encabezado de la lámina 05. DA §2, excepción tic 3 -------- */
.cornisa,
.pie {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;

  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.cornisa-folio { color: var(--azul-claro); font-weight: 500; }
.cornisa-marca,
.pie           { color: var(--gris); }

.pie {
  padding-top: 16px;
  border-top: 1px solid var(--linea);   /* único separador del sitio. DA §7 */
}

/* --- Centro: un solo objeto, con aire arriba y abajo. DA §6 ---------------- */
.centro {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vh, 56px);
  text-align: center;
}

.marca { margin: 0; line-height: 0; }

.marca-svg {
  display: block;
  width: clamp(240px, 40vw, 460px);
  height: auto;
}

.letra    { fill: var(--blanco); }
.zz-fill  { fill: var(--azul-claro); }

.zz-draw,
.zz-scan {
  fill: none;
  stroke-linejoin: miter;
  /* grosor en unidades del viewBox: escala con la marca en vez de quedarse
     fijo en px, para que en móvil no se vea el doble de grueso. */
}

/* Entrada: el contorno se dibuja una sola vez. DA §9.1 */
.zz-draw {
  stroke: var(--azul);
  stroke-width: 1.4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation:
    dibuja 2.2s cubic-bezier(.33, .1, .25, 1) both,
    apaga   .5s linear 2.3s both;
}

/* Reposo: el trazo de obra sigue recorriendo el símbolo. DA §9.1 */
.zz-scan {
  stroke: var(--azul);
  stroke-width: 2.6;
  stroke-dasharray: .1 .9;
  opacity: 0;
  animation:
    recorre 5s linear 2.6s infinite,
    enciende .6s linear 2.6s both;
}

@keyframes dibuja   { to { stroke-dashoffset: 0; } }
@keyframes apaga    { to { opacity: 0; } }
@keyframes enciende { from { opacity: 0; } to { opacity: 1; } }
@keyframes recorre  { to { stroke-dashoffset: -1; } }

/* La marca completa aparece detrás del trazo, no después de él. */
.zz-fill, .letra {
  opacity: 0;
  animation: entra .9s ease-out .15s both;
}
.letra:nth-of-type(2) { animation-delay: .25s; }

@keyframes entra { to { opacity: 1; } }

/* --- Estado. DA §4: énfasis por escala, nunca por color dentro de la frase - */
.estado {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1.25rem, 2.6vw, 1.95rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.25;
  text-wrap: balance;

  opacity: 0;
  animation: entra .9s ease-out 1.1s both;
}

/* --- Accesibilidad -------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .andamio { animation: none; }
  .zz-draw, .zz-scan { display: none; }
  .zz-fill, .letra, .estado { opacity: 1; animation: none; }
}

/* --- Pantallas angostas: la cornisa se apila, el margen baja. DA §6 -------- */
@media (max-width: 560px) {
  .cornisa { flex-direction: column; gap: 8px; }
  .marca-svg { width: min(74vw, 290px); }
  /* 24ch parte la frase justo en su cesura: "…en obra." / "La marca, terminada." */
  .estado { font-size: 1.1rem; max-width: 24ch; }
}
