/* Base layout: masthead, section frame, footer. Component styles live in their own files. */
* { 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: 15px;
  line-height: 1.55;
}
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.col { width: var(--col); margin: 0 auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface-raise); color: var(--text); padding: 0.5rem 0.75rem;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; z-index: 10; }

/* Masthead: the wordmark is a Block node from the explainer palette
   (dark gold fill, bright gold stroke), exactly the diagram idiom. */
.masthead { position: relative; padding: 1.2rem 0 0.9rem; text-align: center; }
.masthead .wordmark {
  display: inline-block;
  font-family: var(--body);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
  line-height: 1.05;
  color: var(--gold);
  background: var(--gold-wash);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.35rem 0.85rem;
}
.masthead .dek {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
}
.masthead .provenance {
  margin: 0.6rem 0 0;
  color: var(--faint);
  font-size: 0.8rem;
}
.masthead .provenance .mono { font-family: var(--mono); font-size: 0.75rem; }

/* Site navigation: intra-site links at the top of every page */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
  font-size: 0.82rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.15rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--line-strong);
}
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* Resources from friends: a wrapping row of little cards (miniature Container
   nodes), each one link + a tiny descriptor. The final section of the page,
   right above the footer: where a reader who has finished the instruments
   asks what else to check. */
.resources-section .section-head { justify-content: center; }
.resources-section .section-head h2 { text-align: center; }
.resources { margin: 0; }
.resources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}
.resources-list li {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.3rem 0.6rem 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}
.resources-list a { color: var(--blue); font-size: 0.76rem; }
.resources-list span { color: var(--faint); font-size: 0.66rem; }
.double-rule {
  border: 0;
  border-top: 1px solid var(--line-strong);
  margin: 0.9rem 0 0;
}

/* Dev fixture banner: first child of <main>, above the first instrument, so it
   can never contend with the nav or the wordmark for the top of the masthead.
   js/boot.js adds and removes the visible class as fixture payloads come and
   go; hidden is the default, so a build that never runs it shows nothing. */
.dev-banner { display: none; }
.dev-banner.visible {
  display: block;
  background: var(--reject-wash);
  border: 1px solid var(--reject);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.45rem 0.7rem;
  margin: 1.2rem 0 0;
}

.campaign-status {
  margin: 1.2rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--caution);
  background: var(--surface-raise);
  color: var(--muted);
  font-size: 0.84rem;
}

/* Section frame */
section.instrument { padding: 1.6rem 0 1.9rem; border-bottom: 1px solid var(--line); }
section.instrument:last-of-type { border-bottom: 0; }
.section-head {
  display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
/* The site's one uppercase label role. .section-label carries it for headings
   below h2 (the per-pool tables on the history page), so those do not restate
   the same seven declarations. */
.section-head h2,
.section-label {
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}
.section-head .spacer { flex: 1; }

/* Icon button (info modal trigger); component CSS may refine */
.icon-button {
  appearance: none; background: transparent; border: 1px solid var(--line-strong);
  border-radius: 50%; width: 1.15rem; height: 1.15rem; padding: 0;
  color: var(--faint); cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: 2px;
}
.icon-button:hover { color: var(--gold); border-color: var(--gold-dim); }
.icon-button svg { width: 0.65rem; height: 0.65rem; display: block; }

/* Pending instrument chip */
.pending-chip {
  display: inline-block;
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--faint); border: 1px dashed var(--line-strong);
  padding: 0.15rem 0.5rem; border-radius: var(--radius);
}

/* Footer */
footer.site-footer {
  padding: 1.6rem 0 2.4rem; color: var(--faint); font-size: 0.82rem;
  text-align: center;
}
footer.site-footer .rule {
  border: 0;
  border-top: 1px solid var(--line-strong);
  margin-bottom: 1rem;
}
footer.site-footer nav { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }
footer.site-footer a { color: var(--muted); }

@media (max-width: 720px) {
  body { font-size: 14px; }
  .masthead { padding-top: 1.4rem; }
}

/* Chain chips: the one orientation device used site-wide. Gold names the
   majority chain, frost names the fork, exactly the hero's color language.
   A chip is identity, not status, so it never changes with feed state. */
.chain-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--body);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  white-space: nowrap;
}
.chain-chip::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  flex: none;
}
.chain-chip--majority::before { background: var(--gold); }
.chain-chip--fork::before { background: var(--frost); }
