/* CypherAnvil — estilos. Modo oscuro por defecto, modo claro con el botón o según el sistema. */

@font-face { font-family: "Inter Display"; src: url("/fonts/interdisplay-light.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/fonts/interdisplay-medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DejaVu Mono"; src: url("/fonts/dejavu-mono.woff") format("woff"); font-weight: 400; font-display: swap; }

/* Paleta oscura (por defecto): negro y plata */
:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0e0f11;
  --text: #c9ced4;          /* plata para el texto corrido */
  --strong: #eef0f2;        /* plata clara para titulares y enlaces */
  --mute: #8b9199;          /* plata oscura para texto secundario */
  --rule: #26292d;
  --silver-hi: #f4f5f7;     /* brillo del titular */
  --silver-lo: #98a0a9;
  --display: "Inter Display", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "DejaVu Mono", ui-monospace, monospace;
  --wide: 80rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

/* Paleta clara: blanco y grafito */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --panel: #f3f4f6; --text: #2f343a; --strong: #121417;
  --mute: #5f6670; --rule: #dadde1; --silver-hi: #6d747d; --silver-lo: #1c1f23;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #ffffff; --panel: #f3f4f6; --text: #2f343a; --strong: #121417;
    --mute: #5f6670; --rule: #dadde1; --silver-hi: #6d747d; --silver-lo: #1c1f23;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--strong); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--strong); outline-offset: 4px; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* Cabecera */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  padding-top: 1.25rem; padding-bottom: 1.25rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--strong);
  font-family: var(--display); font-weight: 500; font-size: 1rem; letter-spacing: 0.14em;
}
.wordmark svg { width: 2.1rem; height: auto; flex: none; }
.header-right { display: flex; align-items: center; gap: 1.5rem 2rem; flex-wrap: wrap; }
.nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--mute); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--strong); }

.theme-toggle {
  display: none; align-items: center; gap: 0.5rem; padding: 0.4rem 0.8rem;
  background: transparent; color: var(--mute); border: 1px solid var(--rule);
  font: 500 0.85rem var(--body); cursor: pointer;
}
.theme-toggle:hover { color: var(--strong); border-color: var(--mute); }
.theme-toggle svg { width: 1rem; height: 1rem; }
[data-js] .theme-toggle { display: inline-flex; }

/* Titular plateado */
.silver {
  background: linear-gradient(180deg, var(--silver-hi) 10%, var(--silver-lo) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Portada */
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; align-items: center;
  padding-top: clamp(4.5rem, 13vw, 10rem); padding-bottom: clamp(4rem, 10vw, 8rem);
}
.hero h1 {
  margin: 0; font-family: var(--display); font-weight: 300;
  font-size: clamp(3.2rem, 9vw, 7.8rem); line-height: 0.95; letter-spacing: -0.035em;
}
.hero .lede { margin: 2.25rem 0 0; max-width: 36rem; font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.55; color: var(--mute); }
.emblem { width: 100%; max-width: 26rem; justify-self: end; color: var(--strong); }
.emblem .body { fill: var(--panel); stroke: url(#steel); stroke-width: 2; }
.emblem .bits { font-family: var(--mono); font-size: 10px; fill: var(--mute); letter-spacing: 1px; }
.emblem stop:first-child { stop-color: var(--silver-hi); }
.emblem stop:last-child { stop-color: var(--silver-lo); }

/* Áreas: filas a todo el ancho */
.area { border-top: 1px solid var(--rule); }
.area .wrap {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem 3rem;
  padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.area h2 {
  margin: 0; font-family: var(--display); font-weight: 300; color: var(--strong);
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -0.03em;
}
.area .where { margin: 0.9rem 0 0; font-size: 0.95rem; color: var(--mute); }
.area p { margin: 0 0 1rem; max-width: 40rem; }
.area .summary { font-size: 1.2rem; line-height: 1.5; color: var(--strong); }
.list { list-style: none; margin: 1.5rem 0 2rem; padding: 0; border-top: 1px solid var(--rule); max-width: 40rem; }
.list li { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }

.button {
  display: inline-block; padding: 0.85rem 1.4rem; border: 1px solid var(--strong);
  color: var(--strong); text-decoration: none; font-weight: 500;
}
.button:hover { background: var(--strong); color: var(--bg); }

.contact { border-top: 1px solid var(--rule); }
.contact .wrap { padding-top: clamp(4rem, 10vw, 7rem); padding-bottom: clamp(4rem, 10vw, 7rem); }
.contact h2 { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }
.contact p { margin: 1.5rem 0 2rem; max-width: 36rem; color: var(--mute); font-size: 1.15rem; }

/* Páginas interiores */
.page .wrap { padding-top: clamp(4rem, 12vw, 9rem); padding-bottom: clamp(3rem, 8vw, 6rem); }
.page h1 {
  margin: 0; max-width: 16ch; font-family: var(--display); font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 6.2rem); line-height: 0.98; letter-spacing: -0.035em;
}
.page .lede { margin: 2rem 0 0; max-width: 40rem; font-size: 1.2rem; color: var(--mute); }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }

/* Series */
.series { padding-bottom: clamp(4rem, 9vw, 7rem); }
.series-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.series-list li {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0.5rem 3rem;
  padding: 2rem 0; border-bottom: 1px solid var(--rule);
}
.series-list h2 { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; color: var(--strong); }
.series-list p { margin: 0; max-width: 38rem; }
.series-list .tech { margin-top: 0.6rem; font-size: 0.95rem; color: var(--mute); }

/* Legales */
.legal .wrap { padding-top: clamp(3.5rem, 9vw, 6rem); padding-bottom: clamp(3.5rem, 9vw, 6rem); }
.legal h1 { margin: 0 0 0.75rem; font-family: var(--display); font-weight: 300; font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.03em; line-height: 1; }
.legal .updated { margin: 0 0 3rem; color: var(--mute); font-size: 0.95rem; }
.legal h2 { margin: 2.75rem 0 0.75rem; font-family: var(--display); font-weight: 500; font-size: 1.3rem; color: var(--strong); }
.legal p, .legal li { max-width: 44rem; }
.legal ul { padding-left: 1.2rem; }
.legal strong { color: var(--strong); font-weight: 500; }
.legal .note { margin-top: 3rem; padding: 1.25rem 1.5rem; background: var(--panel); border-left: 2px solid var(--mute); max-width: 44rem; color: var(--mute); font-size: 0.95rem; }

/* 404 */
.notfound .wrap { padding-top: clamp(5rem, 14vw, 10rem); padding-bottom: clamp(5rem, 14vw, 10rem); }
.notfound h1 { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(2.6rem, 7vw, 5rem); letter-spacing: -0.03em; line-height: 1; }
.notfound p { margin: 1.5rem 0 2.5rem; color: var(--mute); max-width: 32rem; }

/* Pie */
.site-footer { border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--mute); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 2rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--mute); text-decoration: none; }
.site-footer a:hover { color: var(--strong); text-decoration: underline; }
.site-footer .legal-links { grid-column: 1 / -1; padding-top: 1.25rem; border-top: 1px solid var(--rule); }

@media (max-width: 60rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .emblem { justify-self: start; max-width: 18rem; }
  .area .wrap, .series-list li { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 36rem) {
  body { font-size: 1rem; }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .header-right { gap: 1rem; }
}
