/* Portada de endegal.com */
:root {
  --bg: #f3efe7;
  --tinta: #1d1b19;
  --suave: #6a645b;
  --card: #ffffff;
  --borde: #e3ddd1;
  --sombra: 0 1px 2px rgba(40,30,10,.06), 0 10px 28px rgba(40,30,10,.08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(60rem 28rem at 50% -8rem, rgba(150,110,40,.13), transparent 70%);
  background-repeat: no-repeat;
  color: var(--tinta);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.cabecera {
  text-align: center;
  padding: clamp(2.5rem, 8vw, 5rem) 1.25rem 0;
}
.firma {
  margin: 0 0 .9rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--suave);
}
.cabecera h1 {
  margin: 0;
  font: 600 clamp(2.1rem, 6.4vw, 3.6rem)/1.08 var(--serif);
  letter-spacing: -.012em;
}
.lema {
  display: inline-block;
  margin: 1.1rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--borde);
  min-width: 11rem;
  font: italic 1.15rem/1.3 var(--serif);
  color: var(--suave);
}

.proyectos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.4rem;
  max-width: 1060px;
  margin: clamp(2rem, 5vw, 3.2rem) auto;
  padding: 0 1.25rem;
}

.proyecto {
  --acento: #1d6fe0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--borde);
  border-top: 4px solid var(--acento);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--sombra);
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.proyecto:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(40,30,10,.08), 0 18px 38px rgba(40,30,10,.16); }
.proyecto:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; }

.proyecto.cubos   { --acento: #1d6fe0; }
.proyecto.orbita  { --acento: #0e7c86; }
.proyecto.caoba   { --acento: #a3141c; }
.proyecto.sdc     { --acento: #8a6d2f; grid-column: 1 / -1; }
.proyecto.omm     { --acento: #087f74; }
.proyecto.qbitos  { --acento: #0ea5e9; }

.proyecto.sdc { grid-column: 1 / -1; }
/* escritorio: 3 tarjetas arriba, 2 en medio, la trilogía a todo el ancho */
@media (min-width: 900px) {
  .proyectos { grid-template-columns: repeat(6, 1fr); }
  .proyecto { grid-column: span 2; }
  .proyecto.omm, .proyecto.qbitos { grid-column: span 3; }
  .proyecto.sdc { grid-column: 1 / -1; }
}

.imagen {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 1.6rem;
  background: #fff;               /* los logos tienen fondo blanco: el panel siempre es claro */
}
.imagen img { display: block; max-width: 100%; height: auto; max-height: 150px; }
.proyecto:not(.sdc) .imagen { height: 220px; }   /* mismo alto en las tres tarjetas superiores: los textos quedan alineados */
.sdc .imagen { padding: 1.4rem 1.4rem .6rem; }
.sdc .imagen img { max-height: none; width: 100%; max-width: 760px; }

.texto {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .3rem;
  padding: 1.15rem 1.5rem 1.5rem;
}
.etiqueta {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--acento);
}
.texto h2 {
  margin: .15rem 0 0;
  font: 600 1.5rem/1.2 var(--serif);
}
.texto p { margin: .25rem 0 1rem; color: var(--suave); line-height: 1.55; }
.ir { margin-top: auto; font-weight: 600; color: var(--acento); }
.ir::after { content: " \2192"; display: inline-block; transition: transform .2s ease; }
.proyecto:hover .ir::after { transform: translateX(4px); }

.sdc .texto { align-items: center; text-align: center; }
.sdc .texto p { max-width: 38rem; }

/* Ocho mil millones uno: panel azul oscuro con la cifra en lugar de logo */
.omm .imagen { background: radial-gradient(ellipse at center, #12263a 0%, #0b141e 75%); min-height: 150px; }
.omm .cifra {
  margin: 0;
  font: 600 clamp(1.4rem, 6.5vw, 2.5rem)/1 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .06em;
  white-space: nowrap;
  color: #39d0c0;
  text-shadow: 0 0 24px rgba(57,208,192,.45);
}

/* QBiTOS: panel oscuro con el título degradado, como en el juego */
.qbitos .imagen { background: #0f172a; min-height: 150px; }
.qbitos .cifra {
  margin: 0;
  font: 700 clamp(2.2rem, 9vw, 4rem)/1 system-ui, sans-serif;
  letter-spacing: .06em;
  background: linear-gradient(135deg, #38bdf8, #f472b6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.pie {
  padding: 0 1.25rem 2.5rem;
  text-align: center;
  font-size: .85rem;
  color: var(--suave);
}

@media (prefers-reduced-motion: reduce) {
  .proyecto, .ir::after { transition: none; }
  .proyecto:hover { transform: none; }
}

/* Selector de idioma */
.idiomas { display: flex; justify-content: center; flex-wrap: wrap; gap: .3rem .9rem; padding: .9rem 1rem 0; font-size: .85rem; }
.idiomas a { color: var(--suave); text-decoration: none; padding: .1rem .3rem; border-bottom: 2px solid transparent; }
.idiomas a:hover { color: var(--tinta); }
.idiomas a.on { color: var(--tinta); font-weight: 600; border-bottom-color: currentColor; }
