/* ley·energía. Identidad: pivotek.mx (tinta y lima). Fuentes auto hospedadas (SIL OFL, ver fuentes/). */

@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fuentes/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fuentes/jetbrains-mono-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fuentes/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fuentes/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url(../fuentes/cormorant-garamond-latin-500-italic.woff2) format("woff2"); }

:root {
  --ink: #0a0c10;
  --ink-2: #11141b;
  --ink-3: #191d27;
  --line: #262b3a;
  --paper: #eceee6;
  --muted: #969dab;
  --lime: #cfff45;
  --amber: #ffb648;
  --coral: #ff5d47;
  --cyan: #7fd8ff;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --radius: 18px;
  --gutter: 16px;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gutter: clamp(20px, 4.5vw, 64px); } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    radial-gradient(900px 420px at 88% -8%, rgba(207, 255, 69, 0.07), transparent 60%),
    linear-gradient(var(--ink-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-2) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (min-width: 720px) { body { font-size: 15px; } }

a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--lime); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 60; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Encabezado */
.top { position: sticky; top: 0; z-index: 30; background: rgba(10, 12, 16, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ink-3); }
.top-row { display: flex; align-items: center; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--paper); font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brand b { color: var(--lime); }
.brand:hover { text-decoration: none; }
/* Logo de PIVOTEK junto al nombre del sitio (naranja sobre tinta; isotipo en pantallas angostas) */
.pvk { display: flex; align-items: center; flex: none; height: 22px; margin-left: 4px; padding-left: 16px; border-left: 1px solid var(--line); }
.pvk:hover { text-decoration: none; opacity: 0.85; }
/* Ajuste óptico: la línea base de "pivotek" y el ojo de la p del isotipo caen en la del nombre (14 px en celular, 15 px desde 720 px) */
.pvk img { display: block; transform: translateY(1px); }
.pvk .pvk-iso { transform: translateY(4px); }
@media (min-width: 720px) { .pvk img { transform: translateY(2px); } }
.pvk-iso { display: none !important; }
/* Isotipo abajo de 361 px y de 820 a 859 px, donde el menú sube a la barra y el logotipo ya no cabe */
@media (max-width: 360px), (min-width: 820px) and (max-width: 859px) { .pvk-logo { display: none !important; } .pvk-iso { display: block !important; } }
.nav { order: 3; display: flex; flex-wrap: wrap; gap: 4px 16px; width: 100%; padding: 0 0 10px; font-size: 12px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--paper); }
.gh { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink); background: var(--lime); border-radius: 999px; padding: 6px 12px; }
.gh:hover { text-decoration: none; filter: brightness(1.05); }
@media (min-width: 820px) { .top-row { flex-wrap: nowrap; } .nav { order: 0; width: auto; padding: 0; margin-left: auto; gap: 20px; font-size: 13px; } .gh { margin-left: 8px; } }

/* Hero */
.hero { padding-top: 48px; padding-bottom: 8px; }
.kicker { margin: 0 0 14px; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.dot { display: inline-block; vertical-align: 1px; margin-right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(207, 255, 69, 0.15); }
h1 { font-family: var(--sans); font-weight: 600; font-size: clamp(32px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 16px; max-width: 16ch; }
h1 em, h2 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--lime); letter-spacing: -0.01em; }
.hero-sub { font-family: var(--sans); color: #c9ccd2; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.55; max-width: 62ch; margin: 0 0 24px; }

/* Buscador */
.buscador { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 900px; }
.campo { display: flex; gap: 8px; }
.campo input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--paper); background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.campo input::placeholder { color: #8b92a1; }
.campo input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(207, 255, 69, 0.18); }
.btn { font: inherit; font-weight: 700; font-size: 13px; border-radius: 12px; border: 1px solid transparent; padding: 10px 16px; cursor: pointer; min-height: 44px; white-space: nowrap; }
.btn-lima { background: var(--lime); color: var(--ink); }
.btn-lima:hover { filter: brightness(1.06); }
.btn-borde { background: transparent; color: var(--paper); border-color: var(--line); }
.btn-borde:hover { border-color: var(--lime); color: var(--lime); }
.filtros { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 12px; color: var(--muted); }
.filtros label { display: inline-flex; align-items: center; gap: 6px; }
.filtros select, .filtros input[type="date"] { font: inherit; font-size: 12px; color: var(--paper); background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-height: 34px; }
.filtros input[type="checkbox"] { accent-color: var(--lime); width: 16px; height: 16px; }
.ejemplos { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.ejemplos button { font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 1px dashed var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.ejemplos button:hover { color: var(--lime); border-color: var(--lime); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; max-width: 900px; }
.stats div { border: 1px solid var(--ink-3); border-radius: 14px; padding: 12px 14px; background: rgba(17, 20, 27, 0.7); }
.stats dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.stats dd { margin: 2px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Secciones */
.block { padding-top: 56px; padding-bottom: 8px; scroll-margin-top: 64px; }
.block-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.num { color: var(--lime); font-size: 12px; font-weight: 700; }
h2 { font-family: var(--sans); font-weight: 600; font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; margin: 0 0 6px; }
.lead { font-family: var(--sans); color: #c9ccd2; max-width: 70ch; margin: 0 0 20px; }

/* Resultados */
.res-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.modo { font-size: 11px; color: var(--ink); background: var(--cyan); border-radius: 999px; padding: 3px 10px; font-weight: 700; }
.modo.hibrido { background: var(--lime); }
.res-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.res { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; }
.res:hover { border-color: var(--line); }
.res-cab { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cita { font-weight: 700; color: var(--paper); font-size: 15px; }
.doc { font-family: var(--sans); color: var(--muted); font-size: 13px; }
.ruta { color: #8b92a1; font-size: 11px; }
.extracto { font-family: var(--sans); color: #d6d9de; font-size: 14px; line-height: 1.6; margin: 0; overflow-wrap: anywhere; }
mark { background: rgba(207, 255, 69, 0.2); color: var(--paper); border-radius: 3px; padding: 0 2px; }
.acciones { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; }
.acciones button { font: inherit; font-size: 12px; color: var(--lime); background: none; border: 0; padding: 0; cursor: pointer; }
.acciones button:hover { text-decoration: underline; text-underline-offset: 3px; }
.vacio { color: var(--muted); font-family: var(--sans); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--muted); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.vigente { color: var(--lime); border-color: rgba(207, 255, 69, 0.35); }
.chip.nota { color: var(--amber); border-color: rgba(255, 182, 72, 0.35); }
.chip.abrogado { color: var(--coral); border-color: rgba(255, 93, 71, 0.4); }
.chip.info { color: var(--cyan); border-color: rgba(127, 216, 255, 0.35); }

/* Catálogo */
.pestanas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.pestanas button { font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; min-height: 34px; }
.pestanas button[aria-pressed="true"] { background: var(--lime); color: var(--ink); border-color: var(--lime); font-weight: 700; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tarjeta { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; align-content: start; }
.tarjeta h3 { font-size: 15px; }
.tarjeta .meta { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; }
.tarjeta button.leer { justify-self: start; font: inherit; font-size: 12px; color: var(--lime); background: none; border: 0; padding: 0; cursor: pointer; }

/* Linaje */
.linaje { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.linaje li { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 14px; padding: 12px 14px; }
@media (min-width: 760px) { .linaje li { grid-template-columns: 1fr auto 1fr; } }
.linaje .de { color: var(--coral); }
.linaje .a { color: var(--lime); }
.linaje .flecha { color: var(--muted); font-size: 12px; text-align: center; }
.linaje strong { display: block; font-family: var(--sans); font-weight: 600; color: var(--paper); font-size: 14px; }

/* Con Claude */
.pasos { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pasos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.paso { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
pre { margin: 0; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; font-size: 12px; line-height: 1.5; color: #dfe2d8; }
code { font-family: var(--mono); }
.prompts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-family: var(--sans); font-size: 14px; }
.prompts li { border-left: 2px solid var(--lime); padding-left: 10px; color: #d6d9de; }

/* Cómo funciona */
.diagrama { width: 100%; height: auto; display: block; background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius); }
.cifras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (min-width: 720px) { .cifras { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cifras div { border: 1px solid var(--ink-3); border-radius: 14px; padding: 12px 14px; background: var(--ink-2); }
.cifras dt { color: var(--muted); font-size: 11px; }
.cifras dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; color: var(--lime); }

/* Lector */
.lector { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); background: rgba(10, 12, 16, 0.97); }
.lector-cab { border-bottom: 1px solid var(--ink-3); padding: 12px var(--gutter); display: flex; gap: 12px; align-items: flex-start; }
.lector-cab > div { min-width: 0; }
.lector-cab h2 { font-size: clamp(18px, 2.4vw, 24px); overflow-wrap: anywhere; }
.lector-cab .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.cerrar { margin-left: auto; font: inherit; font-weight: 700; color: var(--ink); background: var(--lime); border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.lector-cuerpo { overflow: hidden; display: grid; grid-template-columns: 1fr; min-height: 0; }
@media (min-width: 900px) { .lector-cuerpo { grid-template-columns: 280px 1fr; } }
.lector-indice { display: none; overflow-y: auto; border-right: 1px solid var(--ink-3); padding: 12px; font-size: 12px; }
@media (min-width: 900px) { .lector-indice { display: block; } }
.lector-indice a { display: block; color: var(--muted); padding: 3px 6px; border-radius: 6px; }
.lector-indice a:hover, .lector-indice a.activo { color: var(--ink); background: var(--lime); text-decoration: none; }
.lector-texto { overflow-y: auto; padding: 16px var(--gutter) 64px; }
.unidad { max-width: 78ch; padding: 12px 0; border-bottom: 1px solid var(--ink-3); scroll-margin-top: 12px; }
.unidad h3 { font-family: var(--mono); font-size: 13px; color: var(--lime); }
.unidad .ruta { margin-bottom: 6px; }
.unidad p { font-family: var(--sans); font-size: 15px; line-height: 1.7; color: #dfe2d8; margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.unidad.destacada { background: rgba(207, 255, 69, 0.06); border-radius: 10px; padding-left: 10px; padding-right: 10px; }

/* Aviso, pie, toast */
.aviso { font-family: var(--sans); font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 12px; padding: 12px 14px; max-width: 900px; }
.pie { margin-top: 64px; border-top: 1px solid var(--ink-3); padding: 28px 0 40px; font-size: 12px; color: var(--muted); }
.pie-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .pie-grid { grid-template-columns: 2fr 1fr 1fr; } }
.pie p { margin: 0 0 8px; font-family: var(--sans); }
.firma { color: var(--paper); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; background: var(--lime); color: var(--ink); font-weight: 700; font-size: 13px; border-radius: 999px; padding: 10px 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.cargando { color: var(--muted); font-size: 12px; }
