/* =============================================================
   PGSDF — public-interest foundation
   editorial / institutional aesthetic
   ============================================================= */

:root {
  --bg:          #0b0d12;
  --bg-elev:     #10131a;
  --surface:     rgba(255,255,255,0.025);
  --ink:         #ece9e2;       /* warm off-white, not pure white */
  --ink-dim:     #b7b2a8;
  --muted:       #7a766d;
  --rule:        rgba(236,233,226,0.10);
  --rule-strong: rgba(236,233,226,0.22);
  --accent:      #d4a04c;       /* aged-brass institutional accent */
  --accent-dim:  rgba(212,160,76,0.18);

  --serif:       "Source Serif 4", "Iowan Old Style", "Charter", Georgia, serif;
  --sans:        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:        "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

body.light-mode {
  --bg:          #f4f1ea;       /* warm cream, not white */
  --bg-elev:     #ebe6db;
  --surface:     rgba(20,18,14,0.025);
  --ink:         #1a1814;
  --ink-dim:     #4a4640;
  --muted:       #8a847a;
  --rule:        rgba(26,24,20,0.14);
  --rule-strong: rgba(26,24,20,0.30);
  --accent:      #8a5a14;
  --accent-dim:  rgba(138,90,20,0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

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

::selection { background: var(--accent); color: var(--bg); }

.container {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
}

.narrow { max-width: 760px; }

/* =============================================================
   HEADER
   ============================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  gap: 32px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink);
}

.seal {
  width: 42px;
  height: 42px;
  color: var(--accent);
  flex-shrink: 0;
}

.identity-text h1 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.identity-text p {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 0.86rem;
  font-style: italic;
  color: var(--ink-dim);
  letter-spacing: 0.01em;
}

.navigation {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.navigation a {
  color: var(--ink-dim);
  transition: color 0.15s ease;
  padding: 4px 0;
  position: relative;
}

.navigation a:hover {
  color: var(--ink);
}

.navigation a:not(.github-link):hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
}

.github-link svg {
  width: 18px;
  height: 18px;
}

.theme-toggle {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--rule);
  padding: 8px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* =============================================================
   HERO
   ============================================================= */

.hero {
  position: relative;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 75% 10%, var(--accent-dim), transparent 70%),
    radial-gradient(ellipse 60% 40% at 10% 90%, var(--accent-dim), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 90%);
}

.hero-layout {
  position: relative;
  padding: 110px 0 96px;
}

.hero-copy {
  max-width: 880px;
}

.eyebrow {
  font-family: var(--sans);
  letter-spacing: 0.24em;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
  display: inline-block;
}

.eyebrow::before {
  content: "§ ";
  color: var(--accent);
  font-style: italic;
  font-family: var(--serif);
  text-transform: none;
  font-size: 0.9rem;
  font-weight: 400;
  margin-right: 2px;
}

.hero h2 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
}

.hero h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.lead {
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.58;
  color: var(--ink-dim);
  margin: 0 0 32px;
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 22px;
  border: 1px solid var(--rule-strong);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.primary-button {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.primary-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* masthead grid — small institutional plaque */

.masthead {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.masthead > div {
  padding: 18px 18px 18px 0;
  border-right: 1px solid var(--rule);
}

.masthead > div:first-child {
  padding-left: 0;
}

.masthead > div:last-child {
  border-right: none;
}

.masthead dt {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.masthead dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.3;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.masthead dd span {
  font-style: italic;
  font-size: 0.78rem;
  color: var(--ink-dim);
  font-weight: 300;
}

/* =============================================================
   SECTIONS
   ============================================================= */

.section {
  padding: 110px 0;
  position: relative;
}

.alt-section {
  background: var(--bg-elev);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.section h3 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.3vw, 2.8rem);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  max-width: 22ch;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 28px;
}

.section-head h3 {
  margin: 0;
}

.head-link {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent);
  transition: color 0.15s ease;
}

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

.section-intro {
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--ink-dim);
  max-width: 64ch;
  margin: 0 0 48px;
}

/* engineering principles — enumerated list */

.principles {
  list-style: none;
  padding: 0;
  margin: 48px 0 0;
  counter-reset: principle;
}

.principles li {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.4;
  color: var(--ink);
}

.principles li:last-child {
  border-bottom: 1px solid var(--rule);
}

.principles li span {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--accent);
  min-width: 32px;
  letter-spacing: 0.05em;
}

/* =============================================================
   PROJECTS
   ============================================================= */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.project-card {
  background: var(--bg-elev);
  padding: 36px 32px 32px;
  position: relative;
  transition: background 0.2s ease;
}

.alt-section .project-card {
  background: var(--bg);
}

.project-card:hover {
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-elev));
}

.alt-section .project-card:hover {
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
}

.project-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.project-card h4 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}

.project-card p {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 20px;
  max-width: 52ch;
}

.tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--rule-strong);
  color: var(--muted);
}

.project-card.spotlight {
  grid-column: 1 / -1;
  margin-top: 1px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  padding: 40px 36px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 28px;
  align-items: start;
}

.alt-section .project-card.spotlight {
  background: var(--bg-elev);
}

.project-card.spotlight .project-num {
  font-size: 1.4rem;
  margin: 0;
  text-align: center;
}

.project-card.spotlight h4 {
  font-size: 1.65rem;
  grid-column: 2;
}

.project-card.spotlight p,
.project-card.spotlight .tags {
  grid-column: 2;
  max-width: 70ch;
}

/* =============================================================
   GOVERNANCE
   ============================================================= */

.gov-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.gov-item {
  background: var(--bg);
  padding: 32px 28px 28px;
}

.gov-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.gov-meta span:first-child { color: var(--accent); }

.gov-item h4 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 0 10px;
  letter-spacing: -0.005em;
}

.gov-item p {
  font-family: var(--serif);
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--ink-dim);
  margin: 0;
}

.gov-item.stewards {
  background: color-mix(in srgb, var(--accent-dim) 60%, var(--bg));
}

.steward-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.steward-list li {
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 5px 0;
  border-bottom: 1px dotted var(--rule);
  color: var(--ink);
}

.steward-list li:last-child { border-bottom: none; }

.steward-note {
  font-size: 0.86rem !important;
  font-style: italic;
}

/* =============================================================
   REPORTS
   ============================================================= */

.report-grid {
  border-top: 1px solid var(--rule-strong);
}

.report-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s ease;
}

.report-row:hover {
  background: color-mix(in srgb, var(--accent) 3%, transparent);
}

.report-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.report-body h4 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 0 4px;
}

.report-body p {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink-dim);
  margin: 0;
  max-width: 70ch;
}

.report-status {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-status span {
  color: var(--muted);
  font-size: 0.66rem;
}

/* =============================================================
   FOOTER
   ============================================================= */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 72px 0 32px;
}

.footer-mark {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 24px;
  align-items: start;
  max-width: 760px;
  margin-bottom: 56px;
}

.footer-mark .seal {
  width: 48px;
  height: 48px;
  color: var(--accent);
}

.footer-mark p {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-dim);
  line-height: 1.55;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--rule);
}

.footer-cols h5 {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

.footer-cols ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-cols li {
  font-family: var(--serif);
  font-size: 0.98rem;
  margin-bottom: 8px;
}

.footer-cols a {
  color: var(--ink-dim);
  transition: color 0.15s ease;
}

.footer-cols a:hover {
  color: var(--accent);
}

.copyright {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.motto {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 0.92rem;
  color: var(--ink-dim);
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 1080px) {
  .masthead { grid-template-columns: repeat(2, 1fr); }
  .masthead > div:nth-child(2) { border-right: none; }

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

@media (max-width: 720px) {
  body { font-size: 16px; }

  .container { width: calc(100% - 36px); }

  .navigation {
    display: none;
  }

  .header-inner { gap: 12px; }

  .identity-text p { display: none; }

  .hero-layout { padding: 72px 0 60px; }

  .section { padding: 72px 0; }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .masthead { grid-template-columns: 1fr; }
  .masthead > div {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding-left: 0;
    padding-right: 0;
  }
  .masthead > div:last-child { border-bottom: none; }

  .project-grid,
  .gov-grid {
    grid-template-columns: 1fr;
  }

  .project-card.spotlight {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .project-card.spotlight .project-num { text-align: left; }
  .project-card.spotlight h4,
  .project-card.spotlight p,
  .project-card.spotlight .tags {
    grid-column: 1;
  }

  .report-row {
    grid-template-columns: 30px 1fr;
    gap: 16px;
  }
  .report-status {
    grid-column: 2;
    text-align: left;
    flex-direction: row;
    gap: 8px;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .copyright {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
