/* IAdev.es · hoja de estilos principal · versión 2026-11-16.6
   ----------------------------------------------------------------------------
   Todo se mide en rem: la interfaz escala sola de móvil a TV/4K (ver html{font-size}).
   Índice:
     1. Base            5. Paneles Webs / Juegos      9. Ficha del proyecto
     2. Fondo           6. Tarjetas y portátil       10. Estados (modo flow, pausa, foco…)
     3. Cabecera        7. Colores por proyecto      11. Adaptación a pantallas
    12. Pantalla de entrada
     4. Estructura      8. Tarjeta de contacto
   ---------------------------------------------------------------------------- */

/* ==========================================================================
   1. BASE
   Variables, reinicio, tipografía y utilidades.
   ========================================================================== */
:root {
  --build: "2026-11-16.6"; /* versión de este archivo: se ve con ?diagnostico=1 */
  --paper: #eef1f6;
  --card: #fff;
  --ink: #14213d;
  --muted: #4d5873;
  --blue: #2d5bff;
  --sun: #ffc857;
  --line: #d5dbe8;
  --bar: #e4e9f2;
  --display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1526;
    --card: #17203a;
    --ink: #eef1f6;
    --muted: #a3aecb;
    --line: #2a3558;
    --blue: #7d9bff;
    --bar: #202b4b;
  }
}
* {
  box-sizing: border-box;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}
/* Escala fluida: todo se mide en rem, así crece en TV y 4K y se mantiene en móvil y tablet */
html {
  font-size: clamp(16px, min(1.2vw, 2.1vh), 64px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  padding: env(safe-area-inset-top, 0rem) env(safe-area-inset-right, 0rem) env(safe-area-inset-bottom, 0rem)
    env(safe-area-inset-left, 0rem);
}
a,
button {
  touch-action: manipulation;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.4;
  height: calc(100dvh - env(safe-area-inset-top, 0rem) - env(safe-area-inset-bottom, 0rem));
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.75rem 0.75rem;
  gap: 0.875rem;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 0.1875rem solid var(--sun);
  outline-offset: 0.1875rem;
}
/* Enlace "saltar al contenido": solo se ve al enfocarlo con el teclado */
.saltar {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 50;
  padding: 0.5rem 1rem;
  border-radius: 0.6rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.saltar:focus {
  top: 0.75rem;
}
/* Textos que cambian según haya JavaScript o no (sin JS se invierten en sin-javascript.css) */
.t-nojs {
  display: none;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}

/* ==========================================================================
   2. FONDO DECORATIVO
   Cuadrícula de puntos, foco que sigue al ratón y manchas de color suaves.
   ========================================================================== */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    22.5rem circle at var(--mx, 75%) var(--my, 25%),
    color-mix(in srgb, var(--blue) 13%, transparent),
    transparent 70%
  );
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    color-mix(in srgb, var(--ink) 18%, transparent) 0.0625rem,
    transparent 0.0875rem
  );
  background-size: 1.5rem 1.5rem;
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 25%, transparent 85%);
  mask-image: radial-gradient(ellipse at 50% 45%, #000 25%, transparent 85%);
}
body > header,
main,
footer {
  position: relative;
  z-index: 1;
}
.bg b {
  position: absolute;
  border-radius: 50%;
  filter: blur(4.375rem);
}
.bg .b1 {
  width: 33.75rem;
  height: 27.5rem;
  left: -8.75rem;
  top: -10rem;
  background: color-mix(in srgb, var(--blue) 34%, transparent);
  animation: blob1 24s ease-in-out infinite alternate;
}
.bg .b2 {
  width: 30rem;
  height: 25rem;
  right: -8.75rem;
  bottom: -10rem;
  background: color-mix(in srgb, var(--sun) 44%, transparent);
  animation: blob2 28s ease-in-out infinite alternate;
}
.bg .b3 {
  width: 26.25rem;
  height: 21.25rem;
  left: 38%;
  top: -12.5rem;
  background: rgba(123, 44, 191, 0.2);
  animation: blob3 32s ease-in-out infinite alternate;
}
@keyframes blob1 {
  to {
    transform: translate(11.25rem, 6.875rem) scale(1.15);
  }
}
@keyframes blob2 {
  to {
    transform: translate(-12.5rem, -5rem) scale(1.2);
  }
}
@keyframes blob3 {
  to {
    transform: translate(-10rem, 3.75rem) scale(0.9);
  }
}

/* ==========================================================================
   3. CABECERA
   Logotipo animado, marca, lema, estado y controles.
   ========================================================================== */
.brand-titulo {
  font: inherit;
  margin: 0;
}
body > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex: none;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.logo {
  flex: none;
  overflow: visible;
  width: 3.25rem;
  height: 3.25rem;
}
.titulo .ico svg,
.contact svg {
  width: 1.125rem;
  height: 1.125rem;
}
.logo .tile {
  transform-box: fill-box;
  transform-origin: center;
  animation: tile 0.8s cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
}
.logo .shine {
  animation: shine 9s 3.5s ease-in-out 3;
}
.logo .br {
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1;
  animation: draw 0.7s 0.35s cubic-bezier(0.6, 0, 0.2, 1) forwards;
}
.logo .br.r {
  animation-delay: 0.5s;
}
.logo .ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1.3;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1;
  animation: draw 1s 1s ease-out forwards;
}
.logo .spark {
  fill: #ffc857;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  animation:
    pop 0.6s 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    twinkle 7s 3.5s ease-in-out 3;
}
.logo .orbit {
  transform-origin: 32px 32px; /* centro del dibujo (viewBox 64×64); en rem se descolocaba en pantallas grandes */
  opacity: 0;
  animation:
    orb 5s linear 1.9s 6,
    show 0.3s 1.9s forwards;
}
.brand:hover .orbit {
  animation-duration: 1.4s, 0.3s;
}
.brand:hover .spark {
  animation: spin 0.8s ease-in-out;
}
.wm {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
}
.wm b {
  display: inline-block;
  font-weight: inherit;
  opacity: 0;
  transform: translateY(0.45em);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(0.8s + var(--i) * 0.07s);
}
.wm .v {
  color: var(--blue);
}
.wm .s {
  color: var(--muted);
  font-weight: 500;
}
.caret {
  display: inline-block;
  width: 0.1em;
  height: 0.78em;
  margin-left: 0.14em;
  background: var(--sun);
  opacity: 0;
  animation: blink 1.1s steps(1) 1.7s 10;
}
@keyframes tile {
  from {
    transform: scale(0.4) rotate(-12deg);
    opacity: 0;
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes pop {
  from {
    transform: scale(0) rotate(-90deg);
  }
  to {
    transform: scale(1) rotate(0);
  }
}
@keyframes twinkle {
  0%,
  88%,
  100% {
    opacity: 1;
  }
  94% {
    opacity: 0.4;
  }
}
@keyframes spin {
  from {
    transform: scale(1) rotate(0);
  }
  50% {
    transform: scale(1.35) rotate(180deg);
  }
  to {
    transform: scale(1) rotate(360deg);
  }
}
@keyframes orb {
  to {
    transform: rotate(360deg);
  }
}
@keyframes show {
  to {
    opacity: 1;
  }
}
@keyframes shine {
  0% {
    transform: translateX(0);
  }
  14%,
  100% {
    transform: translateX(9.375rem);
  }
}
@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .logo *,
  .wm b,
  .caret {
    animation: none !important;
  }
  .logo .br,
  .logo .ring {
    stroke-dashoffset: 0;
  }
  .logo .spark {
    transform: none;
  }
  .logo .orbit,
  .wm b,
  .caret {
    opacity: 1;
    transform: none;
  }
  .logo .shine {
    display: none;
  }
}
/* Retardo escalonado de las letras del nombre (sin estilos en línea en el HTML) */
.wm b:nth-of-type(1) {
  --i: 0;
}
.wm b:nth-of-type(2) {
  --i: 1;
}
.wm b:nth-of-type(3) {
  --i: 2;
}
.wm b:nth-of-type(4) {
  --i: 3;
}
.wm b:nth-of-type(5) {
  --i: 4;
}
.wm b:nth-of-type(6) {
  --i: 5;
}
.wm b:nth-of-type(7) {
  --i: 6;
}
.wm b:nth-of-type(8) {
  --i: 7;
}
.tagline {
  flex: 1;
  min-width: 15rem;
  color: var(--muted);
  border-left: 0.25rem solid var(--sun);
  padding-left: 0.875rem;
}
.side {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.375rem 0.875rem;
  border-radius: 62.4375rem;
  border: 0.0625rem solid var(--line);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  white-space: nowrap;
}
.status i {
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #2fbf71;
}
.status i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #2fbf71;
  animation: ping 2.2s infinite;
}
@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70%,
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}
.contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  border: 0.125rem solid var(--ink);
  padding: 0.4375rem 1.125rem;
  border-radius: 62.4375rem;
  white-space: nowrap;
  transition:
    background 0.2s,
    color 0.2s;
}
.contact:hover {
  background: var(--ink);
  color: var(--paper);
}
/* Botones de la cabecera: pausa de animaciones y pantalla completa */
.pausa {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 0.125rem solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  flex: none;
  transition:
    background 0.2s,
    color 0.2s;
}
.pausa:hover {
  background: var(--ink);
  color: var(--paper);
}
.pausa .i-play,
.paused .pausa .i-pause {
  display: none;
}
.fs .i-comp,
.isfs .fs .i-exp {
  display: none;
}
.isfs .fs .i-comp {
  display: block;
}
.paused .pausa .i-play {
  display: block;
}

/* ==========================================================================
   4. ESTRUCTURA
   Rejilla principal, títulos de panel, rejillas de tarjetas y pie.
   ========================================================================== */
main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 4.4fr) minmax(0, 1.7fr);
  gap: 0.875rem;
}
section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.titulo {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.375rem;
  margin-bottom: 0.625rem;
  border-bottom: 0.1875rem solid var(--blue);
  flex: none;
}
.games .titulo {
  border-color: var(--sun);
}
.titulo small {
  font: 500 0.9rem var(--body);
  color: var(--muted);
  letter-spacing: 0;
}
.titulo .ico {
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 0.5625rem;
  display: grid;
  place-items: center;
  align-self: center;
  background: var(--blue);
  color: #fff;
  flex: none;
}
.games .titulo .ico {
  background: var(--sun);
  color: #14213d;
}
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 0.875rem;
  justify-content: center;
  align-content: center;
}
.webs .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
}
.games .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}
footer {
  flex: none;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   5. PANELES WEBS / JUEGOS
   Cada panel tiene su propio ambiente: cuadrícula azul (webs) y cielo de estrellas (juegos).
   ========================================================================== */
section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 1.375rem;
  padding: 0.875rem 1.125rem 1.125rem;
}
section > *:not(.fx) {
  position: relative;
  z-index: 1;
}
.fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.fx i {
  position: absolute;
  left: var(--x);
  bottom: -2.5rem;
  font: 800 var(--s, 1.6rem) var(--display);
  font-style: normal;
  opacity: 0;
  animation: up var(--t, 26s) linear var(--d, 0s) infinite;
}
@keyframes up {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 0;
  }
  10%,
  90% {
    opacity: 0.55;
  }
  100% {
    transform: translateY(-47.5rem) rotate(200deg);
    opacity: 0;
  }
}
.webs {
  background: color-mix(in srgb, var(--blue) 6%, var(--card));
  border: 0.0625rem solid var(--line);
}
.webs::before {
  content: "";
  position: absolute;
  inset: -2.25rem 0 0 -2.25rem;
  z-index: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--blue) 12%, transparent) 0.0625rem, transparent 0.0625rem),
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 12%, transparent) 0.0625rem, transparent 0.0625rem);
  background-size: 2.25rem 2.25rem;
  animation: gridmove 24s linear infinite;
  -webkit-mask-image: linear-gradient(#000, transparent 88%);
  mask-image: linear-gradient(#000, transparent 88%);
}
@keyframes gridmove {
  to {
    transform: translate(2.25rem, 2.25rem);
  }
}
.webs::after {
  content: "";
  position: absolute;
  right: -5rem;
  top: -5rem;
  width: 18.75rem;
  height: 18.75rem;
  border-radius: 50%;
  z-index: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--blue) 22%, transparent), transparent 70%);
  animation: glow 9s ease-in-out infinite alternate;
}
.webs .fx i {
  color: color-mix(in srgb, var(--blue) 42%, transparent);
}
.games {
  background: linear-gradient(160deg, #2b1d63, #150f3a);
  border: 0.0625rem solid #3d2f8a;
  color: #fff;
}
.games::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(#fff 0.0625rem, transparent 0.0875rem),
    radial-gradient(#ffc857 0.0625rem, transparent 0.0875rem),
    radial-gradient(#8fd8ff 0.075rem, transparent 0.1rem);
  background-size:
    6.0625rem 6.0625rem,
    9.4375rem 9.4375rem,
    13.1875rem 13.1875rem;
  background-position:
    0 0,
    2.5rem 3.75rem,
    5.625rem 1.25rem;
  opacity: 0.5;
  animation: stars 5s ease-in-out infinite alternate;
}
.games::after {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -35%;
  height: 60%;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(255, 92, 200, 0.38), transparent 65%);
  animation: glow 7s ease-in-out infinite alternate;
}
.games .titulo {
  color: #fff;
}
.games .titulo small {
  color: #bdb5ee;
}
.games .fx i:nth-child(4n + 1) {
  color: #ff7eb6;
}
.games .fx i:nth-child(4n + 2) {
  color: #5fe3ff;
}
.games .fx i:nth-child(4n + 3) {
  color: #ffc857;
}
.games .fx i:nth-child(4n) {
  color: #7dff9b;
}
@keyframes stars {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 0.7;
  }
}
@keyframes glow {
  to {
    transform: translateY(-1.25rem) scale(1.12);
    opacity: 0.7;
  }
}

/* ==========================================================================
   6. TARJETAS Y PORTÁTIL
   Cada proyecto es un <article class="card lap"> cuyo contenido completo (ficha) está en el HTML;
   el JavaScript añade el portátil con las capturas y abre la ficha en un diálogo.
   ========================================================================== */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 0.0625rem solid var(--line);
  border-radius: 0.875rem;
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.card:hover {
  transform: translateY(-0.1875rem);
  border-color: var(--blue);
}
.games .card:hover {
  border-color: var(--sun);
}
.shot {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 82%, #fff), var(--c1) 48%, color-mix(in srgb, var(--c1) 72%, #000));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.shot b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 3.4rem;
  color: rgba(255, 255, 255, 0.92);
}
.shot img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.8s;
}
.shot img.on {
  opacity: 1;
}
.shot.has b {
  display: none;
}
.dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 0.3125rem;
  pointer-events: none;
}
.dots:has(i:only-child) {
  display: none;
}
.dots i {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 0.0625rem rgba(0, 0, 0, 0.3);
  transition:
    background 0.3s,
    transform 0.3s;
}
.dots i.on {
  background: #fff;
  transform: scale(1.35);
}
.go {
  position: absolute;
  right: 0.625rem;
  bottom: 0.625rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 62.4375rem;
  opacity: 0;
  transform: translateY(0.25rem);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.card:hover .go,
.card:has(:focus-visible) .go {
  opacity: 1;
  transform: none;
}
.info {
  padding: 0.5625rem 0.8125rem 0.6875rem;
  flex: none;
}
.card:not(.cta) {
  container-type: inline-size;
}
.games .card {
  color: var(--ink);
}
.info h3 {
  font-family: var(--display);
  font-size: min(1.05rem, 6.6cqw);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info p {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Pantallas normales: el nombre puede ocupar dos líneas y se ve entero (altura fija para todas las tarjetas) */
@media (min-width: 601px) and (min-height: 701px) {
  .info h3 {
    font-size: min(1.15rem, 8.4cqw);
    line-height: 1.15;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.3em;
  }
}
.card {
  --c1: var(--blue);
  box-shadow: 0 0.625rem 1.5rem -1rem rgba(20, 33, 61, 0.45);
  animation: in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(var(--n, 0) * 70ms + 400ms);
}
.card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 1.25rem 2.25rem -1rem var(--c1);
}
@keyframes in {
  from {
    opacity: 0;
    transform: translateY(0.875rem) scale(0.97);
  }
}
/* Tarjetas de la pantalla principal: cada web se ve en la pantalla de un portátil, siempre de frente
   (sin giro ni perspectiva: la base solo sobresale un poco de la tapa y las filas del teclado son rectas) */
.card.lap {
  background: none;
  border: 0;
  box-shadow: none;
  overflow: visible;
  border-radius: 0.9rem;
}
.card.lap:hover:not(:has(:focus-visible)) {
  box-shadow: none;
}
.laptop {
  position: relative;
  flex: none;
  isolation: isolate; /* la sombra del suelo (z-index:-1) queda detrás del portátil pero delante del fondo */
}
/* Efecto al pasar el ratón o enfocar con el teclado: la tarjeta crece y las demás se reducen un poco,
   así nunca se pisan (el hueco que gana una lo ceden las otras). Solo transform: no recoloca nada. */
.card.lap {
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (hover: hover) {
  .card.lap:hover,
  .card.lap:has(:focus-visible) {
    transform: scale(1.1);
    z-index: 3;
  }
  .grid:has(.lap:hover) .card:not(:hover),
  .grid:has(.lap :focus-visible) .card:not(:has(:focus-visible)) {
    transform: scale(0.93);
  }
}
.laptop::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: -0.6rem;
  height: 1.1rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(14, 22, 48, 0.55), transparent 68%);
}
/* Tapa: bisel negro de pantalla con canto de aluminio (los anillos son sombras, no ocupan sitio) */
.lid {
  position: relative;
  margin: 0 0.5rem;
  padding: 0.6rem 0.4rem 0.4rem;
  border-radius: 0.75rem 0.75rem 0.2rem 0.2rem;
  background: linear-gradient(165deg, #1f2433, #07090f 72%);
  box-shadow:
    0 0 0 0.07rem #b4bacb,
    0 0 0 0.12rem #6c7487,
    inset 0 0.06rem 0 rgba(255, 255, 255, 0.16),
    0 0.5rem 1.1rem -0.35rem rgba(14, 22, 48, 0.55);
}
/* Bisagra: pieza oscura entre la tapa y el teclado */
.lid::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: -0.17rem;
  height: 0.2rem;
  z-index: 1;
  border-radius: 0 0 0.45rem 0.45rem;
  background: linear-gradient(#566074, #1a1e29);
}
.cam {
  position: absolute;
  left: 50%;
  top: 0.22rem;
  width: 0.3rem;
  height: 0.3rem;
  margin-left: -0.15rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #7f93d6, #141a2d 62%);
  box-shadow: 0 0 0 0.05rem #353d5a;
}
.lid .shot {
  border-radius: 0.2rem;
  box-shadow:
    0 0 0 0.04rem #000,
    0 0 1.5rem -0.3rem color-mix(in srgb, var(--c1) 65%, transparent);
  transition: box-shadow 0.35s;
}
.lap:hover .lid .shot,
.lap:has(:focus-visible) .lid .shot {
  box-shadow:
    0 0 0 0.04rem #000,
    0 0 2.2rem -0.1rem color-mix(in srgb, var(--c1) 85%, transparent);
}
.lid .shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07) 26%, transparent 44%),
    linear-gradient(rgba(0, 0, 0, 0.18), transparent 14%);
}
/* Teclado: se ven las 4 filas superiores (función, números, QWERTY y mayúsculas), dibujadas en
   assets/img/teclado.svg, sobre la cubierta de aluminio y con sombra hacia la bisagra */
.keys {
  height: 0.95rem;
  clip-path: polygon(0.5rem 0, calc(100% - 0.5rem) 0, 100% 100%, 0 100%);
  background:
    linear-gradient(rgba(0, 0, 0, 0.32), transparent 50%),
    url("../img/teclado.svg") center / 100% 100% no-repeat,
    linear-gradient(#e6e9f1, #c3c9d7);
}
.lip {
  position: relative;
  height: 0.36rem;
  border-radius: 0 0 1rem 1rem / 0 0 0.5rem 0.5rem;
  background: linear-gradient(#f6f8fc, #c7ccd9 55%, #9aa1b4);
  box-shadow: inset 0 -0.05rem 0 rgba(0, 0, 0, 0.12);
}
.lip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 22%;
  height: 0.2rem;
  margin-left: -11%;
  background: linear-gradient(#7d8499, #a9b0c2);
  border-radius: 0 0 0.45rem 0.45rem;
}
.lap .info {
  text-align: center;
  padding: 0.5rem 0.25rem 0;
}
@media (min-width: 601px) and (min-height: 701px) {
  .lap .info h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 2.3em;
    overflow: hidden;
  }
}
.games .card.lap {
  color: #fff;
}
.games .lap .info p {
  color: #bdb5ee;
}
/* Enlace principal de la tarjeta: ocupa toda la tarjeta (enlace extendido) para que todo el portátil sea clicable */
.info h3 a {
  color: inherit;
  text-decoration: none;
}
.info h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
.info h3 a:focus-visible {
  outline: none;
}
/* El texto completo de la ficha vive en el HTML pero solo se muestra en el diálogo (o sin JavaScript) */
.detalle {
  display: none;
}
.cta-estatica {
  display: none;
}

/* ==========================================================================
   7. COLORES POR PROYECTO
   Un solo sitio para el color de cada web; el resto del código lo hereda con var(--c1).
   ========================================================================== */
[data-slug="learntoref"] {
  --c1: #2d5bff;
}
[data-slug="aula"] {
  --c1: #0f8b8d;
}
[data-slug="mapa"] {
  --c1: #d1495b;
}
[data-slug="vduf"] {
  --c1: #0e3b26;
}
[data-slug="portabilidades"] {
  --c1: #e07a1f;
}
[data-slug="tdt2"] {
  --c1: #1d3557;
}
[data-slug="vsuf"] {
  --c1: #3a7d44;
}
[data-slug="teleconsolas"] {
  --c1: #7b2cbf;
}
[data-slug="elchano"] {
  --c1: #c1121f;
}
[data-slug="tarjetazo"] {
  --c1: #0077b6;
}
/* Entrada escalonada de las tarjetas */
.webs .card:nth-child(1) {
  --n: 0;
}
.webs .card:nth-child(2) {
  --n: 1;
}
.webs .card:nth-child(3) {
  --n: 2;
}
.webs .card:nth-child(4) {
  --n: 3;
}
.webs .card:nth-child(5) {
  --n: 4;
}
.webs .card:nth-child(6) {
  --n: 5;
}
.webs .card:nth-child(7) {
  --n: 6;
}
.webs .card:nth-child(8) {
  --n: 7;
}
.games .card:nth-child(1) {
  --n: 8;
}
.games .card:nth-child(2) {
  --n: 9;
}
.games .card:nth-child(3) {
  --n: 10;
}

/* ==========================================================================
   8. TARJETA DE CONTACTO
   Tarjeta que gira: "¿Tienes un proyecto?" → "Hablemos".
   ========================================================================== */
.cta {
  perspective: 56.25rem;
  background-color: var(--blue);
  border-color: var(--blue);
  color: #fff;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.075rem, transparent 0.1rem);
  background-size: 0.875rem 0.875rem;
  transition:
    transform 0.2s,
    border-color 0.5s,
    box-shadow 0.2s;
}
.cta.on {
  border-color: var(--sun);
}
.cta .inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.cta.on .inner {
  transform: rotateY(180deg);
}
.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.125rem;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  text-align: left;
}
.front {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  width: 100%;
}
.front::after {
  content: "✦";
  position: absolute;
  right: 0.75rem;
  top: 0.25rem;
  font-size: 3.2rem;
  color: rgba(255, 255, 255, 0.2);
}
.front strong,
.hablemos strong {
  font-family: var(--display);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.front strong {
  font-size: 1.4rem;
}
.front span {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.9;
}
.front em {
  position: absolute;
  right: 0.875rem;
  bottom: 0.625rem;
  font-style: normal;
  font-size: 1.4rem;
  opacity: 0.85;
}
.back {
  transform: rotateY(180deg);
  background: var(--sun);
  color: #14213d;
  padding: 0;
}
.hablemos {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.75rem;
  text-decoration: none;
  text-align: center;
}
.hablemos strong {
  font-size: clamp(1.4rem, 2.6vw, 2.3rem);
}
.hablemos span {
  font-size: 0.8rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.hablemos:hover span {
  text-decoration: underline;
}
.volver {
  position: absolute;
  right: 0.5rem;
  top: 0.375rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 0;
  background: rgba(20, 33, 61, 0.14);
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.volver:hover {
  background: rgba(20, 33, 61, 0.25);
}

/* ==========================================================================
   9. FICHA DEL PROYECTO
   Diálogo nativo <dialog>. En escritorio se escala para verse entera sin scroll (ver fitFicha en main.js).
   ========================================================================== */
dialog.ficha {
  --c1: var(--blue);
  padding: 0;
  border: 0;
  background: var(--card);
  color: var(--ink);
  font-family: var(--body);
  width: min(72rem, 94vw);
  height: min(94dvh, 64rem);
  max-width: none;
  max-height: none;
  border-radius: 1.4rem;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 2rem 6rem rgba(5, 8, 25, 0.55);
}
dialog.ficha::backdrop {
  background: rgba(8, 12, 28, 0.62);
  -webkit-backdrop-filter: blur(0.35rem);
  backdrop-filter: blur(0.35rem);
}
dialog.ficha[open] {
  animation: fin 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
dialog.ficha[open]::backdrop {
  animation: fade 0.3s;
}
@keyframes fin {
  from {
    opacity: 0;
    transform: translateY(1.5rem) scale(0.98);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.fbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  -webkit-backdrop-filter: blur(0.7rem);
  backdrop-filter: blur(0.7rem);
  border-top: 0.3rem solid var(--c1);
  border-bottom: 1px solid var(--line);
}
.ftit {
  flex: 1;
  min-width: 0;
}
.ftn {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fhost {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.abrir {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--c1) 35%, transparent);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.abrir:hover {
  transform: translateY(-0.1rem);
  box-shadow: 0 0 0 0.3rem color-mix(in srgb, var(--c1) 55%, transparent);
}
.fcerrar {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 0.125rem solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.fcerrar:hover {
  background: var(--bar);
}
.fbody {
  padding: 1.5rem 1.6rem 1.8rem;
  display: grid;
  gap: 2rem;
}
.ftopg {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.8rem;
  align-items: start;
}
.fframe {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 1rem 2rem -1.2rem rgba(20, 33, 61, 0.5);
}
.gbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.7rem;
  padding: 0 0.8rem;
  background: var(--bar);
  font-size: 0.75rem;
  color: var(--muted);
}
.gbar i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: none;
}
.gbar i:nth-child(1) {
  background: #ff6b6b;
}
.gbar i:nth-child(2) {
  background: #ffc857;
}
.gbar i:nth-child(3) {
  background: #4cc38a;
}
.gbar span {
  margin-left: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fscreen {
  aspect-ratio: 16/9;
  max-height: 60dvh;
  overflow: auto;
  background: var(--bar);
  overscroll-behavior: contain;
}
.fscreen img {
  display: block;
  width: 100%;
  height: auto;
}
.fph {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font: 800 4rem var(--display);
}
.fthumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.fthumbs button {
  padding: 0;
  border: 0.125rem solid var(--line);
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.fthumbs button[aria-pressed="true"] {
  border-color: var(--c1);
  box-shadow: 0 0 0 0.1rem var(--c1);
}
.fthumbs img {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: top;
}
.fthumbs span {
  display: block;
  font-size: 0.72rem;
  padding: 0.25rem 0.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fmeta {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}
.ftag {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c1) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c1) 40%, transparent);
}
.fcount {
  font-size: 0.8rem;
  color: var(--muted);
}
.fresumen {
  margin-top: 1rem;
  font-size: 1.08rem;
  line-height: 1.65;
}
.fdatos {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1rem;
  font-size: 0.92rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--c1) 5%, var(--card));
}
.fdatos dt {
  color: var(--muted);
}
.fdatos dd {
  font-weight: 600;
}
.fh {
  font-family: var(--display);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.fcard {
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--card);
}
.fcard b {
  display: block;
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1;
  color: color-mix(in srgb, var(--c1) 45%, transparent);
}
.fcard strong {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--display);
  font-size: 1.08rem;
}
.fcard p {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
}
.fcols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.fcols.uno {
  grid-template-columns: 1fr;
}
.fcols p {
  line-height: 1.65;
}
.fsec {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.fsec a,
.fsec span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  text-decoration: none;
  font-weight: 600;
}
.fsec a:hover {
  border-color: var(--c1);
  background: color-mix(in srgb, var(--c1) 8%, transparent);
}
.fsec span {
  color: var(--muted);
  font-weight: 500;
}
.fcta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.3rem 1.5rem;
  border-radius: 1rem;
  color: #fff;
  background-color: var(--blue);
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.2px, transparent 1.6px);
  background-size: 0.875rem 0.875rem;
}
.fcta strong {
  display: block;
  font-family: var(--display);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.fcta p {
  opacity: 0.9;
  font-size: 0.95rem;
}
.fcta a {
  background: var(--sun);
  color: #14213d;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.fnav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.fnav button {
  flex: 1;
  max-width: 20rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.fnav button:last-child {
  text-align: right;
}
.fnav button:hover {
  border-color: var(--c1);
}
.fnav small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
@media (max-width: 860px) {
  .ftopg,
  .fcols {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px), (max-height: 520px) {
  dialog.ficha {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .fbar {
    padding: 0.6rem 0.9rem;
    gap: 0.6rem;
  }
  .ftn {
    font-size: 1.1rem;
  }
  .abrir {
    padding: 0.5rem 0.9rem;
  }
  .fbody {
    padding: 1rem;
    gap: 1.5rem;
  }
}

/* Escritorio: la ficha ocupa la pantalla y se escala para verse entera, sin scroll */
@media (min-width: 900px) and (min-height: 560px) and (min-aspect-ratio: 5/4) {
  dialog.ficha {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    overflow: hidden;
  }
  dialog.ficha[open] {
    display: flex;
    flex-direction: column;
  }
  .fbar {
    flex: none;
  }
  .fbody {
    flex: none;
    transform-origin: 0 0;
    padding: 1rem 1.6rem 1.2rem;
    gap: 1rem 1.8rem;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-content: start;
  }
  .ftopg {
    display: contents;
  }
  #fgal {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
  }
  .finfo {
    grid-column: 2;
    grid-row: 1;
  }
  .fbody > .fcols {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  .fpuntos {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .fbody > .fcta {
    grid-column: 1;
    grid-row: 4;
    padding: 0.9rem 1.3rem;
  }
  .fbody > .fnav {
    grid-column: 2;
    grid-row: 4;
    align-items: stretch;
  }
  .fnav button {
    max-width: none;
  }
  .fscreen {
    max-height: none;
  }
  .fresumen {
    margin-top: 0.6rem;
    font-size: 1rem;
    line-height: 1.55;
  }
  .fdatos {
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
  }
  .fh {
    margin-bottom: 0.6rem;
  }
  .fgrid {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.7rem;
  }
  .fcard {
    padding: 0.8rem 1rem 0.9rem;
  }
  .fsec {
    grid-template-columns: 1fr 1fr;
  }
  .fsec a,
  .fsec span {
    padding: 0.5rem 0.8rem;
  }
  .fcols p {
    line-height: 1.5;
  }
}
.fcerrar:focus-visible,
.abrir:focus-visible {
  outline-offset: 0.15rem;
}

/* ==========================================================================
   SÍMBOLOS FLOTANTES
   Posición, tamaño y velocidad de cada símbolo decorativo de los paneles.
   ========================================================================== */
.webs .fx i:nth-child(1) {
  --x: 8%;
  --s: 1.5rem;
  --t: 26s;
  --d: -2s;
}
.webs .fx i:nth-child(2) {
  --x: 24%;
  --s: 1.2rem;
  --t: 32s;
  --d: -14s;
}
.webs .fx i:nth-child(3) {
  --x: 41%;
  --s: 1.6rem;
  --t: 28s;
  --d: -7s;
}
.webs .fx i:nth-child(4) {
  --x: 58%;
  --s: 1.3rem;
  --t: 35s;
  --d: -20s;
}
.webs .fx i:nth-child(5) {
  --x: 73%;
  --s: 1.5rem;
  --t: 30s;
  --d: -11s;
}
.webs .fx i:nth-child(6) {
  --x: 90%;
  --s: 1.2rem;
  --t: 27s;
  --d: -24s;
}
.games .fx i:nth-child(1) {
  --x: 10%;
  --s: 1.7rem;
  --t: 24s;
  --d: -3s;
}
.games .fx i:nth-child(2) {
  --x: 30%;
  --s: 1.5rem;
  --t: 30s;
  --d: -15s;
}
.games .fx i:nth-child(3) {
  --x: 52%;
  --s: 1.7rem;
  --t: 26s;
  --d: -8s;
}
.games .fx i:nth-child(4) {
  --x: 72%;
  --s: 1.5rem;
  --t: 33s;
  --d: -19s;
}
.games .fx i:nth-child(5) {
  --x: 88%;
  --s: 1.3rem;
  --t: 28s;
  --d: -11s;
}
.games .fx i:nth-child(6) {
  --x: 42%;
  --s: 1.2rem;
  --t: 36s;
  --d: -26s;
}

/* Estado de las webs (lo escribe herramientas/vigilante.py en datos/estado.json) */
.card[data-estado="caida"] .lid .shot {
  filter: grayscale(1) brightness(0.72);
}
.card[data-estado="caida"] .lid .shot::before {
  content: "Sin respuesta";
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 3;
  padding: 0.12rem 0.55rem;
  border-radius: 2rem;
  font: 600 0.68rem/1.4 var(--body, sans-serif);
  color: #fff;
  background: #b3261e;
}
.fverif {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}
.fverif .pto {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.38rem;
  border-radius: 50%;
  background: #2fbf71;
}
.fverif.caida {
  padding: 0.55rem 0.8rem;
  border-radius: 0.7rem;
  color: color-mix(in srgb, #b3261e 80%, var(--ink));
  background: color-mix(in srgb, #b3261e 10%, var(--card));
}

/* ==========================================================================
   10. ESTADOS
   Modo mini y modo flow (los activa fit()), foco, equipos modestos, pausa y movimiento reducido.
   ========================================================================== */
/* Modo mini: sin descripción cuando hay poco sitio (lo decide fit()) */
.grid.mini .info p {
  display: none;
}
/* Modo "flow": si en una sola pantalla los portátiles saldrían demasiado pequeños, la página se ordena en
   columnas automáticas y se desplaza en vertical. Lo activa fit() solo cuando hace falta. */
.flow body {
  height: auto;
  min-height: calc(100dvh - env(safe-area-inset-top, 0rem) - env(safe-area-inset-bottom, 0rem));
  overflow: visible;
  overscroll-behavior: auto;
}
.flow main {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
  grid-auto-rows: auto;
  gap: 1rem;
}
.flow section {
  overflow: hidden;
}
.flow .webs .grid,
.flow .games .grid {
  flex: none;
  grid-template-columns: repeat(auto-fill, minmax(min(clamp(8.25rem, 20vw, 14rem), 100%), 1fr));
  grid-template-rows: none;
  grid-auto-rows: auto;
  justify-content: stretch;
  align-content: start;
  gap: 1.1rem 0.875rem;
}
.flow .card.lap {
  min-height: auto;
}
.flow .cta {
  min-height: 9rem;
}
.flow footer {
  display: flex;
}
.flow .lap .info h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  min-height: 0;
  max-height: none;
  font-size: min(1.05rem, 9.5cqw);
  line-height: 1.15;
}
@container (max-width:13rem) {
  .flow .info p {
    display: none;
  }
}
/* Mando a distancia y teclado: foco muy visible */
.card:has(:focus-visible) {
  outline: none;
  transform: translateY(-0.25rem) scale(1.03);
  box-shadow:
    0 0 0 0.2rem var(--sun),
    0 1.2rem 2rem -1rem var(--c1);
}
/* Equipos modestos (algunas TV y móviles antiguos): se quitan los efectos más pesados */
.lite .fx,
.lite .bg b,
.lite .bg::before {
  display: none;
}
.lite .webs::before,
.lite .webs::after,
.lite .games::before,
.lite .games::after {
  animation: none;
}
.lite .logo .shine {
  display: none;
}
.paused .logo *,
.paused .wm b,
.paused .caret {
  animation: none !important;
}
.paused .logo .br,
.paused .logo .ring {
  stroke-dashoffset: 0;
}
.paused .logo .spark {
  transform: none;
}
.paused .logo .orbit,
.paused .wm b,
.paused .caret {
  opacity: 1;
  transform: none;
}
.paused .logo .shine {
  display: none;
}
.paused dialog.ficha[open],
.paused dialog.ficha[open]::backdrop,
.paused .card,
.paused .status i::after,
.paused .bg b,
.paused .fx i,
.paused .webs::before,
.paused .webs::after,
.paused .games::before,
.paused .games::after {
  animation: none;
}
/* Pantallas táctiles: que no se quede el efecto "hover" pegado tras tocar */
@media (hover: none) {
  .card:hover {
    transform: none;
    border-color: var(--line);
    box-shadow: 0 0.625rem 1.5rem -1rem rgba(20, 33, 61, 0.45);
  }
  .games .card:hover {
    border-color: #3d2f8a;
  }
  .card:hover .go {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog.ficha[open],
  dialog.ficha[open]::backdrop {
    animation: none;
  }
  * {
    transition: none !important;
  }
  .cta .inner {
    transition: none;
  }
  .card,
  .status i::after,
  .bg b,
  .fx i,
  .webs::before,
  .webs::after,
  .games::before,
  .games::after {
    animation: none;
  }
}

/* ==========================================================================
   11. ADAPTACIÓN A PANTALLAS
   De mayor a menor: panorámico, compacto, móvil horizontal, TV y táctil.
   ========================================================================== */
/* Pantalla ancha: dos columnas. Siempre cabe todo sin desplazar */
@media (min-width: 560px) and (min-aspect-ratio: 5/4) {
  main {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 2.75rem;
  }
  .titulo {
    font-size: 1.7rem;
  }
}
/* Adaptable: cabecera más ligera en anchos medios */
@media (max-width: 1180px) {
  .tagline {
    display: none;
  }
}
@media (max-width: 900px) {
  .status {
    display: none;
  }
}
@media (max-width: 340px) {
  body > header {
    gap: 0.5rem;
  }
  .side {
    gap: 0.4rem;
  }
  .pausa:not(.fs) {
    display: none;
  }
  .brand {
    gap: 0.5rem;
  }
  .logo {
    width: 2.6rem;
    height: 2.6rem;
  }
}
/* Poco espacio (móvil o ventana baja): versión compacta */
@media (max-width: 600px), (max-height: 700px) {
  .info p,
  .tagline,
  .status,
  .contact span,
  .fx i {
    display: none;
  }
  section {
    padding: 0.625rem 0.75rem 0.75rem;
    border-radius: 1rem;
  }
  .info {
    padding: 0.375rem 0.625rem 0.5rem;
  }
  .info h3 {
    font-size: 0.9rem;
  }
  .shot b {
    font-size: 2rem;
  }
  .titulo {
    font-size: 1.25rem;
  }
  body > header {
    flex-wrap: nowrap;
  }
  .wm {
    font-size: 1.4rem;
  }
  .brand svg {
    width: 2.375rem;
    height: 2.375rem;
  }
  .contact {
    padding: 0.3125rem 0.875rem;
  }
  .face {
    padding: 0.5rem;
  }
  .front strong {
    font-size: 1rem;
  }
  .front span,
  .front em,
  .hablemos span {
    display: none;
  }
  body {
    padding: 0.75rem 0.875rem 0.5rem;
    gap: 0.625rem;
  }
}
/* Móvil en horizontal: poca altura, así que todo se reduce al mínimo útil */
@media (max-height: 520px) and (min-aspect-ratio: 5/4) {
  body {
    padding: 0.375rem 0.625rem;
    gap: 0.375rem;
  }
  body > header {
    gap: 0.625rem;
  }
  .brand {
    gap: 0.5rem;
  }
  .brand svg {
    width: 1.875rem;
    height: 1.875rem;
  }
  .wm {
    font-size: 1.15rem;
  }
  .contact {
    padding: 0.25rem 0.625rem;
  }
  .pausa {
    width: 1.75rem;
    height: 1.75rem;
  }
  footer {
    display: none;
  }
  main {
    gap: 0.75rem;
  }
  section {
    padding: 0.375rem 0.5rem 0.5rem;
    border-radius: 0.75rem;
  }
  .titulo {
    font-size: 0.95rem;
    padding-bottom: 0.25rem;
    margin-bottom: 0.375rem;
    border-bottom-width: 0.125rem;
    gap: 0.4375rem;
  }
  .titulo .ico {
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 0.4375rem;
  }
  .titulo .ico svg {
    width: 0.8125rem;
    height: 0.8125rem;
  }
  .titulo small {
    display: none;
  }
  .grid {
    gap: 0.4375rem;
  }
  .card {
    border-radius: 0.5625rem;
  }
  .info {
    padding: 0.1875rem 0.375rem 0.25rem;
  }
  .info h3 {
    font-size: 0.7rem;
  }
  .go {
    display: none;
  }
  .dots {
    bottom: 0.1875rem;
    gap: 0.1875rem;
  }
  .dots i {
    width: 0.25rem;
    height: 0.25rem;
  }
  .shot b {
    font-size: 1.2rem;
  }
  .front strong {
    font-size: 0.72rem;
  }
  .front::after {
    font-size: 1.6rem;
  }
  .hablemos strong {
    font-size: 1rem;
  }
  .volver {
    width: 1.25rem;
    height: 1.25rem;
    top: 0.1875rem;
    right: 0.1875rem;
    font-size: 0.7rem;
  }
}
/* TV y pantallas muy grandes: margen de seguridad por si el televisor recorta los bordes */
@media (min-width: 1600px) and (min-aspect-ratio: 5/4) {
  body {
    padding: 2.4vh 3.4vw 1.6vh;
  }
}
/* Pantallas táctiles: zonas de pulsación cómodas */
@media (pointer: coarse) {
  .contact {
    min-height: 2.75rem;
  }
  .pausa {
    width: 2.75rem;
    height: 2.75rem;
  }
  .volver {
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* ==========================================================================
   12. PANTALLA DE ENTRADA
   Logotipo dentro de un botón grande y un ratón dibujado en la esquina: invitan a hacer clic, y ese clic es lo
   que permite ponerse a pantalla completa. La activa inicio.js (clase "con-entrada" en <html>); la gestiona main.js.
   ========================================================================== */
.entrada {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(120% 90% at 50% 38%, #1a2d8f 0%, #0c1238 52%, #040616 100%);
  transition: opacity 0.7s ease;
}
html.con-entrada .entrada {
  display: grid;
}
.entrada.saliendo {
  opacity: 0;
  pointer-events: none;
}
/* Seguridad: si main.js no llegara a arrancar, la pantalla se retira sola a los 8 s y la web queda usable */
html.con-entrada .entrada:not(.lista) {
  animation: entrada-seguridad 0.01s 8s forwards;
}
@keyframes entrada-seguridad {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
/* Fondo: rejilla de puntos y tres manchas de color que flotan despacio */
.entrada::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 0.0625rem, transparent 0.0625rem);
  background-size: 1.8rem 1.8rem;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent);
  mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent);
}
.entrada__fondo {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.entrada__fondo i {
  position: absolute;
  border-radius: 50%;
  filter: blur(4.5rem);
  opacity: 0.5;
  animation: entrada-flota 14s ease-in-out infinite alternate;
}
.entrada__fondo i:nth-child(1) {
  left: 6%;
  top: 10%;
  width: 34vmax;
  height: 34vmax;
  background: #2d5bff;
}
.entrada__fondo i:nth-child(2) {
  right: 4%;
  bottom: 6%;
  width: 30vmax;
  height: 30vmax;
  background: #7b2cbf;
  animation-delay: -5s;
}
.entrada__fondo i:nth-child(3) {
  left: 42%;
  top: 56%;
  width: 22vmax;
  height: 22vmax;
  background: #ffc857;
  opacity: 0.2;
  animation-delay: -9s;
}
@keyframes entrada-flota {
  to {
    transform: translate(4vmax, -3vmax) scale(1.12);
  }
}
.entrada__centro {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 1.6rem;
}

/* El botón: cristal oscuro con un aro de luz que gira, brillo curvo arriba, relieve y resplandor azul */
.entrada__boton {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  width: min(36rem, 88vw);
  padding: 2.6rem 2rem 2.2rem;
  border: 0;
  border-radius: 3.2rem;
  overflow: hidden;
  cursor: pointer;
  color: #fff;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04) 45%, rgba(8, 12, 45, 0.55));
  box-shadow:
    inset 0 0.12rem 0 rgba(255, 255, 255, 0.55),
    inset 0 -0.25rem 0.9rem rgba(0, 0, 0, 0.45),
    0 0 0 0.1rem rgba(255, 255, 255, 0.16),
    0 2.2rem 4.5rem -1.2rem rgba(0, 0, 0, 0.8),
    0 0 7rem rgba(45, 91, 255, 0.45);
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s;
  animation: entrada-aparece 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) backwards;
}
.entrada__boton::before {
  content: "";
  position: absolute;
  inset: -60%;
  z-index: -2;
  background: conic-gradient(from 0deg, transparent 0 60%, #ffc857 79%, #fff 85%, #2d5bff 92%, transparent 97%);
  animation: entrada-giro 4.5s linear infinite;
}
.entrada__boton::after {
  content: "";
  position: absolute;
  inset: 0.28rem;
  z-index: -1;
  border-radius: 2.9rem;
  background: radial-gradient(120% 140% at 50% 0%, #2a45aa 0%, #131c5b 55%, #0a0f33 100%);
  box-shadow: inset 0 0 2rem rgba(0, 0, 0, 0.5);
}
.entrada__boton:hover {
  transform: translateY(-0.3rem) scale(1.03);
  box-shadow:
    inset 0 0.12rem 0 rgba(255, 255, 255, 0.65),
    inset 0 -0.25rem 0.9rem rgba(0, 0, 0, 0.45),
    0 0 0 0.1rem rgba(255, 255, 255, 0.3),
    0 2.6rem 5rem -1.2rem rgba(0, 0, 0, 0.85),
    0 0 9rem rgba(74, 119, 255, 0.7);
}
.entrada__boton:active {
  transform: translateY(0.15rem) scale(0.985);
  transition-duration: 0.08s;
}
.entrada__boton:focus-visible {
  outline: 0.2rem solid var(--sun);
  outline-offset: 0.35rem;
}
.entrada__brillo {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0.55rem;
  height: 34%;
  z-index: 0;
  pointer-events: none;
  border-radius: 2.6rem 2.6rem 60% 60% / 2.6rem 2.6rem 45% 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03) 70%, rgba(255, 255, 255, 0));
}
.entrada__halo {
  position: absolute;
  left: 50%;
  top: 2.6rem;
  width: 15rem;
  height: 9rem;
  margin-left: -7.5rem;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(74, 119, 255, 0.8), transparent);
  animation: entrada-latido 3.2s ease-in-out infinite;
}
.entrada__boton .logo {
  position: relative;
  z-index: 1;
  width: clamp(5.5rem, 13vw, 8.5rem);
  height: clamp(5.5rem, 13vw, 8.5rem);
  filter: drop-shadow(0 0.6rem 1.2rem rgba(45, 91, 255, 0.7));
}
.entrada__nombre {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 0.2rem 1.2rem rgba(0, 0, 0, 0.5);
}
.entrada__nombre b {
  font-weight: inherit;
  color: #7aa2ff;
}
.entrada__nombre i {
  font-style: normal;
  color: var(--sun);
}
.entrada__lema {
  position: relative;
  z-index: 1;
  font-size: clamp(0.78rem, 2vw, 1rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.82;
}
.entrada__saltar {
  padding: 0.4rem 0.8rem;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  color: #cfd8ff;
  opacity: 0.65;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}
.entrada__saltar:hover,
.entrada__saltar:focus-visible {
  opacity: 1;
}
.entrada.saliendo .entrada__boton {
  transform: scale(1.22);
  opacity: 0;
  transition:
    transform 0.6s cubic-bezier(0.5, 0, 0.8, 0.4),
    opacity 0.5s;
}

/* Ratón dibujado en la esquina inferior derecha: pulsa con el botón izquierdo y lanza ondas */
.raton {
  position: absolute;
  right: clamp(1rem, 3.5vw, 3.5rem);
  bottom: clamp(1rem, 5vh, 3.5rem);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
  animation: raton-flota 2.4s ease-in-out infinite;
}
.raton__texto {
  position: relative;
  padding: 0.55rem 1rem;
  border: 0.0625rem solid rgba(255, 255, 255, 0.3);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  line-height: 1.25;
  text-align: right;
}
.raton__texto::after {
  content: "";
  position: absolute;
  right: -0.42rem;
  top: 50%;
  width: 0.75rem;
  height: 0.75rem;
  background: rgba(255, 255, 255, 0.12);
  border: 0.0625rem solid rgba(255, 255, 255, 0.3);
  border-left: 0;
  border-bottom: 0;
  transform: translateY(-50%) rotate(45deg);
}
.raton__figura {
  position: relative;
  width: clamp(3.6rem, 6.5vw, 5.4rem);
  animation: raton-pulsa 2.4s ease-in-out infinite;
}
.raton__dibujo {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0.5rem 0.9rem rgba(0, 0, 0, 0.45));
}
.raton__sombra {
  fill: rgba(0, 0, 0, 0.35);
}
.raton__cable {
  fill: none;
  stroke: #b9c4e6;
  stroke-width: 3;
  stroke-linecap: round;
}
.raton__cuerpo {
  fill: url(#raton-cuerpo);
  stroke: #0a0f33;
  stroke-width: 3.5;
}
.raton__boton {
  fill: url(#raton-boton);
  stroke: #0a0f33;
  stroke-width: 3.5;
  stroke-linejoin: round;
}
.raton__lineas {
  fill: none;
  stroke: #0a0f33;
  stroke-width: 3.5;
  stroke-linecap: round;
}
.raton__rueda {
  fill: #1a2144;
  stroke: #0a0f33;
  stroke-width: 2;
}
.raton__onda {
  position: absolute;
  left: 20%;
  top: 19%;
  width: 36%;
  aspect-ratio: 1;
  border: 0.22rem solid var(--sun);
  border-radius: 50%;
  opacity: 0;
  animation: raton-onda 2.4s ease-out infinite;
}
.raton__onda--2 {
  animation-delay: 0.22s;
}
@keyframes entrada-aparece {
  from {
    opacity: 0;
    transform: translateY(1.4rem) scale(0.88);
  }
}
@keyframes entrada-giro {
  to {
    transform: rotate(360deg);
  }
}
@keyframes entrada-latido {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.12);
  }
}
@keyframes raton-flota {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.35rem);
  }
}
@keyframes raton-pulsa {
  0%,
  46%,
  64%,
  100% {
    transform: translateY(0) scale(1);
  }
  52% {
    transform: translateY(0.2rem) scale(0.96);
  }
}
@keyframes raton-onda {
  0%,
  50% {
    transform: scale(0.3);
    opacity: 0;
  }
  53% {
    opacity: 0.95;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}
@media (max-height: 520px) {
  .entrada__boton {
    padding: 1.3rem 1.6rem 1.2rem;
    gap: 0.4rem;
  }
  .entrada__boton .logo {
    width: 4.2rem;
    height: 4.2rem;
  }
  .entrada__nombre {
    font-size: 2.4rem;
  }
  .entrada__halo {
    top: 1.2rem;
  }
}
@media (max-width: 600px) {
  .raton__texto {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .entrada *,
  .entrada *::before,
  .entrada *::after {
    animation: none !important;
    transition: none !important;
  }
  .raton__onda {
    opacity: 0.7;
    transform: scale(1.4);
  }
}
