/* Yanapaq — hoja de estilos única (la CSP no permite estilos en línea).
   Idea central: el khipu, las cuerdas con nudos con que los incas llevaban sus registros.
   Cada app de Yanapaq es una cuerda que cuelga de la cuerda principal. */

@font-face {
  font-family: "Archivo";
  src: url("/fuentes/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Tintes andinos */
  --piedra: #edebe6;        /* fondo */
  --piedra-2: #e2dfd7;      /* superficie alterna */
  --indigo: #1b1f3b;        /* texto y cuerda principal */
  --indigo-suave: #4a4f6e;  /* texto secundario (AA sobre piedra) */
  --cochinilla: #a3123a;    /* acento principal */
  --cochinilla-oscura: #7d0d2c;
  --qolle: #e8b32a;         /* amarillo, solo decorativo */
  --chilca: #3e6b4a;        /* verde */

  --fuente: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ancho: 1120px;
  --texto: 38rem;
}

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

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--indigo);
  background: var(--piedra);
  overflow-wrap: break-word;
}

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

h1, h2, h3 { margin: 0; line-height: 1.1; font-stretch: 112%; }
h2 { font-size: clamp(1.75rem, 4.5vw, 2.75rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }

a { color: var(--cochinilla); text-underline-offset: 3px; }
a:hover { color: var(--indigo); }

:focus-visible { outline: 3px solid var(--cochinilla); outline-offset: 3px; }

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 1.25rem; }

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--indigo); color: var(--piedra); padding: .5rem 1rem;
}
.saltar:focus { top: 1rem; color: var(--piedra); }

/* Cabecera */
.cabecera .contenedor {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem;
}
.marca {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--indigo); text-decoration: none;
  font-size: 1.5rem; font-weight: 800; font-stretch: 125%; letter-spacing: -0.03em;
}
.marca img { width: 30px; height: 30px; }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.menu a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--indigo); text-decoration: none; font-weight: 600;
}
.menu a:hover { color: var(--cochinilla); }

/* Portada: la palabra es la protagonista */
.portada { padding: clamp(2.5rem, 8vw, 6rem) 0 clamp(3rem, 8vw, 5.5rem); }
.portada h1 {
  /* la palabra mide ~5em: se ajusta al ancho disponible y nunca se parte */
  font-size: min(13.5rem, calc((100vw - 3.5rem) / 5.3));
  white-space: nowrap;
  font-weight: 900; font-stretch: 125%;
  letter-spacing: -0.055em; line-height: .82;
  margin-left: -0.04em;
}
.definicion {
  margin: 1.5rem 0 0;
  font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 600; font-stretch: 100%;
  color: var(--cochinilla);
}
.bajada {
  max-width: 34rem; margin: 1rem 0 2rem;
  font-size: clamp(1.125rem, 2.2vw, 1.375rem); line-height: 1.5;
}
.boton {
  display: inline-flex; align-items: center; min-height: 48px;
  padding: .75rem 1.4rem;
  background: var(--indigo); color: var(--piedra);
  font-weight: 700; text-decoration: none;
}
.boton:hover { background: var(--cochinilla); color: #fff; }
.boton.secundario { background: transparent; color: var(--indigo); box-shadow: inset 0 0 0 2px var(--indigo); }
.boton.secundario:hover { background: var(--indigo); color: var(--piedra); }
.botones { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Secciones */
.seccion { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.seccion.alterna { background: var(--piedra-2); }
.intro { max-width: var(--texto); margin: 1rem 0 0; color: var(--indigo-suave); font-size: 1.125rem; }

.nosotros .contenedor { display: grid; gap: 1.5rem 4rem; }
.nosotros .texto { max-width: var(--texto); }
.nosotros .texto p:first-child { font-size: 1.25rem; line-height: 1.5; }

/* Khipu de productos */
.khipu { list-style: none; margin: 3rem 0 0; padding: 0; position: relative; }
.khipu::before {                       /* cuerda principal, torcida */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px;
  background: repeating-linear-gradient(-60deg, var(--indigo) 0 5px, #3a4070 5px 8px);
  border-radius: 5px;
}
.cuerda { position: relative; padding: 2.75rem 0 1rem 3rem; }
.cuerda::before {                      /* cuerda colgante */
  content: ""; position: absolute; left: 1.25rem; top: 5px; bottom: 0; width: 5px;
  background: repeating-linear-gradient(-30deg, var(--cochinilla) 0 4px, var(--cochinilla-oscura) 4px 7px);
  border-radius: 0 0 3px 3px;
}
.cuerda::after {                       /* tres nudos */
  content: ""; position: absolute; left: calc(1.25rem - 5px); top: 2.25rem;
  width: 15px; height: 11px; border-radius: 5px; background: var(--cochinilla-oscura);
  box-shadow: 0 18px 0 var(--cochinilla-oscura), 0 36px 0 var(--cochinilla-oscura);
}
.cuerda.por-tejer::before {
  width: 0; background: none; border-left: 3px dashed #9a97a8;
}
.cuerda.por-tejer::after { content: none; }
.cuerda.por-tejer { color: var(--indigo-suave); }

.app-nombre { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.app-nombre img { width: 52px; height: 52px; }
.app-tipo { margin: .2rem 0 0; color: var(--chilca); font-weight: 600; font-size: .95rem; }
.cuerda p { max-width: 30rem; }
.cuerda h3 { font-size: 1.5rem; }
.cuerda.por-tejer h3 { margin-bottom: .75rem; }

/* Cómo trabajamos */
.como { margin: 2.5rem 0 0; display: grid; gap: 2rem 3rem; }
.como div { max-width: 30rem; }
.como dt { font-weight: 800; font-stretch: 112%; font-size: 1.2rem; color: var(--cochinilla); }
.como dd { margin: .35rem 0 0; }

/* Contacto */
.contacto .correo {
  display: inline-block; margin-top: 1.5rem;
  font-size: clamp(1.35rem, 5vw, 2.75rem); font-weight: 800; font-stretch: 112%;
  letter-spacing: -0.02em; color: var(--indigo);
  text-decoration-line: underline; text-decoration-color: var(--qolle);
  text-decoration-thickness: .14em; text-underline-offset: .18em;
}
.contacto .correo:hover { color: var(--cochinilla); }

/* Pie con franja de aguayo */
.pie { background: var(--indigo); color: var(--piedra); }
.pie::before {
  content: ""; display: block; height: 18px;
  background: linear-gradient(to bottom,
    var(--cochinilla) 0 5px, var(--qolle) 5px 8px, var(--chilca) 8px 11px,
    var(--piedra) 11px 13px, var(--cochinilla) 13px 18px);
}
.pie .contenedor {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem 2rem; padding-top: 2rem; padding-bottom: 2rem;
}
.pie p { margin: 0; }
.pie ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.pie a { display: inline-flex; align-items: center; min-height: 44px; color: var(--piedra); }
.pie a:hover { color: var(--qolle); }
.pie :focus-visible { outline-color: var(--qolle); }

/* Páginas simples: legales y 404 */
main.simple { max-width: calc(var(--texto) + 2.5rem); margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }
main.simple h1 { font-size: clamp(2.25rem, 7vw, 3.5rem); font-weight: 900; font-stretch: 125%; letter-spacing: -0.04em; margin-bottom: .5rem; }
main.simple h2 { font-size: 1.4rem; margin: 2.25rem 0 .6rem; letter-spacing: -0.01em; }
main.simple ul { padding-left: 1.25rem; }
.actualizacion { color: var(--indigo-suave); }
main.simple .botones { margin-top: 2rem; }

/* Escritorio */
@media (min-width: 760px) {
  .nosotros .contenedor { grid-template-columns: 1fr 1.6fr; align-items: start; }
  .khipu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; }
  .como { grid-template-columns: repeat(2, 1fr); }
}

/* Celular: la cuerda principal pasa a la izquierda y las cuerdas salen hacia la derecha */
@media (max-width: 759px) {
  .khipu { padding-left: 1.75rem; }
  .khipu::before {
    left: 0; right: auto; top: 0; bottom: 0; width: 10px; height: auto;
    background: repeating-linear-gradient(30deg, var(--indigo) 0 5px, #3a4070 5px 8px);
  }
  .cuerda { padding: 0 0 2.5rem 2.25rem; }
  .cuerda::before {
    left: -1.25rem; top: 1.4rem; bottom: auto; width: 3rem; height: 5px;
    background: repeating-linear-gradient(60deg, var(--cochinilla) 0 4px, var(--cochinilla-oscura) 4px 7px);
  }
  .cuerda::after { left: .1rem; top: calc(1.4rem - 3px); width: 11px; height: 11px; box-shadow: 16px 0 0 var(--cochinilla-oscura); }
  .cuerda.por-tejer::before { width: 3rem; height: 0; border-left: 0; border-top: 3px dashed #9a97a8; }
}
