/* ===========================================================
   Perfect Circle Data Research
   Retro pixel (90s) visual language + modern generous spacing.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --brand: #808be6;
  --brand-dark: #5c67c9;
  --brand-darker: #454ea3;
  --brand-light: #e8eafc;
  --ink: #211d33;
  --paper: #f6f5ef;
  --paper-alt: #eeecdf;
  --line: #211d33;
  --accent-yellow: #f6e35c;
  --accent-pink: #f28fb0;
  --accent-green: #8fe6ba;

  --font-display: 'Press Start 2P', 'Courier New', monospace;
  --font-mono: 'VT323', 'Courier New', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --border-w: 3px;
  --shadow-off: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(33,29,51,0.035) 0px,
    rgba(33,29,51,0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

img { max-width: 100%; display: block; image-rendering: pixelated; }
img.smooth { image-rendering: auto; }

a { color: var(--brand-darker); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.5;
  letter-spacing: 0.5px;
  margin: 0 0 var(--space-3);
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.85rem; }

p { margin: 0 0 var(--space-3); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

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

/* ---------- Pixel border utility ---------- */
.pixel-border {
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 0 var(--line);
  image-rendering: pixelated;
}

.pixel-corners {
  clip-path: polygon(
    0px 8px, 8px 8px, 8px 0px,
    calc(100% - 8px) 0px, calc(100% - 8px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 8px), 0px calc(100% - 8px)
  );
}

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: var(--border-w) solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand img { width: 34px; height: 34px; }

.brand-word {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.brand-word small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--brand-darker);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-bottom-color: var(--brand);
  color: var(--brand-darker);
}

.nav-toggle {
  display: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-decoration: none;
  padding: 0.9rem 1.4rem;
  border: var(--border-w) solid var(--line);
  background: var(--brand);
  color: var(--ink);
  box-shadow: 5px 5px 0 0 var(--line);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 0 var(--line);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 var(--line);
}

.btn--ghost {
  background: var(--paper);
}

.btn--dark {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-6) 0 var(--space-5);
  border-bottom: var(--border-w) solid var(--line);
  background:
    radial-gradient(circle at 85% 15%, rgba(128,139,230,0.25), transparent 45%),
    var(--paper);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-5);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-darker);
  background: var(--brand-light);
  border: 2px solid var(--brand);
  padding: 0.3rem 0.75rem;
  margin-bottom: var(--space-3);
}

.hero h1 { margin-bottom: var(--space-3); }

.hero-lede {
  font-size: 1.1rem;
  max-width: 46ch;
  color: #43405c;
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.hero-mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-mark img {
  width: 100%;
  max-width: 280px;
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-6) 0;
  border-bottom: var(--border-w) solid var(--line);
}

.section:last-of-type { border-bottom: none; }

.section--alt {
  background: var(--paper-alt);
}

.section--dark {
  background: var(--ink);
  color: var(--paper);
}

.section--dark h2, .section--dark h1 { color: var(--paper); }
.section--dark .eyebrow { background: transparent; }

.section-head {
  max-width: 640px;
  margin: 0 auto var(--space-5);
  text-align: center;
}

.section-head p { color: #55506f; }
.section--dark .section-head p { color: #cfd0e6; }

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: var(--space-3);
}

.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper);
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 0 var(--line);
  padding: var(--space-4);
}

.card .icon {
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-3);
}

.card h3 { margin-bottom: var(--space-2); }
.card p { margin-bottom: 0; color: #4a4664; font-size: 0.98rem; }

.section--dark .card {
  background: #2c2748;
  border-color: #4a4472;
  box-shadow: var(--shadow-off) var(--shadow-off) 0 0 #4a4472;
  color: var(--paper);
}
.section--dark .card p { color: #cfd0e6; }

/* ---------- Numbered steps (how it works) ---------- */
.steps {
  counter-reset: step;
  display: grid;
  gap: var(--space-3);
}

.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-3);
  align-items: start;
}

.step-num {
  counter-increment: step;
  font-family: var(--font-display);
  font-size: 1rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  border: var(--border-w) solid var(--line);
  box-shadow: 4px 4px 0 0 var(--line);
}

.step-num::before {
  content: counter(step, decimal-leading-zero);
}

/* ---------- Marquee ---------- */
.marquee {
  border-top: var(--border-w) solid var(--line);
  border-bottom: var(--border-w) solid var(--line);
  background: var(--ink);
  color: var(--brand-light);
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: 2px;
  overflow: hidden;
  white-space: nowrap;
  padding: var(--space-2) 0;
}

.marquee-track {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 26s linear infinite;
}

.marquee span { margin: 0 2rem; }

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track, .hero-mark img { animation: none; }
}

/* ---------- Stat blocks ---------- */
.stat {
  text-align: center;
}

.stat .num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--brand);
  display: block;
  margin-bottom: var(--space-1);
}

.stat .label {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #55506f;
}

.section--dark .stat .label { color: #cfd0e6; }

/* ---------- Quote / pledge box ---------- */
.pledge {
  border: var(--border-w) solid var(--line);
  background: var(--brand-light);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 0 var(--line);
  padding: var(--space-4);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: center;
}

.pledge .glyph {
  font-family: var(--font-display);
  font-size: 2rem;
}

/* ---------- Table (data flow, plans) ---------- */
.table-wrap {
  overflow-x: auto;
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 0 var(--line);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  background: var(--paper);
}

th, td {
  text-align: left;
  padding: 0.9rem 1.1rem;
  border-bottom: 2px solid var(--line);
  font-size: 0.95rem;
}

thead th {
  font-family: var(--font-display);
  font-size: 0.65rem;
  background: var(--ink);
  color: var(--paper);
  letter-spacing: 0.5px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--paper-alt); }

/* ---------- Page header (interior pages) ---------- */
.page-header {
  padding: var(--space-5) 0 var(--space-4);
  border-bottom: var(--border-w) solid var(--line);
  background: var(--brand-light);
}

.page-header .eyebrow { background: var(--paper); }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--brand-darker);
  margin-bottom: var(--space-2);
}

.breadcrumb a { color: var(--brand-darker); }

/* ---------- Prose (policy pages) ---------- */
.prose h2 {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 2px dashed var(--brand);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.6rem; }
.prose .updated {
  font-family: var(--font-mono);
  color: #6a668a;
  font-size: 1.05rem;
}

/* ---------- Owner / about person card ---------- */
.person {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-5);
  align-items: start;
}

.person img {
  width: 100%;
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 0 var(--line);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--space-3) 0;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  border: 2px solid var(--line);
  padding: 0.2rem 0.6rem;
  background: var(--paper);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-5) 0 var(--space-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.footer-grid h4 {
  color: var(--brand);
  margin-bottom: var(--space-2);
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid a { color: #cfd0e6; text-decoration: none; }
.footer-grid a:hover { color: var(--brand); }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--space-2);
}

.footer-brand img { width: 30px; height: 30px; }
.footer-brand span { font-family: var(--font-display); font-size: 0.8rem; }

.footer-note {
  color: #9d9ab8;
  font-size: 0.9rem;
  max-width: 40ch;
}

.footer-bottom {
  border-top: 2px solid #423d63;
  padding-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: #9d9ab8;
}

.footer-bottom a { color: #cfd0e6; }

/* ---------- 404 ---------- */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) 0;
}

.error-code {
  font-family: var(--font-display);
  font-size: 4.5rem;
  color: var(--brand);
  margin-bottom: var(--space-2);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; max-width: 150px; margin: 0 auto var(--space-3); }
  .hero-mark img { max-width: 150px; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .person { grid-template-columns: 1fr; }
  .person img { max-width: 220px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 1.5rem; }
  .nav-links {
    position: fixed;
    inset: 64px 0 auto 0;
    background: var(--paper);
    border-bottom: var(--border-w) solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3);
    gap: var(--space-2);
    transform: translateY(-120%);
    transition: transform 0.2s ease;
  }
  .nav-links.is-open { transform: translateY(0); }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: var(--border-w) solid var(--line);
    background: var(--paper);
    font-family: var(--font-display);
    font-size: 0.9rem;
    cursor: pointer;
  }
  .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pledge { grid-template-columns: 1fr; text-align: left; }
}
