/* Epokan — sistema de diseño editorial
   Temas claro/oscuro vía prefers-color-scheme. Sin JS.
   Fuentes autoalojadas: sin peticiones a terceros. */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lato-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/lato-700-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lato-italic-latin.woff2") format("woff2");
}

:root {
  --bg: #faf9f6;
  --ink: #0F172A;
  --muted: #475569;
  --line: #d8d5cd;
  --accent: #1E3A8A;
  --accent-ink: #ffffff;
  --bg-raised: #ffffff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --ink: #e8e6e1;
    --muted: #a6adba;
    --line: #33373f;
    --accent: #8fb3dd;
    --accent-ink: #0f1420;
    --bg-raised: #1d2026;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 3.5vw, 2.05rem); }
h3 { font-size: 1.25rem; }
h4 { font-family: "Lato", sans-serif; font-size: 1rem; margin: 0 0 0.4em; }

p, ul, ol { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.4em; }

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

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

::selection { background: var(--accent); color: var(--accent-ink); }

code {
  font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.08em 0.35em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
blockquote p:last-child { margin-bottom: 0; }

/* ---- Estructura ---- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0; }

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2rem);
}

.wrap--narrow { max-width: 46rem; }

/* Cabecera */

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 2rem;
  justify-content: space-between;
}
.brand {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
}
.site-nav a {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0;
}
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}

/* Secciones */

main { display: block; }

.section { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }

.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.lede { font-size: 1.18rem; color: var(--muted); max-width: 46rem; }

/* Hero */

.hero { padding: clamp(3rem, 9vw, 6rem) 0; }
.hero h1 { max-width: 21ch; }
.hero .lede { margin-top: 1rem; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

/* Botones */

.btn {
  display: inline-block;
  font-family: "Lato", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 3px;
  border: 1.5px solid var(--accent);
  transition: background-color 120ms ease, color 120ms ease;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.12); }
.btn--secondary { background: transparent; color: var(--accent); }
.btn--secondary:hover { background: var(--accent); color: var(--accent-ink); }

/* Fichas */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.5rem;
}
.card h3 { font-size: 1.18rem; margin-bottom: 0.4rem; }
.card p { color: var(--muted); font-size: 0.97rem; margin-bottom: 0; }

/* Fichas de producto (método) */

.product {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-raised);
  padding: 1.75rem;
  margin-top: 1.5rem;
}
.product header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin-bottom: 0.8rem;
}
.product h3 { margin: 0; }
.product .tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.product dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0;
}
.product dt { font-weight: 700; font-size: 0.92rem; }
.product dd { margin: 0; color: var(--muted); }
@media (max-width: 34rem) {
  .product dl { grid-template-columns: 1fr; gap: 0; }
  .product dd { margin-bottom: 0.7rem; }
}

/* Recuadro destacado */

.feature-box {
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--bg-raised);
  padding: 1.75rem;
  margin-top: 1.5rem;
}
.feature-box h3 { margin-bottom: 0.4rem; }
.feature-box p { color: var(--muted); }
.feature-box p:last-of-type { margin-bottom: 1.2rem; }

/* Pasos */

.steps {
  list-style: none;
  counter-reset: paso;
  margin: 1.5rem 0 0;
  padding: 0;
}
.steps > li {
  counter-increment: paso;
  position: relative;
  padding: 0 0 1.75rem 3.4rem;
}
.steps > li::before {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.1rem;
  top: 2.6rem;
  bottom: 0.3rem;
  width: 1px;
  background: var(--line);
}
.steps h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.steps p { color: var(--muted); margin-bottom: 0; }

/* Repos */

.repo-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.repo-list li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}
.repo-list li:last-child { border-bottom: 1px solid var(--line); }
.repo-list .repo-desc { color: var(--muted); }

/* FAQ */

.faq-item { padding: 1.6rem 0; border-top: 1px solid var(--line); }
.faq-item:last-of-type { border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: 1.22rem; margin-bottom: 0.5rem; }
.faq-item p:last-child { margin-bottom: 0; }
.faq-item .fuente, .fuente { font-size: 0.88rem; color: var(--muted); }

/* Tablas (informe) */

.tablewrap { overflow-x: auto; margin: 1.5rem 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  vertical-align: top;
}
th { font-family: "Lato", sans-serif; font-weight: 700; background: var(--bg-raised); }

/* Artículo (informe, legales) */

.article { max-width: 46rem; }
.article-subtitle {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.35rem;
  color: var(--muted);
  margin: -0.4rem 0 1.4rem;
}
.article h2 { margin-top: 2.5rem; }
.article h3 { margin-top: 2rem; }
.article-meta { color: var(--muted); font-size: 0.95rem; }

/* Formularios */

form { max-width: 34rem; }
.field { margin-bottom: 1.2rem; }
label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.3rem; }
input[type="text"], input[type="email"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg-raised);
  border: 1px solid var(--muted);
  border-radius: 3px;
  padding: 0.65rem 0.8rem;
}
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
textarea { min-height: 8.5rem; resize: vertical; }
.hidden { position: absolute; left: -9999px; }

button.btn { cursor: pointer; font: inherit; font-weight: 700; }

/* Pie */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  margin-top: 3rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer p { max-width: 46rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
  padding: 0;
  margin: 0 0 1.2rem;
}

/* Suscripción (informe) */

.subscribe-box {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-raised);
  padding: 1.75rem;
  margin-top: 3rem;
}
.subscribe-box h2 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.subscribe-box p { color: var(--muted); }
