/* ============================================================
   PARTISANS OF THE COLLECTIVE — stylesheet
   Design language: minimal, flat, quiet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #171614;
  --paper: #fbfaf7;
  --paper-2: #f1efe9;
  --red: #a3181e;
  --muted: #6f6b62;
  --line: #e2ded3;
  --shadow: rgba(23, 22, 20, 0.08);

  --display: 'Inter', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html[data-theme="dark"] {
  --ink: #f3f1ea;
  --paper: #15140f;
  --paper-2: #1d1c16;
  --red: #e0565b;
  --muted: #a49e8f;
  --line: #322f27;
  --shadow: rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: var(--red); }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- utility bar (CPUSA-style) ---------- */
.utilitybar {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12.5px;
}
.utilitybar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 10px;
  flex-wrap: wrap;
}
.utilitybar a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(251,250,247,0.4);
}
.utilitybar a:hover { border-color: var(--paper); }

/* ---------- nav ---------- */
.sitenav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  transition: box-shadow 0.2s ease;
}
.sitenav.scrolled {
  box-shadow: 0 2px 10px var(--shadow);
}
.sitenav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 26px;
  height: 26px;
  display: block;
}
.nav-links {
  display: flex;
  gap: 26px;
}
.nav-links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover { color: var(--ink); }

.nav-cta {
  background: var(--red);
  color: var(--paper) !important;
  padding: 7px 16px;
  border-radius: 3px;
  font-weight: 600;
}
.nav-cta:hover { background: #7f1216; }

/* ---------- settings menu ---------- */
.settings-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}
.settings-btn:hover { color: var(--ink); border-color: var(--muted); }
.settings-btn[aria-expanded="true"] { transform: rotate(20deg); color: var(--red); border-color: var(--red); }

.settings-panel {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow);
  padding: 16px;
  width: 220px;
  z-index: 20;
}
.settings-panel.open { display: block; }

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-group + .settings-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.settings-group label,
.settings-group > span {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.settings-group select {
  font-family: var(--body);
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

.theme-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.theme-btn {
  flex: 1;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  border: none;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-btn + .theme-btn { border-left: 1px solid var(--line); }
.theme-btn:hover { color: var(--ink); }
.theme-btn.active {
  background: var(--red);
  color: #fff;
}

@media (max-width: 560px) {
  .settings-panel { right: -8px; }
}

@media (max-width: 560px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ---------- header / hero ---------- */
header.hero {
  position: relative;
  background: var(--paper);
  padding: 72px 0 60px;
}

.hero-inner {
  position: relative;
}

.hero-emblem {
  position: absolute;
  top: 0;
  right: 0;
  width: 68px;
  height: 68px;
  opacity: 0.92;
}
@media (max-width: 720px) {
  .hero-emblem { width: 48px; height: 48px; }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}

h1.title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 620px;
  color: var(--ink);
}

h1.title span {
  color: var(--red);
}

.subtitle {
  font-family: var(--body);
  font-size: 18px;
  max-width: 500px;
  color: var(--muted);
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 22px;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 3px;
  transition: all 0.15s ease;
}

.btn-solid {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.btn-solid:hover { filter: brightness(0.85); }

.btn-outline {
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover { background: var(--paper-2); }

/* ---------- stat strip ---------- */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}
.stats .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
}
.stat {
  flex: 1 1 160px;
  padding: 20px 28px;
  border-right: 1px solid var(--line);
  text-align: center;
}
.stat:last-child { border-right: none; }
.stat .num {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}
.stat .label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- updates grid (CPUSA-style card grid) ---------- */
.updates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
  margin-top: 8px;
}
.update-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.update-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px var(--shadow);
}
.update-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  margin-bottom: 10px;
}
.update-card h3 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ink);
}
.update-card p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  flex-grow: 1;
}
.update-link {
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}
.update-link:hover { text-decoration: underline; }

/* ---------- tabs ---------- */
.tabs { margin-top: 8px; }
.tab-buttons {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.tab-btn {
  font-family: var(--display);
  font-size: 14.5px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 10px 6px;
  margin-right: 18px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--ink);
  border-bottom-color: var(--red);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel-when {
  font-family: var(--mono);
  font-size: 12.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}
.tab-panel p {
  font-size: 15px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 0 14px;
}
.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 4px 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-radius: 3px;
}

/* ---------- FAQ accordion ---------- */
.accordion {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.accordion-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.accordion-item summary {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
  position: relative;
  padding-right: 24px;
  transition: color 0.15s ease;
}
.accordion-item summary:hover { color: var(--red); }
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  color: var(--red);
  font-weight: 400;
  font-size: 20px;
}
.accordion-item[open] summary::after { content: "\2212"; }
.accordion-item p {
  font-size: 14.5px;
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 620px;
}

/* ---------- section scaffolding ---------- */
section, header.hero { scroll-margin-top: 66px; }
section { padding: 64px 0; }
section.alt { background: var(--paper-2); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 36px;
}

.section-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--red);
}

h2.section-title {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}

p.lede {
  max-width: 600px;
  font-size: 17px;
  color: var(--muted);
}

/* ---------- manifesto points ---------- */
.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin-top: 12px;
}
.point {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.point .mark {
  font-family: var(--display);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}
.point p { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- committee cards ---------- */
.group-title {
  font-family: var(--mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 14px;
  padding-top: 4px;
}
.group-title:not(:first-of-type) { margin-top: 30px; }

.committee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 6px;
}

.card {
  background: var(--paper);
  color: var(--ink);
  padding: 22px 20px;
  transition: background 0.15s ease;
}
.card:hover { background: var(--paper-2); }

.card .role {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  margin-bottom: 6px;
}

.card .name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 8px;
}

.card .desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* ---------- join / discord CTA ---------- */
.join {
  background: var(--paper-2);
  text-align: center;
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

.join h2 {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
}

.join p {
  font-family: var(--body);
  font-size: 16px;
  max-width: 440px;
  margin: 0 auto 26px;
  color: var(--muted);
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  padding: 30px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-mark {
  width: 24px;
  height: 24px;
  opacity: 0.8;
}

footer a { color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .stat { flex: 1 1 45%; }
}

/* ---------- accessibility ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}