/* The Normie Party — site styles
 *
 * Mainstream, approachable, readable on a phone. The brand cue is
 * trustworthiness, not novelty: system fonts, generous whitespace,
 * one accent color. Resist the urge to be visually interesting.
 */

:root {
  --bg: #fafaf7;
  --bg-elevated: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #555555;
  --rule: #e3e1da;
  --accent: #355c7d;        /* muted slate-blue — non-partisan */
  --accent-soft: #d8e2ea;
  --good: #2c7a4b;
  --pending: #c08a00;
  --link: #355c7d;
  --link-hover: #1b3a5a;
  --max-width: 760px;
  --radius: 6px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto,
               "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ---- Top nav ---- */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top-nav .brand-group {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 0.15rem;
}

.top-nav .brand {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.top-nav .version {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

.top-nav .version .channel {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pending);
  font-style: normal;
}

a.brand {
  text-decoration: none;
  color: inherit;
}

.top-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.top-nav a:hover { color: var(--link-hover); }

/* ---- Hero ---- */

.hero {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.4rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.hero .thesis {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--accent);
  margin: 0 0 1rem;
}

.hero .lede {
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin: 0;
}

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

section {
  margin-top: 3rem;
}

h2 {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

p { margin: 0.75rem 0; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* ---- Principles grid ---- */

.principle-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .principle-grid { grid-template-columns: 1fr 1fr; }
}

.principle {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.principle h3 {
  margin-top: 0;
  color: var(--accent);
}

/* ---- Platform ---- */

.focus { padding-left: 1.25rem; }
.focus li { margin-bottom: 0.6rem; }

.outcomes {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.outcomes th,
.outcomes td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.outcomes th {
  background: var(--accent-soft);
  font-weight: 600;
}

.outcomes td:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.note {
  font-size: 0.9rem;
  color: var(--ink-muted);
  padding: 0.75rem 1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-top: 1.5rem;
}

/* ---- Progress staircase ---- */

.progress-bar {
  margin: 1rem 0 1.5rem;
}

.progress-label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.progress-track {
  display: block;
  height: 12px;
  background: var(--rule);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.checklist {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.checklist li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.75rem;
  line-height: 1.5;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--ink-muted);
  border-radius: 3px;
  background: var(--bg-elevated);
}

.checklist li.done {
  color: var(--ink-muted);
  text-decoration: line-through;
}

.checklist li.done::before {
  background: var(--good);
  border-color: var(--good);
  /* checkmark via box-shadow inset */
  box-shadow: inset 0 0 0 2px var(--bg-elevated), inset 0 0 0 14px var(--good);
}

/* ---- Vertical timeline (org-maturity staircase) ---- */

.timeline {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.tl-item {
  position: relative;
  padding-left: 2.25rem;
  padding-bottom: 0.4rem;
}

/* The spine: a vertical line in the gutter behind the markers, from each
   marker to the next. Coloured by status: done = accent, else muted. */
.tl-item::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 1.5rem;
  bottom: -0.4rem;
  width: 2px;
  background: var(--rule);
}

.tl-item:last-child::before { display: none; }
.tl--done::before { background: var(--accent); }

.tl-marker {
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  color: #fff;
  z-index: 1;
}

.tl--done .tl-marker { background: var(--good); border-color: var(--good); }
.tl--in_progress .tl-marker {
  border-color: var(--pending);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tl-summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0;
  cursor: pointer;
  list-style: none;
}

.tl-summary::-webkit-details-marker { display: none; }
.tl-summary:hover .tl-name { color: var(--link-hover); }

.tl-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.tl-name { font-weight: 600; }
.tl--in_progress .tl-name { color: var(--pending); }

.tl-body { padding: 0 0 0.5rem 0; }

.tl-goal {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin: 0.2rem 0 0.6rem;
}

/* ---- Accordion (Party Planks System track) ----
   Per section: progress bar on top (always visible), then title row
   (always visible); expands to Goal + checklist. */

.track {
  margin: 1rem 0 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.acc {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-elevated);
}

.acc:last-child { border-bottom: none; }

.acc-summary {
  display: block;
  padding: 0.7rem 1rem;
  cursor: pointer;
  list-style: none;
}

.acc-summary::-webkit-details-marker { display: none; }
.acc-summary:hover { background: var(--accent-soft); }

.acc-bar {
  display: block;
  width: 100%;
  height: 4px;
  margin-bottom: 0.5rem;
}

.acc-titlerow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.acc-titlerow::before {
  content: "\25B8";
  color: var(--ink-muted);
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}

.acc[open] .acc-titlerow::before { transform: rotate(90deg); }

.acc-body { padding: 0 1rem 0.9rem 1rem; }

.acc-body .stage-goal {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin: 0.2rem 0 0.6rem;
}

.stage-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--ink-muted);
  background: var(--accent-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.stage-name { font-weight: 600; flex: 1; }
.stage-check { color: var(--good); font-weight: 700; }

.stage-count {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.acc--done .stage-id { background: var(--good); color: #fff; }
.acc--in_progress .stage-id { background: var(--pending); color: #fff; }

/* ---- PFE show/hide panel (planks page) ---- */

.pfe-panel {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  background: var(--bg-elevated);
}

.pfe-panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
}

.pfe-panel-summary::-webkit-details-marker { display: none; }
.pfe-panel-summary:hover { background: var(--accent-soft); }

.pfe-panel-title { font-weight: 600; }

.pfe-panel-hint { font-size: 0.85rem; color: var(--ink-muted); }
.pfe-panel-hint::before { content: "\25B8 "; }
.pfe-panel[open] .pfe-panel-hint { visibility: hidden; }

.pfe-panel-body { padding: 0 1rem 1rem 1rem; }

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

footer {
  max-width: var(--max-width);
  margin: 4rem auto 2rem;
  padding: 1.5rem 1.25rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ---- Planks page ---- */

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

.filters {
  margin: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
  min-width: 4.5rem;
}

.filter-count {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-left: 0.5rem;
}

.chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.2;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--link);
  text-decoration: none;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--link-hover);
}

.chip--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip--clear {
  color: var(--ink-muted);
  border-style: dashed;
}

.chip--sm {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
}

.plank-search {
  width: 100%;
  max-width: 28rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--ink);
}

.plank-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.planks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plank {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  scroll-margin-top: 5rem; /* so #anchor jumps clear the sticky nav */
}

.plank-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.plank-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--ink-muted);
  background: var(--accent-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.plank-title {
  margin: 0;
  font-size: 1.15rem;
  flex: 1;
}

.plank-title a {
  color: var(--ink);
  text-decoration: none;
}

.plank-title a:hover { color: var(--link-hover); }

.badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.badge--DRAFT {
  background: #fdf3d8;
  color: #8a6400;
}

.badge--RATIFIED {
  background: #d9f0e1;
  color: var(--good);
}

.plank-position {
  margin: 0.75rem 0;
}

.plank-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  margin: 0;
  font-size: 0.95rem;
}

.plank-meta dt {
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0.15rem;
}

.plank-meta dd {
  margin: 0;
}

.no-results {
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 1.5rem;
}

/* ---- Progress bar (SVG; no inline styles, CSP-safe) ---- */

.progress-svg {
  display: block;
  width: 100%;
  height: 12px;
  margin-top: 0.4rem;
}

.progress-track-bg { fill: var(--rule); }
.progress-fill-bar { fill: var(--accent); }

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

.footer-links {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--link);
  text-decoration: none;
}

.footer-links a:hover { color: var(--link-hover); text-decoration: underline; }

/* ---- Metrics page ---- */

.bignum {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1.5rem;
}

.bignum-label {
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0;
}

.chart-figure {
  margin: 1.5rem 0;
  overflow-x: auto;
}

.chart {
  display: block;
  height: 140px;
}

.chart-bar {
  fill: var(--accent);
}

.chart-bar:hover { fill: var(--link-hover); }

.chart-figure figcaption {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.4rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.data-table th {
  background: var(--accent-soft);
  font-weight: 600;
}

.empty-state {
  color: var(--ink-muted);
  font-style: italic;
}

/* ---- Legal / prose pages (privacy, terms) ---- */

.prose {
  max-width: 65ch;
}

.prose h2 {
  font-size: 1.2rem;
  border: none;
  display: block;
  margin-top: 1.75rem;
  margin-bottom: 0.4rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin: 0.3rem 0;
}
