/* Gap Hunter Labs -- home (index.html and es/index.html).
   Rewritten 2026-10-18 for the "engineering notebook" redesign. The old
   sheet (2,971 lines, ~40% unused) carried the catalog dashboard, the
   slider and several earlier redesigns; none of it is used by the new
   home. Fonts, colors and radii come from /css/theme.css; header, footer,
   search modal and shared components from /css/shell.css. */

* { box-sizing: border-box; }

html { scrollbar-color: var(--border) var(--bg); scrollbar-width: thin; }

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

.wrap {
  max-width: var(--page-max, 1180px);
  margin: 0 auto;
  padding: 0 var(--page-pad, 24px) 56px;
}

#top, #work, #engineering, #services, #tools, #catalog, #about { scroll-margin-top: 80px; }

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0 0.2em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}
a { color: inherit; }
a:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---- Buttons: ink on paper, no lift, no glow ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: 600 14px/1.2 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { border-color: var(--text); background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---- Shared editorial pieces --------------------------------------------- */
.nb-label {
  font: 600 12px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nb-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.nb-more { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 15px; }
.nb-more a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.nb-more a:hover { text-decoration-thickness: 2px; }
.nb-step { font: 500 13px/1 var(--mono); color: var(--text-dim); }

/* ---- Hero: statement + margin note, on the page itself -------------------- */
.nb-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px 56px;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}
.nb-kicker { font: 500 13px/1.4 var(--mono); color: var(--text-dim); }
.nb-hero-title {
  margin-top: 18px;
  max-width: 27ch;
  font: 600 clamp(30px, 3.8vw, 46px)/1.1 var(--serif);
  letter-spacing: -0.015em;
}
.nb-lede { margin-top: 22px; max-width: 64ch; font-size: 18px; line-height: 1.65; color: var(--text-dim); }
.nb-hero .nb-actions { margin-top: 32px; }

.nb-margin {
  align-self: end;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}
.nb-method-mini { list-style: none; padding: 0; display: grid; gap: 10px; font: 600 15px/1.3 var(--sans); }
.nb-method-mini li { display: flex; gap: 12px; align-items: baseline; }
.nb-margin-note { margin-top: 20px; font: 400 13px/1.55 var(--mono); color: var(--text-dim); }

/* ---- Sections ------------------------------------------------------------- */
.nb-section { padding: 64px 0; border-bottom: 1px solid var(--border); }
.nb-section-head { display: grid; gap: 8px; max-width: 72ch; margin-bottom: 36px; }
.nb-section-head h2 { font: 600 clamp(26px, 3vw, 36px)/1.15 var(--serif); letter-spacing: -0.01em; }
.nb-section-lede { color: var(--text-dim); }

/* ---- Investigations: ledger rows with a metadata margin ------------------- */
.inv {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px 40px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.inv-meta { display: grid; gap: 6px; align-content: start; font: 400 13px/1.5 var(--mono); color: var(--text-dim); }
.inv-no { color: var(--text-faint); }
.inv-id { font-size: 15px; font-weight: 600; color: var(--text); }
.inv-id a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.inv-status {
  display: inline-block;
  justify-self: start;
  padding-left: 10px;
  border-left: 3px solid var(--border-strong);
  font: 500 13px/1.45 var(--mono);
  color: var(--text-dim);
}
.inv-status.is-open { border-left-color: var(--inspect-line); }
.inv-status.is-fixed { border-left-color: var(--valid-line); color: var(--valid); }

.inv-body h3 { font: 600 21px/1.3 var(--sans); letter-spacing: -0.005em; }
.inv-facts { display: grid; gap: 14px; margin-top: 18px; }
.inv-facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 20px; }
.inv-facts dt { font: 600 12px/1.9 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.inv-facts dd { max-width: 70ch; }
.inv-links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 18px; font-size: 15px; }
.inv-links a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.inv-links a:hover, .inv-id a:hover { text-decoration-thickness: 2px; }

/* Measurements: amber = the bottleneck as found, green = the result after
   the fix. Never color alone: the sentence always says which is which. */
.m-before, .m-after, .m-neutral {
  font: 600 0.95em var(--mono);
  white-space: nowrap;
  padding: 0 0.25em;
  border-radius: var(--radius-sm);
}
.m-before { color: var(--inspect); background: var(--inspect-bg); }
.m-after { color: var(--valid); background: var(--valid-bg); }
.m-neutral { color: var(--text); background: var(--surface-2); }

.nb-record { padding-top: 28px; border-top: 1px solid var(--border); }
.nb-record ul { list-style: none; padding: 0; display: grid; gap: 12px; margin: 14px 0 24px; }
/* Block, not grid: the text after the link is a bare text node and would
   become its own grid cell. The status label sits in the left gutter. */
.nb-record li { position: relative; padding-left: 96px; max-width: 100ch; }
.nb-record li > .inv-status { position: absolute; left: 0; top: 0.15em; }
.nb-record li > a { text-decoration: underline; text-underline-offset: 0.2em; }

/* ---- Method --------------------------------------------------------------- */
.nb-steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--text);
  margin-bottom: 32px;
}
.nb-steps li { padding: 20px 28px 4px 0; display: grid; gap: 8px; align-content: start; }
.nb-steps li + li { padding-left: 28px; border-left: 1px solid var(--border); }
.nb-steps h3 { font: 600 20px/1.3 var(--serif); }
.nb-steps p { color: var(--text-dim); }

/* ---- Services: a real table ---------------------------------------------- */
.nb-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.nb-table th, .nb-table td { padding: 16px 20px 16px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.nb-table thead th { padding-top: 0; font: 600 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); border-bottom-color: var(--text); }
.nb-table tbody th { width: 26%; font-weight: 600; }
.nb-table tbody th a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.nb-table td { color: var(--text-dim); }
.nb-table .nb-terms { width: 22%; padding-right: 0; font: 400 13px/1.55 var(--mono); color: var(--text); }

.nb-engage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; margin-top: 44px; }
.nb-engage h3 { font: 600 20px/1.3 var(--serif); margin-bottom: 14px; }
.nb-start ol { padding-left: 1.3em; display: grid; gap: 10px; margin-bottom: 24px; }
.nb-start ol li::marker { font-family: var(--mono); color: var(--text-dim); }
.nb-about { padding-left: 32px; border-left: 1px solid var(--border); }
.founder-bio { line-height: 1.65; }
.founder-meta { margin: 14px 0 16px; font: 400 13px/1.6 var(--mono); color: var(--text-dim); }

/* ---- Tools ---------------------------------------------------------------- */
.nb-tools { display: grid; border-top: 1px solid var(--border); }
.tool {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px 40px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.tool-name { font: 600 19px/1.3 var(--sans); }
.tool-name a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.tool-name a:hover { text-decoration-thickness: 2px; }
.tool-meta { margin-top: 6px; font: 400 13px/1.5 var(--mono); color: var(--text-dim); }
/* The label column is as wide as the longest label ("Corrección" in /es/ needs ~79px), shared by both rows. */
.tool-facts { display: grid; grid-template-columns: minmax(48px, max-content) minmax(0, 1fr); gap: 10px 16px; }
.tool-facts > div { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
.tool-facts dt { font: 600 12px/1.9 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.tool-facts dt.is-gap { color: var(--inspect); }
.tool-facts dt.is-fix { color: var(--valid); }
.tool-facts dd { max-width: 70ch; color: var(--text-dim); }

/* ---- Catalog: one line and a way in --------------------------------------- */
.nb-catalog {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px 48px;
  padding: 56px 0 8px;
}
.nb-catalog h2 { margin-top: 8px; font: 600 clamp(24px, 2.6vw, 30px)/1.2 var(--serif); }
.nb-catalog-line { margin-top: 10px; max-width: 72ch; color: var(--text-dim); }

/* ---- Narrow screens -------------------------------------------------------- */
@media (max-width: 960px) {
  .nb-hero { grid-template-columns: 1fr; padding-top: 48px; }
  .nb-margin { align-self: start; }
  .inv, .tool { grid-template-columns: 1fr; }
  .inv-meta { grid-template-columns: auto auto; justify-content: start; column-gap: 20px; }
  .inv-meta .inv-scope, .inv-meta .inv-status { grid-column: 1 / -1; }
  .nb-steps { grid-template-columns: 1fr; }
  .nb-steps li, .nb-steps li + li { padding: 18px 0; border-left: 0; }
  .nb-steps li + li { border-top: 1px solid var(--border); }
  .nb-engage { grid-template-columns: 1fr; }
  .nb-about { padding-left: 0; padding-top: 28px; border-left: 0; border-top: 1px solid var(--border); }
  .nb-catalog { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 16px 40px; }
  .nb-section { padding: 48px 0; }
  .nb-lede { font-size: 17px; }
  .tool-facts { grid-template-columns: minmax(0, 1fr); }
  .inv-facts > div, .tool-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .nb-record li { padding-left: 0; }
  .nb-record li > .inv-status { position: static; display: block; width: max-content; margin-bottom: 4px; }
  .nb-table thead { display: none; }
  .nb-table, .nb-table tbody, .nb-table tr, .nb-table th, .nb-table td { display: block; width: auto; }
  .nb-table tr { padding: 16px 0; border-bottom: 1px solid var(--border); }
  .nb-table tbody th, .nb-table td, .nb-table .nb-terms { width: auto; padding: 0; border: 0; }
  .nb-table td { margin-top: 6px; }
  .nb-table .nb-terms { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
