/* home.css — Sistema visual del sitio raiz.
 *
 * Mismos tokens que las herramientas, para que el portafolio se lea como una
 * sola marca al pasar de microtools.lat a cualquier subdominio. Copiados a
 * proposito en lugar de compartidos: son dos sitios independientes en Netlify
 * y un paquete comun solo anadiria un paso de build a cambio de nada.
 */

:root {
  /* ---- color ---- */
  --c-bg: #FFFFFF;
  --c-surface: #F8FAFC;
  --c-surface-2: #F1F5F9;
  --c-border: #E2E8F0;
  --c-border-fuerte: #CBD5E1;
  --c-text: #0F172A;
  --c-text-2: #475569;
  --c-muted: #64748B;

  --c-accent: #C2410C;
  --c-accent-hover: #9A3412;
  --c-accent-soft: #FFF7ED;
  --c-accent-borde: #FED7AA;

  --c-ok: #15803D;

  /* ---- espacio ---- */
  --e1: 4px;  --e2: 8px;  --e3: 12px; --e4: 16px;
  --e5: 24px; --e6: 32px; --e7: 48px; --e8: 64px;

  /* ---- forma ---- */
  --r-control: 8px;
  --r-caja: 12px;
  --r-pastilla: 999px;

  --t: 120ms cubic-bezier(.22, 1, .36, 1);

  --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--c-border-fuerte) transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--c-accent-soft); color: var(--c-accent-hover); }
::placeholder { color: var(--c-muted); opacity: 1; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--c-border-fuerte);
  border: 3px solid var(--c-bg);
  border-radius: var(--r-pastilla);
}
::-webkit-scrollbar-thumb:hover { background: var(--c-muted); }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- tipografia ---------- */

h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; }
h1 {
  font-size: clamp(29px, 5vw, 40px);
  letter-spacing: -.024em;
  text-wrap: balance;
}
h2 { font-size: 22px; letter-spacing: -.014em; text-wrap: balance; }
h3 { font-size: 17px; letter-spacing: -.008em; }
p { margin: 0 0 1em; }

a {
  color: var(--c-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--t);
}
a:hover { color: var(--c-accent-hover); }

/* ---------- estructura ---------- */

.contenedor {
  width: 100%; max-width: 1080px;
  margin: 0 auto; padding: 0 var(--e5);
}
.estrecho { max-width: 760px; }

.salto-contenido {
  position: absolute; left: -9999px;
  padding: var(--e3) var(--e4); background: var(--c-text); color: #fff;
  border-radius: 0 0 var(--r-control) 0; text-decoration: none; z-index: 10;
}
.salto-contenido:focus { left: 0; top: 0; }

/* ---------- cabecera y pie ---------- */

.cabecera { border-bottom: 1px solid var(--c-border); background: var(--c-bg); }
.cabecera__fila {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--e4); min-height: 60px;
}
.logo {
  font-weight: 700; font-size: 15px; letter-spacing: -.01em;
  color: var(--c-text); text-decoration: none;
}
.nav { display: flex; gap: var(--e4); flex-wrap: wrap; }
.nav a {
  color: var(--c-muted); text-decoration: none; font-size: 14px;
  padding: var(--e1) 0; border-bottom: 1.5px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.nav a:hover { color: var(--c-text); }
.nav a[aria-current="page"] { color: var(--c-text); border-bottom-color: var(--c-accent); }

.pie {
  margin-top: var(--e8); padding: var(--e6) 0 var(--e7);
  border-top: 1px solid var(--c-border);
  color: var(--c-muted); font-size: 14px;
}
.pie p { margin: 0 0 var(--e2); max-width: 62ch; }
.pie a { color: var(--c-muted); text-decoration-color: var(--c-border-fuerte); }
.pie a:hover { color: var(--c-text); }
.pie__enlaces {
  display: flex; gap: var(--e4); flex-wrap: wrap;
  margin-bottom: var(--e4); padding-bottom: var(--e4);
  border-bottom: 1px solid var(--c-border);
}

/* ---------- entrada ---------- */

.entrada { padding: var(--e7) 0 var(--e5); max-width: 62ch; }
.entrada p { color: var(--c-text-2); }
.entrada p:first-of-type { font-size: 18px; }
.entrada p:last-child { margin-bottom: 0; }

/* ---------- anuncios ---------- */

.ad-slot {
  display: block; margin: var(--e6) auto; text-align: center;
  min-height: 280px;
  contain: layout;
}
.ad-slot--top { min-height: 100px; }
.ad-slot::before {
  content: "Publicidad";
  display: block; font-size: 11px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--c-muted); margin-bottom: var(--e2);
}

/* ---------- tarjetas de herramienta ---------- */

.titulo-seccion { margin: 0 0 var(--e4); }

.herramientas {
  display: grid; gap: var(--e5);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin: 0 0 var(--e7);
  padding: 0; list-style: none;
}

.tarjeta {
  display: flex; flex-direction: column;
  padding: var(--e5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-caja);
  transition: border-color var(--t), background var(--t);
}
.tarjeta--disponible:hover {
  border-color: var(--c-border-fuerte);
  background: var(--c-bg);
}
.tarjeta--pendiente { background: var(--c-surface-2); }

.tarjeta__alto {
  display: flex; align-items: flex-start; gap: var(--e3);
  margin-bottom: var(--e3);
}
.tarjeta__icono {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  border: 1px solid var(--c-accent-borde);
  border-radius: var(--r-control);
}
.tarjeta--pendiente .tarjeta__icono {
  color: var(--c-muted);
  background: var(--c-bg);
  border-color: var(--c-border);
}
.tarjeta__titulo { margin: 0; font-size: 18px; letter-spacing: -.012em; }
.tarjeta__titulo a { color: var(--c-text); text-decoration: none; }
.tarjeta__titulo a:hover { color: var(--c-accent-hover); }

.etiqueta {
  display: inline-block; margin-top: var(--e1);
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  font-weight: 600; color: var(--c-text-2);
}

.tarjeta__resumen { color: var(--c-text-2); margin-bottom: var(--e4); }

.tarjeta__puntos {
  margin: 0 0 var(--e5); padding: 0; list-style: none;
  font-size: 15px; color: var(--c-text-2);
}
.tarjeta__puntos li {
  position: relative; padding-left: var(--e5); margin-bottom: var(--e2);
}
.tarjeta__puntos li::before {
  content: ""; position: absolute; left: 6px; top: .62em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--c-accent-borde);
}

.tarjeta__pie { margin-top: auto; }

.boton {
  display: inline-flex; align-items: center; gap: var(--e2);
  padding: var(--e3) var(--e5);
  font: inherit; font-weight: 600; font-size: 15px;
  color: #fff; background: var(--c-accent);
  border: 1px solid var(--c-accent);
  border-radius: var(--r-control);
  text-decoration: none; cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.boton:hover {
  color: #fff; background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
}
.boton svg { flex: none; }

.nota-pendiente { margin: 0; font-size: 14px; color: var(--c-text-2); }

/* ---------- articulo ---------- */

.articulo { max-width: 68ch; }
.articulo h2 { margin-top: var(--e7); }
.articulo h2:first-child { margin-top: 0; }
.articulo p { color: var(--c-text-2); }

/* ---------- preguntas ---------- */

.faq { max-width: 68ch; margin-top: var(--e7); }
.faq__item {
  border-top: 1px solid var(--c-border);
  padding: var(--e4) 0;
}
.faq__item:last-child { border-bottom: 1px solid var(--c-border); }
.faq__item summary {
  cursor: pointer; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; gap: var(--e4);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; flex: none;
  color: var(--c-muted); font-weight: 400; font-size: 20px; line-height: 1;
}
.faq__item[open] summary::after { content: "\2212"; }
.faq__item p {
  margin: var(--e3) 0 0; color: var(--c-text-2);
}

/* ---------- movil ---------- */

@media (max-width: 560px) {
  .contenedor { padding: 0 var(--e4); }
  .entrada { padding-top: var(--e6); }
  .herramientas { grid-template-columns: 1fr; }
  .tarjeta { padding: var(--e4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
