/* Portal Milosoft — hoja de estilo unica.
 * Sin dependencias externas: se abre con doble click y se ve igual. */

:root {
  --fondo: #0d1117;
  --fondo-tarjeta: #161b22;
  --fondo-tarjeta-hover: #1c2129;
  --borde: #30363d;
  --borde-suave: #21262d;
  --texto: #e6edf3;
  --texto-tenue: #8b949e;
  --texto-apagado: #6e7681;
  --radio: 14px;
  --transicion: 160ms ease;
}

/* Modo claro: el sistema manda, salvo que el usuario elija con el boton. */
@media (prefers-color-scheme: light) {
  :root {
    --fondo: #f6f8fa;
    --fondo-tarjeta: #ffffff;
    --fondo-tarjeta-hover: #ffffff;
    --borde: #d0d7de;
    --borde-suave: #e4e8ed;
    --texto: #1f2328;
    --texto-tenue: #59636e;
    --texto-apagado: #818b98;
  }
}

:root[data-tema='claro'] {
  --fondo: #f6f8fa;
  --fondo-tarjeta: #ffffff;
  --fondo-tarjeta-hover: #ffffff;
  --borde: #d0d7de;
  --borde-suave: #e4e8ed;
  --texto: #1f2328;
  --texto-tenue: #59636e;
  --texto-apagado: #818b98;
}

:root[data-tema='oscuro'] {
  --fondo: #0d1117;
  --fondo-tarjeta: #161b22;
  --fondo-tarjeta-hover: #1c2129;
  --borde: #30363d;
  --borde-suave: #21262d;
  --texto: #e6edf3;
  --texto-tenue: #8b949e;
  --texto-apagado: #6e7681;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--fondo);
  color: var(--texto);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.envoltorio {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ---------- Encabezado ---------- */

.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 0;
}

.marca {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.marca__logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.marca__nombre { color: var(--texto); }
.marca__nombre em {
  font-style: normal;
  color: var(--texto-apagado);
  font-weight: 500;
}

.boton-tema {
  background: transparent;
  border: 1px solid var(--borde);
  color: var(--texto-tenue);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transicion);
}
.boton-tema:hover {
  border-color: var(--texto-apagado);
  color: var(--texto);
}
.boton-tema svg { width: 17px; height: 17px; }

/* ---------- Portada ---------- */

.portada {
  padding: 72px 0 56px;
  max-width: 640px;
}

.portada h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  font-weight: 700;
}

.portada p {
  font-size: 1.08rem;
  color: var(--texto-tenue);
  margin: 0;
}

/* ---------- Grilla de apps ---------- */

.titulo-seccion {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--texto-apagado);
  font-weight: 600;
  margin: 0 0 20px;
}

.grilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.tarjeta {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: var(--transicion);
}

/* Barra de acento arriba, con el color de cada app. */
.tarjeta::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--acento);
  opacity: 0;
  transition: var(--transicion);
}

.tarjeta:hover {
  background: var(--fondo-tarjeta-hover);
  border-color: var(--acento);
  transform: translateY(-3px);
}
.tarjeta:hover::before { opacity: 1; }

.tarjeta:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}

/* Una app sin destino todavia no se puede abrir. */
.tarjeta--inactiva {
  opacity: 0.55;
  pointer-events: none;
}

.tarjeta__encabezado {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tarjeta__icono {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--acento) 14%, transparent);
  color: var(--acento);
  flex-shrink: 0;
}
.tarjeta__icono svg { width: 23px; height: 23px; }

.tarjeta__nombre {
  font-size: 1.1rem;
  font-weight: 650;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.tarjeta__resumen {
  color: var(--texto-tenue);
  font-size: 0.92rem;
  margin: 0 0 18px;
  flex-grow: 1;
}

.tarjeta__pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--borde-suave);
}

.plataformas {
  display: flex;
  gap: 6px;
  color: var(--texto-apagado);
}
.plataformas svg { width: 15px; height: 15px; }

/* ---------- Etiquetas de estado ---------- */

.etiqueta {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.etiqueta--listo       { color: #3fb950; border-color: #3fb95055; background: #3fb95015; }
.etiqueta--beta        { color: #58a6ff; border-color: #58a6ff55; background: #58a6ff15; }
.etiqueta--desarrollo  { color: #d29922; border-color: #d2992255; background: #d2992215; }

/* ---------- Aviso de requisito previo ---------- */

.aviso {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--texto-apagado);
  margin-top: 12px;
}
.aviso svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ---------- Barra de contexto (local / online) ---------- */

.contexto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--texto-apagado);
  border: 1px solid var(--borde);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 28px;
}

.contexto__punto {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d29922;
}
.contexto--online .contexto__punto { background: #3fb950; }

/* ---------- Pie ---------- */

.pie {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--borde-suave);
  color: var(--texto-apagado);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pie a { color: var(--texto-tenue); text-decoration: none; }
.pie a:hover { color: var(--texto); text-decoration: underline; }

@media (max-width: 600px) {
  .envoltorio { padding: 0 18px 56px; }
  .portada { padding: 48px 0 40px; }
  .grilla { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .tarjeta:hover { transform: none; }
}
