/* ============================================================
   R4PC — Research for Policy Change
   Visual direction: deep teal/ink + warm gold accent on
   warm off-white. Typography-first, GIS grid accents.
   ============================================================ */

:root {
  /* Palette — derived from R4PC wordmark */
  --ink: #0b1e3a;          /* deep navy ink (primary surface text) */
  --ink-2: #0f2748;
  --ink-soft: #1b3461;
  --teal: #0d4a5c;         /* policy/civic teal (link, accents) */
  --accent: #c9962a;       /* warm gold (the "4") */
  --accent-soft: #e3b04a;
  --paper: #f6f2e8;        /* warm off-white background */
  --paper-2: #efe9da;
  --line: rgba(11, 30, 58, 0.14);
  --line-strong: rgba(11, 30, 58, 0.32);
  --muted: #4a5a76;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale */
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.25rem;
  --step-5: 3rem;
  --step-hero: clamp(2.5rem, 6vw, 4.5rem);

  /* Layout */
  --maxw: 1180px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--ink); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 242, 232, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1rem; padding-bottom: 1rem;
}
.brand img { width: 140px; height: auto; }
.primary-nav {
  display: flex; gap: 1.5rem; align-items: center;
  font-size: 0.95rem;
}
.primary-nav a {
  color: var(--ink); font-weight: 500;
  letter-spacing: 0.01em;
}
.primary-nav a:hover { color: var(--teal); }
.primary-nav .nav-cta {
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; border-radius: 999px;
  font-weight: 600;
}
.primary-nav .nav-cta:hover { background: var(--teal); color: var(--paper); }

@media (max-width: 720px) {
  .primary-nav { gap: 0.9rem; font-size: 0.85rem; }
  .primary-nav a:not(.nav-cta) { display: none; }
  .brand img { width: 110px; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--ink); color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--teal); border-color: var(--teal); color: var(--paper);
}
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

/* ===== Section primitives ===== */
section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  color: var(--ink);
}
.section-title em {
  font-style: italic;
  color: var(--teal);
  font-weight: 500;
}
.section-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.55;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 1rem;
}
.kicker.on-dark { color: var(--accent-soft); }
.section-head { margin-bottom: 3rem; max-width: 720px; }

/* ===== Hero ===== */
.hero {
  padding-top: clamp(3.5rem, 7vw, 6rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(11,30,58,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11,30,58,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at top, black, transparent 70%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  position: relative;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 1.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(13, 74, 92, 0.06);
  border: 1px solid rgba(13, 74, 92, 0.18);
  border-radius: 999px;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 150, 42, 0.18);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--step-hero);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
  color: var(--ink);
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--teal);
}
.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 2rem;
}
.lede strong { color: var(--ink); font-weight: 600; }
.hero-ctas {
  display: flex; gap: 0.8rem; flex-wrap: wrap;
  margin-bottom: 3rem;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.hero-stats > div { display: flex; flex-direction: column; gap: 0.25rem; }
.hero-stats dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-stats dd {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}

.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.hero-art .venn {
  width: 100%; height: 100%;
  position: relative; z-index: 2;
}
.hero-art .venn-circles circle {
  transition: stroke 0.4s ease, opacity 0.4s ease;
}
.hero-art:hover .venn-circles circle:nth-child(1) { stroke: var(--accent); }
.hero-art .venn-labels { color: var(--ink-soft); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 380px; margin: 0 auto; }
  .hero-stats { grid-template-columns: 1fr; gap: 1rem; }
}

/* ===== Value section ===== */
.value {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.value-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.value .section-title { margin: 0; }
.value-text p {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 1.2rem;
}
.value-text p:last-child { margin-bottom: 0; }
@media (max-width: 880px) {
  .value-grid { grid-template-columns: 1fr; }
}

/* ===== Method (4Ps) ===== */
.ps-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.ps-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.ps-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -24px rgba(11, 30, 58, 0.25);
  border-color: var(--line-strong);
}
.ps-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: rgba(201, 150, 42, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.ps-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 0.6rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.ps-card p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .ps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .ps-grid { grid-template-columns: 1fr; }
}

/* ===== Platform modules ===== */
.platform { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.modules .module:first-child { grid-column: span 2; }
.modules .module:nth-child(4) { grid-column: span 2; }
.module {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.module:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.module-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--teal);
  text-transform: uppercase;
}
.module h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.module p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.97rem;
}
@media (max-width: 880px) {
  .modules { grid-template-columns: 1fr; }
  .modules .module:first-child,
  .modules .module:nth-child(4) { grid-column: auto; }
}

/* ===== Flagship (dark inverted section) ===== */
.flagship {
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.flagship::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.6;
}
.flagship-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  position: relative;
  z-index: 1;
}
.section-title.on-dark { color: var(--paper); }
.section-title.on-dark em { color: var(--accent); }
.on-dark-text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(246, 242, 232, 0.82);
  margin: 0 0 1.2rem;
}
.flagship-bullets {
  list-style: none; padding: 0;
  display: grid; gap: 0.8rem;
  margin: 1.5rem 0 0;
}
.flagship-bullets li {
  padding: 0.9rem 1rem;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.98rem;
  color: rgba(246, 242, 232, 0.9);
}
.flagship-bullets strong {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.5rem;
  font-family: var(--font-display);
  font-style: italic;
}
.flagship-art {
  display: flex; align-items: center; justify-content: center;
}
.map-frame {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1.25rem;
  color: rgba(246, 242, 232, 0.55);
  width: 100%; max-width: 360px;
}
.map-frame svg { width: 100%; height: auto; }
@media (max-width: 880px) {
  .flagship-grid { grid-template-columns: 1fr; }
  .map-frame { max-width: 320px; margin: 0 auto; }
}

/* ===== Status ===== */
.status-grid { display: flex; flex-direction: column; gap: 2.5rem; }
.status-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.status-h {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.status-cols ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0.7rem;
}
.status-cols li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--ink-2);
  line-height: 1.55;
}
.status-cols li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 8px; height: 1px;
  background: var(--accent);
}
.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
@media (max-width: 720px) {
  .status-cols { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ===== Contact ===== */
.contact { background: var(--paper-2); border-top: 1px solid var(--line); }
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact-lede {
  font-size: 1.1rem;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 50ch;
  margin: 0 0 1.5rem;
}
.founder-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
}
.founder-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.5rem;
}
.founder-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 0.75rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.founder-bio {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}
@media (max-width: 880px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--ink);
  color: rgba(246, 242, 232, 0.7);
  padding: 3rem 0 2rem;
}
.footer-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.footer-brand img { width: 110px; margin-bottom: 0.75rem; opacity: 0.95; }
.footer-brand p { margin: 0; font-size: 0.9rem; max-width: 36ch; }
.footer-nav {
  display: flex; flex-direction: column; gap: 0.5rem;
  font-size: 0.92rem;
}
.footer-nav a { color: rgba(246, 242, 232, 0.85); }
.footer-nav a:hover { color: var(--accent); }
.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  margin: 0;
  color: rgba(246, 242, 232, 0.5);
  text-align: right;
}
@media (max-width: 720px) {
  .footer-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-meta { text-align: left; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
