/* ---------------------------------------------
   Tokens
--------------------------------------------- */
:root {
  --negro: #0d0d0d;
  --crema: #fef6e4;
  --blanco: #ffffff;
  --amarillo: #ffe100;
  --violeta: #7c3aed;
  --rojo: #e5162f;
  --naranja: #ff4d00;
  --azul: #0057ff;
  --verde: #00b86b;
  --borde: 3px;
  --sombra-offset: 9px;
  --fuente-display: "Lexend", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --fuente-texto: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--crema);
  background-image: repeating-linear-gradient(
    40deg,
    rgba(13, 13, 13, 0.03) 0px,
    rgba(13, 13, 13, 0.03) 1px,
    transparent 1px,
    transparent 12px
  );
  font-family: var(--fuente-texto);
  color: var(--negro);
}

/* ---------------------------------------------
   Layout general
--------------------------------------------- */
.pagina {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 24px;
}

/* ---------------------------------------------
   Fila de tarjetas
--------------------------------------------- */
.tarjetas {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px;
  width: 100%;
  max-width: 1040px;
  margin-top: 40px;
}

.tarjetas:first-of-type {
  margin-top: 0;
}

/* ---------------------------------------------
   Tarjeta
--------------------------------------------- */
.tarjeta {
  position: relative;
  flex: 1 1 380px;
  max-width: 460px;
  min-height: 320px;
  display: block;
  text-decoration: none;
  color: var(--negro);
  border: var(--borde) solid var(--negro);
  border-radius: 18px;
  background: var(--crema);
  box-shadow: var(--sombra-offset) var(--sombra-offset) 0 var(--negro);
  transform: translate(0, 0) rotate(0deg);
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.tarjeta--aaaj { --acento: var(--rojo); }
.tarjeta--codercup { --acento: var(--naranja); }
.tarjeta--prode { --acento: var(--azul); }
.tarjeta--hosting { --acento: var(--verde); }

.tarjeta__fondo {
  position: absolute;
  inset: 0;
  background: var(--acento);
  clip-path: polygon(0 62%, 100% 42%, 100% 100%, 0% 100%);
  transition: clip-path 0.35s ease;
}

.tarjeta__contenido {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
}

.tarjeta__etiqueta {
  align-self: flex-start;
  padding: 4px 10px;
  border: 2px solid var(--negro);
  border-radius: 999px;
  background: var(--blanco);
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tarjeta__titulo {
  margin: 24px 0 0;
  font-family: var(--fuente-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
  color: var(--negro);
  -webkit-text-stroke: 1px var(--negro);
}

.tarjeta__flecha {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 3px solid var(--negro);
  border-radius: 50%;
  background: var(--blanco);
  font-size: 1.4rem;
  font-weight: 700;
  transition: transform 0.25s ease;
}

/* Hover / focus: la tarjeta "salta" y la cuña de color se mueve como líquido */
.tarjeta:hover,
.tarjeta:focus-visible {
  transform: translate(-6px, -6px) rotate(-1deg);
  box-shadow: calc(var(--sombra-offset) + 6px) calc(var(--sombra-offset) + 6px) 0 var(--crema);
  border: 6px solid var(--negro);
}

.tarjeta:hover .tarjeta__fondo,
.tarjeta:focus-visible .tarjeta__fondo {
  animation: ola-liquida 6s linear infinite;
}

@keyframes ola-liquida {
  0% {
    clip-path: polygon(0.00% 22.00%, 5.26% 23.05%, 10.53% 23.84%, 15.79% 24.19%, 21.05% 24.01%, 26.32% 23.35%, 31.58% 22.36%, 36.84% 21.29%, 42.11% 20.38%, 47.37% 19.87%, 52.63% 19.87%, 57.89% 20.38%, 63.16% 21.29%, 68.42% 22.36%, 73.68% 23.35%, 78.95% 24.01%, 84.21% 24.19%, 89.47% 23.84%, 94.74% 23.05%, 100.00% 22.00%, 100% 100%, 0% 100%);
  }
  20% {
    clip-path: polygon(0.00% 24.09%, 5.26% 24.16%, 10.53% 23.71%, 15.79% 22.85%, 21.05% 21.78%, 26.32% 20.77%, 31.58% 20.05%, 36.84% 19.80%, 42.11% 20.08%, 47.37% 20.83%, 52.63% 21.85%, 57.89% 22.92%, 63.16% 23.76%, 68.42% 24.18%, 73.68% 24.07%, 78.95% 23.46%, 84.21% 22.50%, 89.47% 21.42%, 94.74% 20.48%, 100.00% 19.91%, 100% 100%, 0% 100%);
  }
  40% {
    clip-path: polygon(0.00% 23.29%, 5.26% 22.29%, 10.53% 21.22%, 15.79% 20.33%, 21.05% 19.85%, 26.32% 19.89%, 31.58% 20.43%, 36.84% 21.35%, 42.11% 22.43%, 47.37% 23.41%, 52.63% 24.04%, 57.89% 24.19%, 63.16% 23.80%, 68.42% 22.98%, 73.68% 21.93%, 78.95% 20.89%, 84.21% 20.12%, 89.47% 19.80%, 94.74% 20.02%, 100.00% 20.71%, 100% 100%, 0% 100%);
  }
  60% {
    clip-path: polygon(0.00% 20.71%, 5.26% 20.02%, 10.53% 19.80%, 15.79% 20.12%, 21.05% 20.89%, 26.32% 21.93%, 31.58% 22.98%, 36.84% 23.80%, 42.11% 24.19%, 47.37% 24.04%, 52.63% 23.41%, 57.89% 22.43%, 63.16% 21.35%, 68.42% 20.43%, 73.68% 19.89%, 78.95% 19.85%, 84.21% 20.33%, 89.47% 21.22%, 94.74% 22.29%, 100.00% 23.29%, 100% 100%, 0% 100%);
  }
  80% {
    clip-path: polygon(0.00% 19.91%, 5.26% 20.48%, 10.53% 21.42%, 15.79% 22.50%, 21.05% 23.46%, 26.32% 24.07%, 31.58% 24.18%, 36.84% 23.76%, 42.11% 22.92%, 47.37% 21.85%, 52.63% 20.83%, 57.89% 20.08%, 63.16% 19.80%, 68.42% 20.05%, 73.68% 20.77%, 78.95% 21.78%, 84.21% 22.85%, 89.47% 23.71%, 94.74% 24.16%, 100.00% 24.09%, 100% 100%, 0% 100%);
  }
  100% {
    clip-path: polygon(0.00% 22.00%, 5.26% 23.05%, 10.53% 23.84%, 15.79% 24.19%, 21.05% 24.01%, 26.32% 23.35%, 31.58% 22.36%, 36.84% 21.29%, 42.11% 20.38%, 47.37% 19.87%, 52.63% 19.87%, 57.89% 20.38%, 63.16% 21.29%, 68.42% 22.36%, 73.68% 23.35%, 78.95% 24.01%, 84.21% 24.19%, 89.47% 23.84%, 94.74% 23.05%, 100.00% 22.00%, 100% 100%, 0% 100%);
  }
}

/*
.tarjeta:hover .tarjeta__fondo,
.tarjeta:focus-visible .tarjeta__fondo {
  clip-path: polygon(0 30%, 100% 15%, 100% 100%, 0% 100%);
}*/

.tarjeta:hover .tarjeta__flecha,
.tarjeta:focus-visible .tarjeta__flecha {
  transform: rotate(45deg);
}

.tarjeta:active {
  transform: translate(2px, 2px) rotate(0deg);
  box-shadow: calc(var(--sombra-offset) - 6px) calc(var(--sombra-offset) - 6px) 0 var(--negro);
}

.tarjeta:focus-visible {
  outline: 3px dashed var(--negro);
  outline-offset: 4px;
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 640px) {
  .tarjetas {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .tarjeta {
    min-height: 200px;
  }
}

/* ---------------------------------------------
   Accesibilidad: respetar reduce-motion
--------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .tarjeta,
  .tarjeta__fondo,
  .tarjeta__flecha {
    transition: none;
  }
}
