/* ==========================================================================
   NONNEGOTIABLE — design system
   ========================================================================== */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/Poppins-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/Poppins-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/Poppins-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/Poppins-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../assets/fonts/Poppins-ExtraBold.woff2") format("woff2");
}

:root {
  /* Blues */
  --ink-950: #060f1f;
  --ink-900: #0a1f44;
  --blue-800: #123a72;
  --blue-700: #1d4fa3;
  --blue-600: #2f6fd1;
  --blue-500: #4a8cdc;
  --blue-300: #a9cdf0;
  --blue-100: #e4eefb;

  /* Neutrals */
  --paper: #f7fafd;
  --white: #ffffff;
  --ink-text: #101c33;
  --muted: #4c5b74;
  --line: #d7e2f0;

  /* Type */
  --font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Layout */
  --max-w: 1600px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, 0.08), 0 1px 1px rgba(10, 31, 68, 0.04);
  --shadow-md: 0 8px 24px rgba(10, 31, 68, 0.12);
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--ink-text);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

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

a {
  color: inherit;
}

/* Links written into body copy without a utility class still need to be
   distinguishable by something other than colour. */
main p a:not([class]) {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* --blue-500 clears 3:1 against both the navy header and the paper
   background, so one focus ring works everywhere on the site. */
:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  /* fixed, not absolute, so it is still on screen if the user tabs backwards
     into it from partway down a long page */
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--white);
  color: var(--blue-800);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transform: translateY(-150%);
}

/* :focus, not :focus-visible — this link is only ever reached by keyboard,
   and :focus-visible's heuristics can decline to match a programmatic focus. */
.skip-link:focus {
  transform: translateY(0);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Long-form copy: one comfortable reading column, and paragraphs fill it
   instead of re-wrapping at their own narrower measure. */
.container-prose {
  max-width: 960px;
}

.container-prose p,
.container-prose .lede {
  max-width: none;
}

/* ---- Headings & type -------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5vw + 1rem, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3vw + 1rem, 2.8rem); }
h3 { font-size: clamp(1.3rem, 1.4vw + 1rem, 1.6rem); }

p {
  margin: 0 0 1.1em;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 62ch;
  text-wrap: pretty;
}

.lede {
  font-size: clamp(1.15rem, 1.2vw + 0.9rem, 1.4rem);
  color: var(--ink-text);
  font-weight: 500;
  max-width: 58ch;
  text-wrap: pretty;
}

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--white);
  color: var(--blue-800);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--blue-100); }

/* Gradient rather than a flat fill so the buttons pick up the same
   blue range as the watercolor sections behind them. */
.btn-blue {
  background-image: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 55%, var(--blue-500) 100%);
  background-color: var(--blue-700);
  color: var(--white);
}
.btn-blue:hover {
  background-image: linear-gradient(135deg, var(--ink-900) 0%, var(--blue-700) 55%, var(--blue-600) 100%);
}

.btn-donate {
  background: var(--blue-300);
  color: var(--ink-900);
}
.btn-donate:hover { background: var(--blue-500); color: var(--white); }

.btn-outline {
  background: transparent;
  border-color: var(--blue-700);
  color: var(--blue-700);
}
.btn-outline:hover { background: var(--blue-100); }

.btn-outline-light {
  background: transparent;
  border-color: rgba(255,255,255,0.6);
  color: var(--white);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.12); }

/* ---- Header / nav -------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  transition: box-shadow 0.2s ease;
}

/* The solid background lives on a pseudo-element so it can fade in; a
   gradient can't be transitioned the way background-color can. It repeats the
   hero's left-to-right navy-to-blue sweep, so the header keeps the color it
   had at the top of the page once the hero scrolls out from under it. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: linear-gradient(100deg, #15376c 0%, #1b4483 45%, #27599f 100%);
  transition: opacity 0.2s ease;
}

.site-header.is-solid::before { opacity: 1; }

.site-header.is-solid {
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.wordmark {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.wordmark img {
  height: 38px;
  width: auto;
  display: block;
}

.site-header nav {
  position: relative;
}

.nav-links {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  list-style: none;
  margin: 0;
  width: max-content;
  max-width: min(80vw, 240px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 10px;
  gap: 4px;
  transform: translateY(-8px);
  opacity: 0;
  /* visibility (not just opacity) so closed links leave the tab order too */
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease,
    visibility 0s linear 0.15s;
}

.nav-links.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

.nav-links a {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink-text);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  background: var(--blue-100);
  color: var(--blue-800);
}

.nav-links a.is-active {
  color: var(--blue-800);
  background: var(--blue-100);
}

.nav-links .donate-link {
  background: var(--blue-700);
  color: var(--white);
  margin-left: 0;
  text-align: center;
}

.nav-links .donate-link:hover {
  background: var(--blue-800);
}

.nav-links .donate-link.is-active {
  background: var(--ink-900);
  color: var(--white);
}

.nav-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
  border-radius: 2px;
}

@media (max-width: 700px) {
  .nav-links {
    position: fixed;
    inset: 76px 0 0 0;
    top: 76px;
    right: 0;
    width: auto;
    max-width: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 16px 24px 32px;
    gap: 6px;
  }

  .nav-links a {
    font-size: 1.05rem;
    padding: 14px 16px;
  }
}

/* ---- Watercolor hero background ------------------------------------------ */

.watercolor {
  position: relative;
  overflow: hidden;
  background: var(--ink-900);
  isolation: isolate;
}

.watercolor::before {
  content: "";
  position: absolute;
  inset: -15%;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 45% at 18% 22%, rgba(101, 163, 232, 0.55), transparent 60%),
    radial-gradient(ellipse 50% 42% at 82% 12%, rgba(35, 92, 179, 0.55), transparent 62%),
    radial-gradient(ellipse 65% 55% at 55% 95%, rgba(6, 20, 44, 0.65), transparent 68%),
    radial-gradient(ellipse 38% 35% at 92% 78%, rgba(140, 195, 240, 0.4), transparent 60%),
    radial-gradient(ellipse 40% 45% at 6% 85%, rgba(29, 79, 163, 0.5), transparent 65%),
    linear-gradient(158deg, #071733 0%, #0f2c5c 42%, #1d4fa3 78%, #2f6fd1 100%);
  filter: blur(50px) saturate(1.08);
  transform: scale(1.12);
}

.watercolor::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

.watercolor > * {
  position: relative;
  z-index: 2;
}

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

.hero {
  margin-top: -76px;
  padding: 196px 0 96px;
  color: var(--white);
}

.hero h1 {
  color: var(--white);
  max-width: 16ch;
}

.hero .lede {
  color: rgba(255,255,255,0.88);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 36px;
}

.page-hero {
  margin-top: -76px;
  padding: 164px 0 72px;
  color: var(--white);
}

.page-hero h1 { color: var(--white); }
.page-hero .lede { color: rgba(255,255,255,0.88); }

.page-hero-center { padding-top: 200px; }
.page-hero-center .container { text-align: center; }
.page-hero-center h1 { margin-left: auto; margin-right: auto; }
.page-hero-center .lede { margin-left: auto; margin-right: auto; }

.nowrap { white-space: nowrap; }

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

section.block {
  padding: 88px 0;
}

.block-tight { padding: 64px 0; }

.section-title {
  color: var(--blue-700);
  font-size: clamp(2.4rem, 3.8vw + 1rem, 3.4rem);
  margin-top: 140px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: start;
}

.two-col .card {
  max-width: 300px;
}

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; gap: 40px; }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

@media (max-width: 700px) {
  .stat-row { grid-template-columns: 1fr; gap: 28px; }
}

.stat-row .num {
  font-size: clamp(2.2rem, 3vw, 3rem);
  font-weight: 800;
  color: var(--blue-700);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-row .stat-label {
  color: var(--muted);
  font-weight: 500;
  font-size: 1rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.card-cta h2 { color: var(--blue-700); }

/* ---- Embed placeholder (for EveryAction forms) ----------------------------- */

.embed-placeholder {
  border: 1.5px dashed var(--blue-300);
  background: var(--blue-100);
  border-radius: 14px;
  padding: 48px 32px;
  text-align: center;
  color: var(--blue-800);
}

.embed-placeholder h3 { color: var(--blue-800); }
.embed-placeholder p { color: var(--blue-700); margin: 0 auto 1em; }
.embed-placeholder code {
  background: rgba(255,255,255,0.6);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
}

/* ---- Form (mockup of the EveryAction contact embed) ------------------------ */

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 560px) {
  .form-card { padding: 24px; }
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ZIP needs far less room than a phone number. */
.field-row-uneven { grid-template-columns: 1.5fr 1fr; }

@media (max-width: 560px) {
  .field-row,
  .field-row-uneven { grid-template-columns: 1fr; gap: 0; }
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field > span {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-text);
  margin-bottom: 7px;
}

.field .optional {
  display: inline;
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink-text);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder { color: #8d9ab0; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--blue-300); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: var(--white);
  border-color: var(--blue-600);
  outline: 2px solid var(--blue-500);
  outline-offset: 1px;
}

/* Native select arrows differ across platforms; this draws one consistent
   chevron and keeps room for it on the right. */
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%234c5b74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 18px;
  padding-right: 42px;
}

.field-help {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 7px 0 0;
}

.form-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

/* ---- Petition text --------------------------------------------------------- */

.petition-doc {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 560px) {
  .petition-doc { padding: 26px; }
}

.petition-doc-title {
  font-size: clamp(1.6rem, 1.6vw + 1rem, 2rem);
  color: var(--blue-700);
  margin-bottom: 20px;
}

.petition-addressee {
  font-weight: 600;
  color: var(--ink-text);
}

.petition-doc p {
  max-width: none;
  color: var(--ink-text);
}

.form-title {
  font-size: clamp(1.5rem, 1.4vw + 1rem, 1.8rem);
  color: var(--blue-700);
  margin-bottom: 24px;
}

/* ---- Article list (Media page) ---------------------------------------------- */

.article-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
  max-width: 72ch;
}

.article-item {
  padding: 28px 0;
}

.article-item:first-child { padding-top: 0; }

.article-source {
  display: block;
  font-size: clamp(1.3rem, 1vw + 1rem, 1.6rem);
  font-weight: 700;
  color: var(--blue-700);
  margin-bottom: 8px;
}

.article-headline {
  display: inline-block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: underline;
  line-height: 1.3;
}

.article-headline:hover {
  color: var(--blue-700);
}

/* ---- Signature counter (Petition page) --------------------------------------- */

.signature-counter {
  text-align: center;
}

.signature-counter .num {
  font-size: clamp(2.6rem, 4vw, 4rem);
  font-weight: 800;
  color: var(--blue-700);
  line-height: 1;
}

.signature-counter .stat-label {
  color: var(--muted);
  font-weight: 600;
  margin-top: 8px;
}

/* ---- Leader grid (Petition page) ---------------------------------------------- */

.leader-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 320px));
  gap: 16px 40px;
  margin-top: 8px;
}

@media (max-width: 860px) {
  .leader-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .leader-grid { grid-template-columns: 1fr; }
}

.leader-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink-text);
}

.leader-role {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 4px;
}

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

.site-footer {
  color: rgba(255,255,255,0.72);
  padding: 64px 0 48px;
}

.footer-logo {
  height: 42px;
  width: auto;
}

/* Beats .footer-grid ul on specificity, which would otherwise stretch
   these into full-width grid rows instead of a compact icon row. */
.footer-grid .footer-social {
  display: flex;
  gap: 16px;
  margin: 20px 0 0;
}

.footer-social a {
  display: flex;
  color: rgba(255,255,255,0.72);
  transition: color 0.15s ease;
}

.footer-social a:hover {
  color: var(--white);
}

.footer-social svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

.footer-grid h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.footer-grid a {
  text-decoration: none;
  color: rgba(255,255,255,0.72);
}

.footer-grid a:hover { color: var(--white); }

/* ---- Utility ------------------------------------------------------------- */

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mt-48 { margin-top: 48px; }
.mb-4 { margin-bottom: 4px; }
.stack-col { grid-template-columns: 1fr; gap: 20px; }
.cta-block { padding: 56px 32px; }
.cta-title { max-width: 26ch; margin-left: auto; margin-right: auto; }
.actions-center { justify-content: center; margin-top: 28px; }
.link-accent { color: var(--blue-700); font-weight: 700; }
.embed-wrap { max-width: 640px; }
.link-underline { text-decoration: underline; }

/* ---- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
