/* Lufox tokens (lufox-branding colors.md): separate light/dark values and AAA
 * text roles. Link and label text is ink, not brand blue: the contrast gate
 * requires 7:1 and #2563EB reaches 5.17:1 on white. Brand blue stays for focus
 * rings, borders and chart marks. #2A2D34 (dark raised surface) is derived;
 * the skill has no token for it. */
:root {
  --nr-primary:#2563EB; --nr-accent:#2563EB; --nr-text:#3D4048;
  --bg:#FFFFFF; --bg-surface:#FFFFFF; --bg-surface-2:#F5F3EE;
  --fg:#15171C; --fg-muted:#3D4048; --border:#15171C1F; --border-strong:#5F626A;
  --accent:var(--nr-primary); --accent-2:var(--nr-accent);
  --accent-ink:#15171C; --accent-2-ink:#15171C;
  --accent-fill:#15171C; --accent-fill-hover:#3D4048; --on-accent-fill:#FFFFFF;
  --hero-bg:#15171C; --focus:#2563EB;
}
@media screen and (prefers-color-scheme:dark) { :root:not([data-theme="light"]) {
  --bg:#15171C; --bg-surface:#1F2228; --bg-surface-2:#2A2D34;
  --fg:#F5F3EE; --fg-muted:#C5C7CC; --border:#F5F3EE29; --border-strong:#9A9DA4;
  --accent-ink:#F5F3EE; --accent-2-ink:#F5F3EE;
  --accent-fill:#F5F3EE; --accent-fill-hover:#C5C7CC; --on-accent-fill:#15171C;
  --hero-bg:#1F2228; --focus:#60A5FA;
} }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media screen { :root[data-theme="dark"] {
  --bg:#15171C; --bg-surface:#1F2228; --bg-surface-2:#2A2D34;
  --fg:#F5F3EE; --fg-muted:#C5C7CC; --border:#F5F3EE29; --border-strong:#9A9DA4;
  --accent-ink:#F5F3EE; --accent-2-ink:#F5F3EE;
  --accent-fill:#F5F3EE; --accent-fill-hover:#C5C7CC; --on-accent-fill:#15171C;
  --hero-bg:#1F2228; --focus:#60A5FA;
} }
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* Links share the ink colour of the text around them, so colour cannot mark
 * them: every link in the page body is underlined. Buttons keep their own
 * shape and the shared header styles its own links. */
a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 {
  font-family: Manrope, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  margin: 0 0 .5rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.site-footer {
  border-top: 1px solid #F5F3EE29;
  padding: 32px 0;
  background:#15171C;
  color:#F5F3EE;
  --fg-muted:#F5F3EE; --accent-ink:#F5F3EE; --focus:#60A5FA;
  font-size: .875rem;
  margin-top: 3rem;
}

.scope-toggle {
  display: flex;
  gap: .5rem;
  margin: 1.5rem 0 1rem;
  flex-wrap: wrap;
}

.toggle {
  background: var(--bg-surface);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  padding: .5rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}

.toggle.active {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-accent-fill);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: .75rem;
  margin-bottom: 2rem;
}

.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.kpi .kpi-label {
  color: var(--fg-muted);
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.kpi .kpi-value {
  font-size: 1.75rem;
  margin-top: .25rem;
  font-family: Manrope, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.card h3 { color: var(--accent-ink); }
.card .stat { display: flex; justify-content: space-between; padding: .125rem 0; font-size: .9rem; }
.card .stat span:first-child { color: var(--fg-muted); }

.chart-section { margin: 2rem 0; }
.chart-note { color: var(--fg-muted); font-size: .875rem; }
.chart-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  height: 320px;
}

.filter-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.filter-bar input[type="search"] {
  flex: 1;
  min-width: 200px;
  background: var(--bg-surface);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  padding: .5rem .75rem;
  border-radius: 10px;
  font: inherit;
}

.filter-bar label { color: var(--fg-muted); cursor: pointer; }

.table-wrap {
  max-width:100%;
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

th, td {
  padding: .5rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  background: var(--bg-surface-2);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--fg-muted);
  position: sticky;
  top: 0;
}

th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }

tbody tr:hover { background: var(--bg-surface-2); }

.pill {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--bg-surface-2);
  color: var(--fg-muted);
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Opaque, not translucent. A translucent pill takes the colour of whatever is
 * behind it, so it shifts on a hovered row and no tool can state its contrast
 * without knowing the parent — these are the values the tint composited to over
 * --bg-surface-2, so they look the same and are now decidable. */
.pill.typo3 { background:var(--bg-surface-2); color:var(--fg); }
.pill.skill { background:var(--bg-surface-2); color:var(--fg); }
.pill.go { background:var(--bg-surface-2); color:var(--fg); }
.pill.commerce { background:var(--bg-surface-2); color:var(--fg); }
.pill.ansible { background:var(--bg-surface-2); color:var(--fg); }
.pill.tool { background:var(--bg-surface-2); color:var(--fg); }

.muted { color: var(--fg-muted); }

#repo-detail {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

#repo-detail h2 { color: var(--accent-ink); }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.detail-grid .card h4 { margin: 0 0 .5rem; color: var(--accent-2-ink); font-size: .875rem; text-transform: uppercase; letter-spacing: .05em; }

.referrer-list { margin: 0; padding-left: 1rem; }
.referrer-list li { font-size: .875rem; }

/* ── Local brand fonts ──────────────────────────────────────────────────────
   Lufox fonts for the page body and the shared site shell (Manrope, IBM Plex
   Sans; SIL OFL 1.1, licences next to the files). Served from this origin: no
   third-party font request. */
@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

/* ── Layout added by the static rebuild ─────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1100;
  background: var(--accent-fill);
  color: var(--on-accent-fill);
  padding: .5rem 1rem;
  border-radius: 10px;
}

main > section { margin: 2.5rem 0; scroll-margin-top: 1rem; }
main > section > h2 { font-size: 1.4rem; }

.hero h1 { font-size: 2rem; }
.lead { font-size: 1.05rem; color: var(--fg); max-width: 70ch; }
.hint, .meta { color: var(--fg-muted); font-size: .875rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--fg); }
.btn-primary {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-accent-fill);
}
.btn-primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: var(--on-accent-fill); }

.prose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}
.prose-grid h3 { font-size: 1rem; color: var(--accent-ink); margin-top: 1.25rem; }
.prose-grid h3:first-child { margin-top: 0; }
.prose-grid ul { margin: 0; padding-left: 1.1rem; }
.prose-grid li { margin-bottom: .4rem; }

/* An estimate must never be read as a measurement. */
.warning {
  border: 1px solid var(--border);
  border-radius:16px;
  padding:1rem;
  padding-left: .9rem;
  color: var(--fg);
  max-width: 70ch;
}

.notice {
  background: var(--bg-surface);
  border: 1px solid var(--border);

  border-radius: 10px;
  padding: .75rem 1rem;
}

.formula { width: 100%; table-layout:fixed; margin-top: .5rem; }
.formula td { border-bottom: 1px solid var(--border); }
.formula th, .formula td { white-space:normal; }
.formula th { width:80%; position:static; background:transparent; }

.kpis dt, .kpis dd { margin: 0; }
.card dl { margin: 0; }
.card .stat dt, .card .stat dd { margin: 0; }

.breadcrumb { color: var(--fg-muted); font-size: .875rem; margin-bottom: 1rem; }

.link-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.link-list li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.snapshot-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0 1rem;
}

.citation {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .875rem;
  max-width: 80ch;
}

.chart-data { margin-top: 1rem; }
.chart-data summary { cursor: pointer; color: var(--accent-ink); min-height: 44px; display: flex; align-items: center; }

/* Rows link out through their first cell; the row itself is not clickable, so
   the pointer cursor moves to the sortable headers. The base rule above set it
   on the row. */
th[data-sort] { cursor: pointer; }
th[data-sort][aria-sort="descending"]::after { content: " ▾"; }
th[data-sort][aria-sort="ascending"]::after { content: " ▴"; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

body { overflow-wrap:anywhere; }
main *, .grid > * { min-width:0; }
button, input, select { min-height:48px; border-color:var(--border-strong); font-family:'IBM Plex Sans',system-ui,sans-serif; }
.table-wrap:focus-visible, :focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
/* Title panel of repository and snapshot pages, matching the shared .nr-hero:
 * ink (dark: #1F2228) with white text, white outline buttons and a white
 * primary button. No gradient. */
.hero { background:var(--hero-bg); color:#FFFFFF; --fg:#FFFFFF; --fg-muted:#FFFFFF; --accent-ink:#FFFFFF; --bg-surface:var(--hero-bg); --bg-surface-2:#2A2D34; --border:#F5F3EE29; --border-strong:#FFFFFF; --accent-fill:#FFFFFF; --accent-fill-hover:#F5F3EE; --on-accent-fill:#15171C; --focus:#FFFFFF; padding:32px; border-radius:24px; }
.hero h1,.hero p { color:#FFFFFF; }
.hero .btn { border-color:#FFFFFF; }
.hero .btn:hover { color:#15171C; background:#F5F3EE; border-color:#F5F3EE; }
.site-footer p { color:#F5F3EE; }
.warning,.notice { background:var(--bg-surface); }
@media(max-width:760px) {
 .container { padding:16px; }
 .hero { padding:24px 16px; }
 .hero h1 { font-size:1.75rem; }
 .cta-row { flex-direction:column; align-items:stretch; }
 .btn { justify-content:center; white-space:normal; }
}

html { scroll-padding-top:88px; }
@media(max-width:1023.98px) { html { scroll-padding-top:80px; } }
