/* ---------------------------------------------------------------
   Initiative page template styles.
   Shares the home page's token palette and editorial voice;
   kept as a self-contained sheet so initiative pages have no
   dependency on the home page's stylesheet.
--------------------------------------------------------------- */

:root {
  --ink: #14171c;
  --ink-soft: #3a4048;
  --paper: #fbfaf7;
  --paper-alt: #f1efe8;
  --line: #dcd8cd;
  --accent: #5b2a86;
  --accent-strong: #431f61;
  --accent-tint: #efe6f7;
  --accent-2: #d6a400;
  --accent-2-strong: #8a6300;
  --accent-2-tint: #fbf0d6;
  --on-accent: #fff;
  --warn-border: #8a5a00;
  --warn-tint: #fbf1dc;

  /* Fixed brand surfaces: purple for chrome/hero backgrounds, yellow
     for buttons. Unlike --accent/--accent-2 (which flip per color
     scheme so text stays readable), these stay constant in both
     modes since they're backgrounds with their own fixed on-color
     text, not text sitting on the page's own background. */
  --brand-purple: #4a1f73;
  --brand-purple-soft: #f1e9f8;
  --on-brand-purple: #fdf9ff;
  --brand-yellow: #f0b400;
  --brand-yellow-strong: #d6a400;
  --on-brand-yellow: #241238;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;

  --wrap-max: 1140px;
  --measure: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece9e2;
    --ink-soft: #b9b6ac;
    --paper: #14161a;
    --paper-alt: #1b1e23;
    --line: #33363c;
    --accent: #c9a0f5;
    --accent-strong: #dfc4fb;
    --accent-tint: #2a1f38;
    --accent-2: #e8c34a;
    --accent-2-strong: #f2d98a;
    --accent-2-tint: #332812;
    --on-accent: #2a1338;
    --warn-border: #d9a441;
    --warn-tint: #2a2413;
    --brand-purple-soft: #241a30;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 0.6em;
}

p, li { margin: 0 0 1.1em; color: var(--ink-soft); max-width: var(--measure); }
p { text-align: justify; text-align-last: left; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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: -999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.75em 1.25em;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 24px;
}

.wrap-narrow { max-width: 760px; }

/* ---------- Header / breadcrumb / nav (no-JS mobile menu) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-purple);
  border-bottom: 3px solid var(--brand-yellow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--on-brand-purple);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 16px;
}
.brand-mark {
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--brand-yellow);
  border: 2px solid var(--on-brand-purple);
  box-sizing: border-box;
  flex: none;
}

.primary-nav {
  display: flex;
  gap: 24px;
}
.primary-nav a {
  color: var(--on-brand-purple);
  opacity: 0.85;
  text-decoration: none;
  font-size: 15px;
}
.primary-nav a:hover { color: var(--brand-yellow); opacity: 1; }

/* Mobile nav: <details>/<summary> disclosure, works with no JS */
.nav-disclosure { display: none; }
.nav-disclosure summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--on-brand-purple);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--on-brand-purple);
}
.nav-disclosure summary::-webkit-details-marker { display: none; }
.nav-disclosure[open] summary { border-color: var(--brand-yellow); color: var(--brand-yellow); }
.nav-disclosure .mobile-nav-panel {
  position: fixed;
  left: 0; right: 0;
  top: 64px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 8px 24px 16px;
  z-index: 60;
}
.nav-disclosure .mobile-nav-panel a {
  display: block;
  padding: 10px 0;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.nav-disclosure .mobile-nav-panel a:last-child { border-bottom: 0; }

.breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 8px; color: var(--line); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* ---------- Full-width hero image (About page) ---------- */

.about-hero {
  width: 100%;
  height: min(58vh, 480px);
  overflow: hidden;
  background: var(--brand-purple);
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
@media (max-width: 640px) {
  .about-hero { height: min(50vh, 380px); }
}

/* ---------- Page header block ---------- */

.page-header {
  padding: 48px 0 40px;
  background: var(--brand-purple);
  border-bottom: 4px solid var(--brand-yellow);
}
.page-header .kicker {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-yellow);
  margin-bottom: 0.9em;
}
.page-header h1 {
  color: var(--on-brand-purple);
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem);
  max-width: 22ch;
  text-wrap: balance;
}
.page-header .standfirst {
  color: var(--on-brand-purple);
  opacity: 0.88;
}
.standfirst {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.status-line {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed rgba(253, 249, 255, 0.3);
}
.status-line h2 {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-brand-purple);
  opacity: 0.75;
  margin-bottom: 0.75em;
}
.status-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 24px;
}
.status-list li {
  margin: 0;
  font-size: 0.95rem;
  color: var(--on-brand-purple);
  padding-left: 18px;
  position: relative;
}
.status-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-yellow);
  border: 1px solid var(--brand-yellow);
}
.status-list .label { font-weight: 600; }
.status-list .value { display: block; color: var(--on-brand-purple); opacity: 0.75; font-size: 0.9rem; }

/* ---------- Sections ---------- */

.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.section-alt { background: var(--brand-purple-soft); }

.section h2 {
  font-size: 1.6rem;
  max-width: 34ch;
  text-wrap: balance;
}
.section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.anchor-link {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.12s ease;
}
.section-heading:hover .anchor-link,
.anchor-link:focus-visible {
  opacity: 1;
}

/* Problem subsections */
.problem-list {
  margin-top: 8px;
  display: grid;
  gap: 32px;
}
.problem-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5em;
}

/* Method steps */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 28px;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  max-width: none;
}
.steps li::before {
  content: counter(step);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
  background: var(--accent-tint);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps h3 { font-size: 1.1rem; margin-bottom: 0.35em; }
.steps p { margin-bottom: 0; }

/* Produces */
.produces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 8px;
}
.produces-grid h3 {
  font-size: 1.05rem;
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--accent-strong);
  margin-bottom: 0.5em;
}

aside.callout {
  margin-top: 28px;
  border: 1px solid var(--warn-border);
  background: var(--warn-tint);
  border-radius: 8px;
  padding: 18px 20px;
  max-width: var(--measure);
}
aside.callout .callout-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn-border);
  margin-bottom: 0.5em;
}
aside.callout p { margin-bottom: 0; color: var(--ink); }

/* Who uses it */
.audience-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.audience-list li {
  margin: 0;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  max-width: none;
}

/* Artifacts */
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.artifact-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
.artifact-card h3 { font-size: 1.05rem; margin-bottom: 0.4em; }
.artifact-meta {
  list-style: none;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.artifact-meta li { margin: 0 0 6px; color: var(--ink-soft); max-width: none; }
.artifact-meta .k { color: var(--ink); font-weight: 600; margin-right: 6px; }
.artifact-meta .pending { font-style: italic; }

.tier-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.tier-badge.tier-1 {
  color: var(--on-brand-purple);
  border-color: var(--brand-purple);
  background: var(--brand-purple);
}
.tier-badge.tier-2 {
  color: var(--on-brand-yellow);
  border-color: var(--brand-yellow);
  background: var(--brand-yellow);
}

.tier2-note {
  margin-top: 12px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* Next steps */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn-primary { background: var(--brand-yellow); color: var(--on-brand-yellow); }
.btn-primary:hover { background: var(--brand-yellow-strong); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--accent); border-width: 2px; }
.btn-secondary:hover { background: var(--accent); color: var(--on-accent); }
.page-header .btn-secondary,
.hero .btn-secondary {
  color: var(--on-brand-purple);
  border-color: var(--on-brand-purple);
}
.page-header .btn-secondary:hover,
.hero .btn-secondary:hover {
  background: var(--on-brand-purple);
  color: var(--brand-purple);
}

/* ---------- How to Use This: routing cards, cost note, contact ---------- */

.routing-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.routing-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
}
.routing-card p { color: var(--ink); }
.routing-card strong { color: var(--ink); }
.routing-card .entry-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  text-decoration: none;
}

.note {
  margin-top: 14px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
}

.contact-email {
  font-size: 1.1rem;
  font-weight: 600;
}
.contact-email a { text-decoration: none; }
.contact-email a:hover { text-decoration: underline; }

/* ---------- Registry: tables, hashes, filters, version banner ---------- */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--paper-alt);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--ink);
}

.table-scroll {
  overflow-x: auto;
  margin-top: 16px;
}
.registry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.registry-table th,
.registry-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.registry-table th {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.registry-table .muted { color: var(--ink-soft); }
.registry-table.hash-table .hash-cell code {
  word-break: break-all;
  white-space: normal;
  display: inline-block;
  max-width: 42ch;
}

.filter-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.filter-list li { margin: 0; max-width: none; color: var(--ink-soft); }
.filter-label { font-weight: 600; color: var(--ink); margin-right: 4px; }
.filter-list a { text-decoration: none; }
.filter-list a.active {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}

.version-banner {
  background: var(--warn-tint);
  border-top: 1px solid var(--warn-border);
  border-bottom: 1px solid var(--warn-border);
  padding: 14px 0;
}
.version-banner p {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  max-width: none;
}
.version-banner p + p { margin-top: 6px; }

.readme-body h4, .readme-body h5, .readme-body h6 {
  font-family: var(--font-sans);
  font-size: 1rem;
  margin: 1.2em 0 0.5em;
}
.readme-body h4:first-child { margin-top: 0; }
.readme-body ul { margin: 0 0 1.1em; padding-left: 1.3em; color: var(--ink-soft); }
.readme-body li { margin-bottom: 0.4em; }
.readme-body p { color: var(--ink-soft); }

.verify-line {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- Initiatives index ---------- */

.initiative-index-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}
.initiative-entry {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 28px;
  display: grid;
  gap: 10px;
}
.initiative-entry .eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.initiative-entry h2 { font-size: 1.3rem; margin-bottom: 0; }
.initiative-entry .audience { font-size: 0.92rem; }
.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}
.status-pill.available { color: var(--on-brand-purple); background: var(--brand-purple); border: 1px solid var(--brand-purple); }
.status-pill.in-preparation { color: var(--ink-soft); background: var(--paper-alt); border: 1px solid var(--line); }
.initiative-entry .entry-link { font-weight: 600; text-decoration: none; margin-top: 6px; }

/* ---------- Footer ---------- */

.site-footer { padding: 36px 0; background: var(--brand-purple); border-top: 3px solid var(--brand-yellow); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; }
.footer-nav a { color: var(--on-brand-purple); opacity: 0.85; text-decoration: none; font-size: 14px; }
.footer-nav a:hover { color: var(--brand-yellow); opacity: 1; }

/* Print-only citation footer; hidden on screen, shown in print.css */
.print-citation { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .primary-nav { display: none; }
  .nav-disclosure { display: block; position: relative; }
  .page-header { padding: 36px 0 28px; }
  .section { padding: 40px 0; }
  .steps li { grid-template-columns: 36px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .anchor-link { transition: none; }
}
