/* Citizens for Transparent Governance - placeholder site
   Concept: "sunshine law" daylight + frosted glass (transparency as the thesis).
   Bright, white / grey / clear field with pronounced native-CSS glassmorphism.
   Light theme by default; dark = "light breaking through".
   Public Sans (USWDS civic typeface), self-hosted variable font. */

/* ---------- Font ---------- */
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/public-sans-latin-wght-normal.woff2") format("woff2-variations");
}

/* ---------- Tokens (light) ---------- */
:root {
  color-scheme: light;
  --ink: #11203a;
  --ink-soft: #44566f;
  --ink-faint: #5e7088;

  --accent: #0b5cad;
  --accent-strong: #084a8f;
  --accent-rgb: 11, 92, 173;
  --on-accent: #ffffff;
  --focus: #0b5cad;

  /* atmosphere: bright white field + cool light pools behind the glass */
  --sky-1: #eef2f8;
  --sky-2: #f7f9fc;
  --sky-3: #ffffff;
  --light-rgb: 255, 255, 255; /* bright light source */
  --light-a: 0.95;
  --pool-rgb: 190, 206, 230; /* cool blue-grey pools */
  --pool-a: 0.5;
  --grey-rgb: 208, 216, 228; /* neutral grey pool */
  --grey-a: 0.5;
  --rays-a: 0.4;
  --ray: 0.03;

  /* glass: clearer + brighter + more obviously frosted */
  --glass-1: rgba(255, 255, 255, 0.55);
  --glass-2: rgba(255, 255, 255, 0.2);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-edge: rgba(110, 140, 185, 0.24); /* faint cool ring for definition on white */
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --glass-solid: #f1f5fb;
  --shadow: 0 26px 60px -24px rgba(70, 100, 145, 0.3);

  --ghost-bg: rgba(255, 255, 255, 0.5);

  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-solid: #f2f6fc;
  --hairline: rgba(40, 70, 110, 0.1);
  --footer-bg: rgba(255, 255, 255, 0.46);

  --field-bg: rgba(255, 255, 255, 0.95);
  --field-border: rgba(40, 70, 110, 0.2);

  --danger: #b21f2d;
  --danger-bg: rgba(178, 31, 45, 0.08);
  --danger-border: rgba(178, 31, 45, 0.28);

  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
}

/* Light theme only, by request. No dark-mode token block:
   color-scheme: light (above) keeps form controls and scrollbars light too. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute always wins over component display rules
   (e.g. .form { display: flex }), so toggling form/success/error works. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100dvh;
  position: relative;
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background-color: var(--sky-3);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Full-page atmosphere: a bright light source plus cool/grey light pools spread
   down the WHOLE page, so every glass panel (not just the hero) has something to
   refract. Stays bright; the pools are soft and cool. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 100%;
  z-index: -2;
  background:
    radial-gradient(40% 32% at 82% 5%, rgba(255, 224, 170, 0.55), transparent 70%),
    radial-gradient(44% 36% at 10% 18%, rgba(146, 184, 236, 0.52), transparent 72%),
    radial-gradient(48% 34% at 90% 48%, rgba(172, 198, 238, 0.46), transparent 72%),
    radial-gradient(50% 36% at 12% 72%, rgba(150, 188, 236, 0.44), transparent 72%),
    radial-gradient(46% 32% at 86% 92%, rgba(190, 206, 236, 0.46), transparent 72%),
    linear-gradient(180deg, var(--sky-1), var(--sky-2) 42%, var(--sky-3));
}
body::after {
  content: "";
  position: absolute;
  inset: 0;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: var(--rays-a);
  background: repeating-linear-gradient(
    116deg,
    rgba(255, 255, 255, 0) 0 40px,
    rgba(255, 255, 255, var(--ray)) 40px 42px
  );
  -webkit-mask-image: radial-gradient(130% 60% at 80% 4%, #000 0%, transparent 60%);
  mask-image: radial-gradient(130% 60% at 80% 4%, #000 0%, transparent 60%);
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.65rem 1rem;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}
.container--narrow { max-width: 720px; }

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
section[id] { scroll-margin-top: 84px; }

/* ---------- Buttons (uppercase) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.4rem;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.2s ease,
    border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn--lg { padding: 0.95rem 1.75rem; font-size: 0.96rem; }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 14px 28px -12px rgba(var(--accent-rgb), 0.7);
}
.btn--primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(1px) scale(0.99); }

.btn--ghost {
  background: var(--ghost-bg);
  color: var(--ink);
  border-color: var(--glass-edge);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.btn--ghost:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.btn--ghost:active { transform: translateY(1px) scale(0.99); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--hairline);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}
.wordmark {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(0.82rem, 1.9vw, 0.95rem);
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.wordmark__short { display: none; }
.nav__cta { padding: 0.62rem 1.2rem; }

/* ---------- Glass ---------- */
.glass {
  position: relative;
  background:
    radial-gradient(130% 92% at 10% -8%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 46%),
    linear-gradient(135deg, var(--glass-1), var(--glass-2));
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 rgba(120, 150, 190, 0.12),
    inset 0 0 0 1px var(--glass-edge);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 95dvh;
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__content {
  position: relative;
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}
.hero__title {
  position: relative;
  z-index: 8;
  margin: 0 0 1.2rem;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.07;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
}
/* The headline sits above the veil. "Dark money," is a constant anchor; the melt
   timeline (app.js) recolors it light->dark and fades "brought into the light." in,
   so there is no cut between the dark and clear states. */
.hero__lede {
  margin: 0 auto 2rem;
  font-size: clamp(1.04rem, 2.1vw, 1.22rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 50ch;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; }

/* Frosted-glass shards: the hero's "this is glass" visual. */
/* The hero is a single, obvious sheet of frosted glass (no other objects).
   It fills the top, holds the hero content, and is what the melt veil clears. */
.hero__glass {
  position: absolute;
  inset: clamp(10px, 1.6vw, 18px);
  border-radius: clamp(16px, 2vw, 26px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.6rem, 5vw, 3.5rem);
  background:
    radial-gradient(130% 95% at 50% -12%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 50%),
    linear-gradient(150deg, var(--glass-1), var(--glass-2));
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 rgba(120, 150, 190, 0.12),
    inset 0 0 0 1px var(--glass-edge);
}

/* ---------- Section heads ---------- */
.section__head { max-width: 720px; margin-bottom: clamp(1.8rem, 4vw, 2.6rem); }
[data-parallax] { will-change: transform; }
.section__title {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
}
.section__lede { margin: 0; font-size: 1.1rem; line-height: 1.6; color: var(--ink-soft); max-width: 65ch; }

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(0.9rem, 2vw, 1.3rem);
}
.bento__cell { padding: clamp(1.4rem, 3vw, 2rem); overflow: hidden; }
.bento__cell--wide { grid-column: 1; grid-row: 1 / 3; display: flex; flex-direction: column; justify-content: center; }
.bento__title {
  margin: 0 0 0.55rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.bento__body { margin: 0; color: var(--ink-soft); line-height: 1.55; max-width: 52ch; }

/* tints keep cells in the white / grey / clear family while giving the grid variation */
.tint-sky::after, .tint-sun::after, .tint-cool::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}
.tint-sky::after { background: radial-gradient(135% 135% at 0% 0%, rgba(var(--accent-rgb), 0.12), transparent 58%); }
.tint-sun::after { background: radial-gradient(135% 135% at 100% 0%, rgba(255, 255, 255, 0.6), transparent 62%); }
.tint-cool::after { background: radial-gradient(135% 135% at 100% 100%, rgba(var(--pool-rgb), 0.45), transparent 60%); }
.bento__cell > * { position: relative; z-index: 1; }

/* ---------- Panel / Form ---------- */
.panel { padding: clamp(1.6rem, 4vw, 2.6rem); }
.panel__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.panel__lede { margin: 0 0 1.6rem; color: var(--ink-soft); line-height: 1.55; }

.form { display: flex; flex-direction: column; gap: 1.05rem; }
.form__row--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.field__opt { font-weight: 500; color: var(--ink-faint); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 12px;
  padding: 0.74rem 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}
.field--zip input { max-width: 13rem; }

.field--check { margin-top: 0.1rem; }
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
}
.check input {
  margin-top: 0.18rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  flex: none;
}

.consent { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--ink-soft); }
.consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.form__error {
  margin: 0;
  font-size: 0.92rem;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.btn.is-loading { opacity: 0.8; cursor: progress; }

.form__success { text-align: center; padding: 1.2rem 0; }
.form__success h3 { margin: 0 0 0.5rem; font-size: 1.5rem; color: var(--ink); letter-spacing: -0.01em; }
.form__success p { margin: 0; color: var(--ink-soft); }

/* visually hidden honeypot (off-screen, not display:none) */
.hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* ---------- Donate band ---------- */
/* "Fund the work" keeps the standard section rhythm (even spacing). */
.donate { padding: clamp(1.8rem, 4vw, 2.8rem); text-align: center; }
.donate__title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.donate__lede { margin: 0 auto 1.6rem; max-width: 52ch; color: var(--ink-soft); line-height: 1.55; }

/* ---------- Footer ---------- */
.footer {
  margin-top: clamp(2rem, 6vw, 4rem);
  border-top: 1px solid var(--hairline);
  background: var(--footer-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  padding-block: clamp(2.4rem, 5vw, 3.4rem);
}
.footer__name {
  margin: 0 0 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.footer__addr { font-style: normal; color: var(--ink-soft); line-height: 1.6; margin: 0 0 0.6rem; }
.footer__note { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.footer__label { margin: 0 0 0.5rem; font-weight: 700; color: var(--ink); }
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__links { margin: 0.55rem 0 0; }
.footer__legal { border-top: 1px solid var(--hairline); padding-block: 1.4rem 2.2rem; }
.footer__disclaimer { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.footer__fine { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--ink-faint); }

/* ---------- Hero "melt": a dark frosted sheet that clears on scroll ----------
   The top of the site starts as dark, opaque frosted glass (concealment = dark money).
   An intercepted (pinned) scroll melts it away from a light source, revealing the bright
   hero beneath (brought into the light). No-JS / reduced-motion: the veil never shows,
   so the clear hero is always available. --p (0 -> 1) is the melt progress, set on .melt. */
@property --p {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.melt__veil {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;
  --r: calc(var(--p) * 185% - 28%);
  background: radial-gradient(120% 120% at 50% 38%, rgba(9, 13, 22, 0.98), rgba(2, 4, 9, 1) 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, transparent var(--r), #000 calc(var(--r) + 28%));
  mask-image: radial-gradient(circle at 50% 42%, transparent var(--r), #000 calc(var(--r) + 28%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.js .melt__veil { display: block; }
/* Frosted-glass grain so the dark veil reads as textured glass, not a flat black sheet. */
.melt__veil::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.4;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* "Dark money..." scroll cue: plays the melt on click (and the page plays it on first scroll). */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 9;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  background: none;
  border: 0;
  cursor: pointer;
  color: rgba(226, 234, 248, 0.88);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 0.85rem;
}
.hero__scroll:hover { color: #ffffff; }
.hero__scroll-label {
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  opacity: 0.85;
}
.hero__scroll-chev {
  width: 0.82rem;
  height: 0.82rem;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: no-preference) {
  .hero__scroll { animation: cue-bounce 1.7s ease-in-out infinite; }
}
@keyframes cue-bounce {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 8px; }
}

/* The melt runs for everyone (user decision): it is not gated by reduced-motion.
   Parallax IS still gated off for reduced-motion in app.js.
   The headline persists ABOVE the veil and is recolored light->dark by the melt
   timeline (app.js), so "Dark money," stays put while "brought into the light." emerges. */

/* ---------- Scroll reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.js [data-reveal].is-in { opacity: 1; }
.bento [data-reveal].is-in { transition-delay: 0.06s; }
.bento__cell.tint-sun.is-in { transition-delay: 0.12s; }
.bento__cell.tint-cool.is-in { transition-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .form__row--2 { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .bento__cell--wide { grid-column: auto; grid-row: auto; }
  .footer__inner { grid-template-columns: 1fr; gap: 1.6rem; }
}
@media (max-width: 640px) {
  .wordmark__full { display: none; }
  .wordmark__short { display: inline; }
}

/* ---------- Glass fallbacks ---------- */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass, .footer { background: var(--glass-solid); }
  .nav { background: var(--nav-solid); }
  .btn--ghost { background: var(--glass-solid); }
  .hero__glass { background: var(--glass-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .footer { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav { background: var(--nav-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero__glass { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
