/* get.hlthy.cc — campaign hub shared styles.
 * Imported by every page. Defines palette, page chrome, typography
 * primitives, status dots/badges, and the stale banner. Pages add their
 * own block-level styles after this import — they should not redefine
 * :root, body, .page, header.top/footer.bottom, or .crumb. */

:root {
  /* -- surface -- */
  --paper:   #f6f1e3;   /* page background — warm book paper */
  --paper-2: #eee5cf;   /* panel / row background */
  --paper-3: #e4d9bc;   /* inset well, table stripe */

  /* -- ink -- */
  --ink:    #201d16;    /* primary text */
  --ink-2:  #4a4536;    /* secondary text */
  --mute:   #837a63;    /* tertiary / meta text */
  --mute-2: #a89c7c;    /* faint / disabled */

  /* -- rule -- */
  --hair:   color-mix(in srgb, var(--ink) 20%, transparent);
  --hair-2: color-mix(in srgb, var(--ink) 12%, transparent);

  /* -- accent + status ladder -- */
  --link:  #0b4ea0;   /* hyperlink blue */
  --brick: #a8431f;   /* primary accent — testing / built / hover */
  --good:  #3c7a34;   /* live / verified / pass */
  --bad:   #a3241a;   /* broken / fail */
  --live:  #1f5c99;   /* live-but-not-verified step */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  font-feature-settings: "tnum" 1;
}
.sans { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.meta {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Prose links get the classic underline; nav/structural links opt out. */
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent); text-underline-offset: 0.15em; }
a:hover { color: var(--brick); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px;
}

/* -- page chrome, shared across every page -- */
.page { max-width: 1100px; margin: 0 auto; padding: 1.2rem clamp(1rem, 2.5vw, 1.6rem) 2.4rem; }
.page.wide { max-width: 1320px; }
.page.narrow { max-width: 880px; }

header.top, footer.bottom {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
header.top {
  padding-bottom: 0.8rem; border-bottom: 1px solid var(--hair); margin-bottom: 1.4rem;
}
footer.bottom {
  margin-top: 2.4rem; padding-top: 0.8rem; border-top: 1px solid var(--hair);
}
footer.bottom .crumb { color: var(--mute); }

.crumb {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--mute);
}
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--brick); }
.crumb .sep { color: var(--mute-2); padding: 0 0.4em; }

/* -- headings shared scale -- */
h1 {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 750; line-height: 1.05; letter-spacing: -0.02em;
  font-size: clamp(1.5rem, 3.5vw, 2rem); color: var(--ink); margin: 0;
}
h2 {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 650; font-size: 1.05rem; color: var(--ink); margin: 0;
}

/* -- buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--hair);
  border-radius: 2px; font-family: ui-monospace, monospace; font-size: 0.74rem;
  letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; text-decoration: none;
}
.btn:hover, .btn:focus-visible { border-color: var(--brick); color: var(--brick); outline: none; }
.btn.primary { border-color: var(--brick); color: var(--brick); background: color-mix(in srgb, var(--brick) 8%, var(--paper-2)); }
.btn.primary:hover { background: color-mix(in srgb, var(--brick) 16%, var(--paper-2)); }

/* -- generic data table -- */
table { border-collapse: collapse; width: 100%; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Stale banner — appears at the top of every page if status.json is >2h old. */
.stale-banner {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 1rem;
  background: color-mix(in srgb, var(--brick) 12%, var(--paper));
  border-bottom: 1px solid var(--brick);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
}
.stale-banner .stale-dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--brick); flex: 0 0 auto;
}
.stale-banner .stale-text strong { color: var(--brick); }

/* -- status dot — small colour indicator next to step labels -- */
.dot {
  display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  vertical-align: middle; margin-right: 0.45rem; background: var(--mute); flex: 0 0 auto;
}
.dot.dot-missing  { background: var(--mute-2); }
.dot.dot-template { background: var(--mute); outline: 1px dashed var(--mute-2); }
.dot.dot-built    { background: var(--brick); }
.dot.dot-live     { background: var(--live); }
.dot.dot-verified { background: var(--good); }
.dot.dot-broken   {
  background: var(--bad);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent);
  animation: dot-pulse 2s ease-out infinite;
}
.dot.dot-lg { width: 0.8rem; height: 0.8rem; }
@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); }
  70%  { box-shadow: 0 0 0 0.5rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.dot-broken { animation: none; }
}

/* -- step matrix — 7 small squares, one per funnel step, CPAN-testers-grid
      style. Shared between the index listing and campaign hubs. -- */
.matrix { display: inline-flex; gap: 2px; vertical-align: middle; }
.matrix .cell {
  width: 0.85rem; height: 0.85rem; border: 1px solid var(--hair);
  background: var(--paper-3);
}
.matrix .cell.missing  { background: var(--paper-3); border-color: var(--hair); }
.matrix .cell.template { background: var(--mute-2); border-color: var(--mute-2); }
.matrix .cell.built    { background: var(--brick); border-color: var(--brick); }
.matrix .cell.live     { background: var(--live); border-color: var(--live); }
.matrix .cell.verified { background: var(--good); border-color: var(--good); }
.matrix .cell.broken   { background: var(--bad); border-color: var(--bad); }

/* -- status badge — inline text label, used in headers + listings -- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.14rem 0.5rem; border: 1px solid var(--hair); border-radius: 2px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); background: var(--paper-2);
}
.badge .badge-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--mute); }
.badge.badge-draft    .badge-dot { background: var(--mute); }
.badge.badge-testing  { border-color: color-mix(in srgb, var(--brick) 45%, var(--hair)); }
.badge.badge-testing  .badge-dot { background: var(--brick); }
.badge.badge-live     { border-color: color-mix(in srgb, var(--good) 45%, var(--hair)); }
.badge.badge-live     .badge-dot { background: var(--good); }
.badge.badge-paused   .badge-dot { background: var(--mute-2); }
