/* The Alexander Hamilton Foundation — styles.css */

:root {
  --navy-deep: #1e3a5f;
  --navy-med: #2a4a72;
  --navy-soft: #3d5a85;
  --bg: #f6f2ea;
  --bg-alt: #eee6d3;
  --bg-white: #ffffff;
  --ink: #1c1c1c;
  --ink-soft: #3a3a3a;
  --meta: #6b6b6b;
  --rule: #d9d1bf;
  --rule-soft: rgba(255,255,255,0.18);
  --accent: #1e3a5f;
  --accent-hover: #0f2340;
  --max-width: 68rem;
  --measure: 38rem;

  /* Motion (experimental) — kept conservative to match Mellon-style register */
  --motion-fast: 180ms;
  --motion-base: 320ms;
  --motion-slow: 600ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-emphasized: cubic-bezier(0.2, 0.8, 0.2, 1);
  --header-pad: 1.5rem;
  --logo-h: 3.75rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  font-weight: 500;
  color: var(--navy-deep);
  letter-spacing: -0.005em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.1; font-weight: 500; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); line-height: 1.2; }
h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 600;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.015em;
  color: var(--navy-deep);
}

p, li { max-width: var(--measure); }

a {
  color: var(--navy-deep);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--navy-deep);
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Header — dark navy band, sticky.
   Earlier version added a shrink-on-scroll behavior which caused layout
   shift (the header is in flow, so changing its height pushed content
   below it up/down on every threshold cross). The sticky behavior
   alone is what's actually useful — keeps nav reachable on long pages. */
.site-header {
  background: var(--navy-deep);
  color: #fff;
  padding: var(--header-pad) 0;
  border-bottom: 3px solid var(--navy-med);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-block;
  line-height: 1;
  text-decoration: none;
  color: #fff;
}

.wordmark:hover { color: #fff; text-decoration: none; }

.wordmark-logo {
  display: block;
  height: var(--logo-h);
  width: auto;
  max-width: 100%;
}

@media (max-width: 640px) {
  .wordmark-logo { height: 2.75rem; }
}

.site-nav { display: flex; gap: 1.75rem; flex-wrap: wrap; }

.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.82);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  letter-spacing: 0.02em;
  transition: color 120ms ease, border-color 120ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: #fff;
}

/* Hero — dark navy block with serif headline */
.hero {
  background: var(--navy-deep);
  color: #fff;
  padding: 6rem 0 5rem;
  border-bottom: 1px solid var(--navy-med);
  position: relative;
}

.hero .eyebrow {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
}

.hero h1 {
  max-width: 22ch;
  margin-bottom: 0;
  color: #fff;
  font-weight: 400;
}

.hero .lede {
  margin-top: 1.75rem;
  font-size: 1.15rem;
  line-height: 1.55;
  max-width: 40rem;
  color: rgba(255,255,255,0.85);
}

.hero .rule {
  display: block;
  width: 0;
  height: 1px;
  background: rgba(255,255,255,0.45);
  margin: 1.75rem 0 0;
  animation: rule-extend var(--motion-slow) var(--ease-out) 220ms both;
}

@keyframes rule-extend {
  from { width: 0; opacity: 0; }
  to   { width: 3.5rem; opacity: 1; }
}

/* Page intro — lighter variant, no photo */
.page-intro {
  background: var(--navy-deep);
  color: #fff;
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--navy-med);
}

.page-intro .eyebrow {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.25rem;
}

.page-intro h1 {
  max-width: 22ch;
  margin-bottom: 1rem;
  color: #fff;
  font-weight: 400;
}

.page-intro .lede {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  max-width: 38rem;
}

/* Sections */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.section h2 { margin-bottom: 1.25rem; max-width: 22ch; }

.section p + p { margin-top: 1em; }

.section .two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 820px) {
  .section .two-col {
    grid-template-columns: 18rem 1fr;
    gap: 4rem;
  }
  .section .two-col h2 { margin-top: 0.25rem; }
}

/* Programs (grant list) */
.programs { list-style: none; padding: 0; margin: 0; }

.programs li {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
  max-width: none;
}

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

.programs h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  letter-spacing: 0.015em;
}

.programs p { margin: 0; color: var(--ink-soft); max-width: 48rem; }

/* Disciplines (priority fields) */
.disciplines {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

@media (min-width: 720px) {
  .disciplines { grid-template-columns: 1fr 1fr; gap: 0 2.5rem; }
}

.disciplines li {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  max-width: none;
}

.disciplines h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--navy-deep);
  margin: 0 0 0.4rem;
}

.disciplines p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: none;
}

/* Focus-list (lighter topical bullets) */
.focus-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.focus-list li {
  padding: 1rem 0;
  border-top: 1px dotted var(--rule);
  font-size: 1.02rem;
  max-width: 48rem;
}
.focus-list li:last-child { border-bottom: 1px dotted var(--rule); }

/* Leadership roster */
.names { list-style: none; padding: 0; margin: 0; }
.names li {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  color: var(--navy-deep);
  max-width: none;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.names li:last-child { border-bottom: 1px solid var(--rule); }
.names .role {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  color: var(--meta);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Pull quote (deck-style) */
.pullquote {
  background: var(--navy-deep);
  color: #fff;
  padding: 4.5rem 0;
}
.pullquote p {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  line-height: 1.4;
  color: #fff;
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  /* `balance` redistributes lines evenly across the block (much more
     aggressive than `pretty`, which only tries to fix the last line).
     Well-supported in Chrome 114+, Safari 17.5+, Firefox 121+, and a
     no-op in older browsers. The non-breaking space in the markup
     between the final two words is a belt-and-braces fallback for
     browsers that ignore `balance`. */
  text-wrap: balance;
}
.pullquote .attribution {
  display: block;
  font-family: "Inter", sans-serif;
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-top: 1.75rem;
  text-align: center;
}

/* Contact card */
.contact-card {
  background: var(--bg-alt);
  padding: 2.25rem 2rem;
  border-left: 3px solid var(--navy-deep);
  max-width: 32rem;
}
.contact-card p { margin: 0 0 0.5rem; }
.contact-card .label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--meta);
  margin-bottom: 0.4rem;
}
.contact-card .email {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  color: var(--navy-deep);
}

/* Contact form */
.contact-form {
  max-width: 42rem;
}
.contact-form .intro {
  color: var(--ink-soft);
  margin-bottom: 2rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta);
  font-weight: 500;
}
.form-field label .req {
  color: var(--navy-deep);
  margin-left: 0.15rem;
}
.form-field input,
.form-field select,
.form-field textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg-white);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--navy-deep);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}
.form-field textarea {
  min-height: 9rem;
  resize: vertical;
}
.form-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-actions {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.btn-primary {
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: #fff;
  background: var(--navy-deep);
  border: none;
  padding: 0.95rem 1.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--accent-hover); }
.form-note {
  color: var(--meta);
  font-size: 0.9rem;
  margin-top: 1.25rem;
}
.form-captcha {
  margin-top: 0.5rem;
}
.form-captcha .h-captcha {
  min-height: 78px;
}
.form-status {
  margin-top: 1.25rem;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}
.form-status:empty { display: none; }
.form-status-info {
  color: var(--meta);
}
.form-status-ok {
  padding: 0.85rem 1rem;
  background: rgba(34, 102, 65, 0.08);
  color: #225737;
  border-left: 3px solid #225737;
}
.form-status-error {
  padding: 0.85rem 1rem;
  background: rgba(138, 26, 26, 0.06);
  color: #8a1a1a;
  border-left: 3px solid #8a1a1a;
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Grants database — totals banner */
.totals-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 0 0 2rem;
  padding: 2rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--navy-deep);
}
.totals-banner .stat {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.totals-banner .stat .value {
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--navy-deep);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.totals-banner .stat .label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--meta);
}
.meta-note {
  font-size: 0.9rem;
  color: var(--meta);
  margin: 0 0 2rem;
  max-width: 52rem;
}
@media (max-width: 768px) {
  .totals-banner {
    grid-template-columns: repeat(2, 1fr);
    padding: 1.5rem;
    gap: 1.25rem;
  }
  .totals-banner .stat .value { font-size: 1.75rem; }
}

/* Grants database — controls */
.grants-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: end;
}
.grants-controls .control {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.grants-controls .control.search { flex: 2 1 16rem; min-width: 14rem; }
.grants-controls .control.filter { flex: 1 1 9rem; min-width: 8rem; }
.grants-controls label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--meta);
  font-weight: 500;
}
.grants-controls input,
.grants-controls select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  background: var(--bg-white);
  border-radius: 2px;
  color: var(--ink);
}
.grants-controls input:focus,
.grants-controls select:focus {
  outline: none;
  border-color: var(--navy-deep);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}
.grants-controls .reset-btn {
  padding: 0.6rem 1.1rem;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  align-self: end;
}
.grants-controls .reset-btn:hover {
  color: var(--navy-deep);
  border-color: var(--navy-deep);
}

/* Grants database — table */
.grants-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--rule);
}
.grants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.grants-table thead th {
  text-align: left;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta);
  font-weight: 500;
  padding: 0.95rem 0.85rem;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.grants-table thead th:hover { color: var(--navy-deep); }
.grants-table thead th.sorted-asc::after { content: " \2191"; color: var(--navy-deep); }
.grants-table thead th.sorted-desc::after { content: " \2193"; color: var(--navy-deep); }
.grants-table tbody td {
  padding: 1rem 0.85rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-soft);
}
.grants-table tbody td.amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}
.grants-table tbody td.grantee {
  font-weight: 500;
  color: var(--ink);
}
.grants-table tbody tr:hover td { background: var(--bg-alt); }
.grants-table .area-pill {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.15rem 0.6rem;
  background: rgba(30, 58, 95, 0.08);
  color: var(--navy-deep);
  border-radius: 2px;
  white-space: nowrap;
}
.grants-table .status-pill {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border-radius: 2px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.grants-table .status-active {
  background: rgba(34, 102, 65, 0.10);
  color: #2a6641;
}
.grants-table .status-concluded {
  background: rgba(0, 0, 0, 0.05);
  color: var(--meta);
  font-style: italic;
  font-weight: 400;
}
.grants-table .status-other {
  background: rgba(0, 0, 0, 0.05);
  color: var(--meta);
}
/* Grants database — empty / loading / error state */
.grants-state {
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--meta);
  font-style: italic;
  font-size: 1rem;
}

/* Mobile: stacked card layout for the grants table */
@media (max-width: 768px) {
  .grants-table-wrap { border-top: none; }
  .grants-table thead { display: none; }
  .grants-table tbody tr {
    display: block;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .grants-table tbody tr:hover td { background: transparent; }
  .grants-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.35rem 0;
    border: none;
    gap: 1rem;
  }
  .grants-table tbody td::before {
    content: attr(data-label);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--meta);
    flex-shrink: 0;
    min-width: 6.5rem;
    padding-top: 0.15rem;
  }
}

/* Coming-soon panel (grants database) */
.soon-panel {
  background: var(--bg-alt);
  border-left: 3px solid var(--navy-deep);
  padding: 2.5rem 2rem;
  margin-top: 1.5rem;
  max-width: 48rem;
}
.soon-panel .tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  background: var(--navy-deep);
  padding: 0.35rem 0.75rem;
  margin-bottom: 1rem;
}
.soon-panel h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--navy-deep);
  margin: 0 0 0.5rem;
  letter-spacing: 0;
}
.soon-panel p { margin: 0 0 0.5rem; color: var(--ink-soft); }

/* Footer */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.72);
  padding: 3rem 0 2rem;
  font-size: 0.88rem;
}
.site-footer .footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 1.5rem;
}
.site-footer .footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}
.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer .footer-links li { margin: 0; max-width: none; }
.site-footer a { color: rgba(255,255,255,0.82); text-decoration-color: transparent; }
.site-footer a:hover { color: #fff; text-decoration-color: rgba(255,255,255,0.5); }
.footer-legal { max-width: 36rem; line-height: 1.55; }

/* FAQ styles */
.faq { list-style: none; padding: 0; margin: 0; }
.faq > li {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
  max-width: none;
}
/* Drop the rules on the first and last items — they duplicate the section
   boundaries above and below them. Inter-item separators are kept. */
.faq > li:first-child,
.programs li:first-child,
.disciplines li:first-child,
.focus-list li:first-child,
.names li:first-child {
  border-top: none;
  padding-top: 0;
}
.faq > li:last-child,
.programs li:last-child,
.focus-list li:last-child,
.names li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
/* .disciplines is a 2-column grid — the "last child" can be either the
   right or left cell visually. The original CSS only had border-top on
   each item, no border-bottom, so nothing extra to drop there. */
.faq h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--navy-deep);
  margin: 0 0 0.5rem;
}
.faq p { margin: 0 0 0.5em; max-width: 48rem; color: var(--ink-soft); }
.faq p:last-child { margin-bottom: 0; }

/* Legal / policy page body */
.prose { max-width: 44rem; }
.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
  max-width: none;
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-soft); max-width: none; }
.prose p + p { margin-top: 0.9em; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4em; }
.prose .meta {
  font-size: 0.85rem;
  color: var(--meta);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
  .hero { padding: 3.75rem 0 3rem; }
  .page-intro { padding: 3rem 0 2rem; }
  .section { padding: 2.75rem 0; }
  .site-nav { gap: 1.1rem; }
  .pullquote { padding: 3rem 0; }
}

/* ---------------------------------------------------------------------------
   EXPERIMENTAL ENHANCEMENTS — added 2026-05-01
   Goal: refine motion, focus, and interaction polish without disturbing the
   restrained Mellon-style register. All animation is gated behind
   prefers-reduced-motion: no-preference and uses small, slow easings.
   --------------------------------------------------------------------------- */

/* Smarter focus ring — visible only for keyboard users */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--navy-deep);
  outline-offset: 3px;
  border-radius: 2px;
}
.site-header :focus-visible,
.hero :focus-visible,
.page-intro :focus-visible,
.pullquote :focus-visible,
.site-footer :focus-visible {
  outline-color: rgba(255,255,255,0.85);
}

/* Refined link underline — animated reveal on hover */
main p a,
main li a,
.faq a,
.prose a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule);
  transition: background-size var(--motion-base) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out);
}
main p a:hover,
main li a:hover,
.faq a:hover,
.prose a:hover {
  background-size: 100% 1px;
  border-color: transparent;
  color: var(--accent-hover);
}

/* Links inside dark sections (hero, page-intro, pullquote) — the base
   `a` color is navy-deep, which on a navy-deep background is invisible.
   Override to a visible cream and recolor the underline accordingly.
   This is a fix for a pre-existing v1 bug, not a new feature. */
.hero a,
.page-intro a,
.pullquote a {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.4);
}
.hero a:hover,
.page-intro a:hover,
.pullquote a:hover {
  color: #fff;
  border-bottom-color: transparent;
}
/* Animated underline override for the dark-section links */
.hero p a,
.hero li a,
.page-intro p a,
.page-intro li a,
.pullquote p a {
  background-image: linear-gradient(#fff, #fff);
}

/* Nav links — animated underline draw */
.site-nav a {
  position: relative;
  border-bottom: 1px solid transparent;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--motion-base) var(--ease-out);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] { border-bottom-color: transparent; }

/* Scroll-reveal — opt in via .reveal; JS toggles .is-visible */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--motion-slow) var(--ease-out),
              transform var(--motion-slow) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger inside a revealed container */
.reveal > * { transition-delay: 0ms; }
.reveal.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal.is-visible > *:nth-child(2) { transition-delay: 60ms; }
.reveal.is-visible > *:nth-child(3) { transition-delay: 120ms; }
.reveal.is-visible > *:nth-child(4) { transition-delay: 180ms; }
.reveal.is-visible > *:nth-child(5) { transition-delay: 240ms; }
.reveal.is-visible > *:nth-child(6) { transition-delay: 300ms; }

/* Hero / page-intro entrance — stagger headline and lede on first paint */
.hero .eyebrow,
.hero h1,
.hero .lede,
.page-intro .eyebrow,
.page-intro h1,
.page-intro .lede {
  opacity: 0;
  transform: translateY(8px);
  animation: hero-rise var(--motion-slow) var(--ease-out) both;
}
.hero .eyebrow,        .page-intro .eyebrow        { animation-delay: 60ms; }
.hero h1,              .page-intro h1              { animation-delay: 160ms; }
.hero .lede,           .page-intro .lede           { animation-delay: 280ms; }
@keyframes hero-rise {
  to { opacity: 1; transform: none; }
}

/* Engraved ornament — small period-appropriate flourish, used sparingly.
   Rendered as inline SVG; container handles spacing/centering. */
.ornament {
  display: block;
  margin: 2.25rem auto 0;
  width: 4.5rem;
  height: auto;
  color: rgba(255,255,255,0.55);
}
.ornament svg { display: block; width: 100%; height: auto; }
.section .ornament {
  color: var(--rule);
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Pull quote — let it breathe; ornament SVG handles the leading mark */
.pullquote { position: relative; }
.pullquote .ornament {
  margin: 0 auto 2rem;
  width: 6rem;
  color: rgba(255,255,255,0.45);
}

/* Buttons — refined arrow that translates on hover */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "→";
  display: inline-block;
  font-size: 1.05em;
  font-family: "Inter", sans-serif;
  letter-spacing: 0;
  transform: translateX(0);
  transition: transform var(--motion-base) var(--ease-out);
}
.btn-primary:hover::after,
.btn-primary:focus-visible::after { transform: translateX(3px); }

/* Section heading — no ornamental leading mark.
   The 2rem rule above two-col h2s read as redundant against the section
   border above. */

/* Programs / disciplines / FAQ / trustees — no hover transforms.
   The per-item shift read as gimmicky on a foundation site. */

/* Tight vertical link stack — used for "see also" navigation lists
   (e.g., the Mission page's Grants / Independence / Nondiscrimination
   block). No bullets, no borders, just one link per line. */
.link-stack {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}
.link-stack li {
  padding: 0.35rem 0;
  max-width: none;
}

/* Contact card — subtle lift on hover */
.contact-card {
  transition: transform var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out);
}
@media (hover: hover) {
  .contact-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px -28px rgba(30, 58, 95, 0.45);
  }
}

/* Grants table — row stagger on first paint.
   Sticky thead was tried and removed: position:sticky on <th> inside a
   table inside overflow-x:auto produces broken layout (header cells
   stick independently, duplicate visually mid-table). Keep it simple. */
.grants-table tbody tr {
  opacity: 0;
  animation: row-fade var(--motion-base) var(--ease-out) both;
}
.grants-table tbody tr:nth-child(1)  { animation-delay: 0ms; }
.grants-table tbody tr:nth-child(2)  { animation-delay: 30ms; }
.grants-table tbody tr:nth-child(3)  { animation-delay: 60ms; }
.grants-table tbody tr:nth-child(4)  { animation-delay: 90ms; }
.grants-table tbody tr:nth-child(5)  { animation-delay: 120ms; }
.grants-table tbody tr:nth-child(n+6) { animation-delay: 150ms; }
@keyframes row-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Totals banner — tabular figure entrance */
.totals-banner .stat .value {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--motion-slow) var(--ease-out);
}

/* Form fields — invalid state once user has interacted */
.form-field input:user-invalid,
.form-field select:user-invalid,
.form-field textarea:user-invalid {
  border-color: #8a1a1a;
  box-shadow: 0 0 0 3px rgba(138, 26, 26, 0.08);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -10000px;
  top: 0;
  background: var(--navy-deep);
  color: #fff;
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Honor reduced-motion preference universally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero .eyebrow, .hero h1, .hero .lede,
  .page-intro .eyebrow, .page-intro h1, .page-intro .lede {
    opacity: 1; transform: none;
  }
  .hero .rule { width: 3.5rem; }
}

/* Print — strip the chrome so paper output stays clean */
@media print {
  .site-header, .site-footer, .skip-link, .ornament { display: none; }
  .hero, .page-intro, .pullquote { background: #fff; color: #000; }
  .hero h1, .hero .lede, .page-intro h1, .page-intro .lede,
  .pullquote p { color: #000; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: underline; }
}
