/* =============================================================
   Utiliec · base común de la familia + portada («el archivador»)
   Tipografías alojadas en el sitio (licencia OFL, ver fonts/).
   ============================================================= */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --office: #eef1f4; --paper: #ffffff; --ink: #1f2328; --muted: #59606b; --rule: #d5dae1;
  --brand: #0f766e; --brand-ink: #ffffff;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  /* Color de cada herramienta (pestañas del archivador) */
  --c-nomina: #0f766e; --c-retenciones: #3730a3; --c-informes: #2563eb;
  --c-pdf: #c2410c; --c-comparar: #9f1239; --c-qr3d: #059669; --c-comprobantes: #7a5200;
}
@media (prefers-color-scheme: dark) {
  :root { --office: #15181d; --paper: #1e2228; --ink: #e8eaed; --muted: #a2a9b4; --rule: #333a44; --brand: #2dd4bf; --brand-ink: #042f2e; }
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--office); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--paper); z-index: 99; border-radius: 6px; font-weight: 700; }
.skip-link:focus { top: 1rem; }
.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }

/* Cabecera */
.top { background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.top nav { display: flex; gap: 2px; flex-wrap: wrap; }
.top nav a { padding: 6px 12px; font-size: .95rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }

/* Encabezado de la portada */
.hero { padding: 44px 0 26px; }
.hero h1 { font-size: clamp(2rem, 4.2vw + .6rem, 3.2rem); letter-spacing: -.02em; max-width: 22ch; }
.sub { color: var(--muted); margin-top: 14px; max-width: 58ch; font-size: 1.08rem; }

/* ---------- El cajón de carpetas ---------- */
.drawer { list-style: none; padding: 0; display: grid; gap: 46px 22px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 34px; }
.folder { position: relative; --tabx: calc(var(--i) * 30%); }
.folder > a { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--c); border-radius: 0 10px 10px 10px; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.folder:nth-child(3n+2) > a, .folder:nth-child(3n) > a { border-radius: 10px; }
.ftab { position: absolute; top: -34px; left: var(--tabx); height: 31px; padding: 0 16px; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 700; font-size: .9rem; border-radius: 8px 8px 0 0; white-space: nowrap; }
.fig { display: grid; place-items: center; height: 150px; color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--paper)); border-bottom: 1px solid var(--rule); }
.fig svg { width: min(240px, 90%); height: auto; transition: transform .25s ease; }
.fbody { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.kind { font-size: .82rem; color: var(--muted); }
.folder h3 { font-size: 1.4rem; margin-top: -4px; }
.fdesc { color: var(--ink); }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tags li { font-size: .8rem; padding: 3px 9px; border-radius: 4px; background: color-mix(in srgb, var(--c) 10%, var(--paper)); color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.open { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--c); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.url { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.folder > a:hover, .folder > a:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--c) 45%, transparent); }
.folder > a:hover .fig svg { transform: scale(1.04) rotate(-1deg); }
.folder > a:hover .open { text-decoration-thickness: 3px; }
@media (prefers-color-scheme: dark) { .tags li { color: var(--ink); } .ftab { color: #fff; } }
@media (max-width: 700px) { .folder { --tabx: 0; } .folder > a, .folder:nth-child(3n+2) > a, .folder:nth-child(3n) > a { border-radius: 0 10px 10px 10px; } .drawer { gap: 44px; } .fig { height: 130px; } }
@media (prefers-reduced-motion: reduce) { .folder > a, .fig svg { transition: none; } .folder > a:hover { transform: none; } .folder > a:hover .fig svg { transform: none; } }

.suggest { margin: 18px 0 0; color: var(--muted); }
.suggest a { color: var(--brand); font-weight: 700; text-underline-offset: 3px; }

/* Publicidad */
.ad-slot { min-height: 90px; margin: 30px 0; border: 1px dashed var(--rule); border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: .8rem; }

/* Contenido */
.prose { padding: 8px 0; width: min(68ch, 100% - 32px); margin-inline: auto; }
.prose h2 { font-size: 1.5rem; margin: 30px 0 10px; }
.prose h3 { font-size: 1.1rem; margin: 20px 0 6px; }
.prose p, .prose li { margin-bottom: 10px; }
.prose ul { padding-left: 22px; margin-bottom: 12px; }
.prose a { color: var(--brand); text-underline-offset: 3px; }
.faq details { border-bottom: 1px solid var(--rule); padding: 13px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin-top: 8px; color: var(--muted); }
.legal { padding: 34px 0 20px; }
.legal h1 { font-size: 2.1rem; margin-bottom: 16px; }

/* Pie */
.foot { border-top: 1px solid var(--rule); background: var(--paper); padding: 26px 0 40px; margin-top: 30px; color: var(--muted); font-size: .92rem; }
.foot .wrap { display: grid; gap: 10px; }
.foot-contact { color: var(--ink); font-weight: 700; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; padding: 0; }
.foot a { text-underline-offset: 3px; }

/* Botones y cookies */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; min-height: 44px; border-radius: 6px; font-weight: 700; font-size: .95rem; border: 1px solid var(--rule); background: var(--paper); }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.cookie-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--paper); border-top: 1px solid var(--rule); box-shadow: 0 -4px 24px rgba(31, 35, 40, .14); }
.cookie-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 0; }
.cookie-bar p { flex: 1 1 320px; font-size: .9rem; color: var(--muted); }
.cookie-bar a { color: var(--ink); }
.cookie-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 560px) { .cookie-bar-inner { flex-direction: column; align-items: stretch; } .cookie-bar p { flex: 0 1 auto; } .cookie-actions { justify-content: flex-end; } }
@media (max-width: 640px) { .hero { padding-top: 28px; } }
