/* Grants Partner: shared design system (index.html + contact.html) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #0B1D35;
  --text:      #1D1D1F;
  --mid:       #515154;
  --soft:      #86868B;
  --border:    #D2D2D7;
  --hairline:  rgba(0,0,0,0.07);
  --bg:        #FBFBFD;
  --panel:     #FFFFFF;
  --focus:     #0066CC;
  --success-fg: #1A6B47;
  --success-bg: #F0FAF5;
  --success-bd: #B7DFD0;
  --error-fg:  #C0392B;
  --error-bg:  #FFF5F5;
  --error-bd:  #FECACA;

  --font: system-ui, -apple-system, BlinkMacSystemFont,
          'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  --maxw: 1140px;
  --maxw-narrow: 720px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

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

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
}
.skip-link:focus { top: 16px; }

/* ── Focus ── */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* ── Layout helpers ── */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
.container.narrow { max-width: var(--maxw-narrow); }

.section { padding: 96px 0; }
.section--white {
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
section[id] { scroll-margin-top: 84px; }

/* Tighten the flow from "Why" into the CTA panel so they read as one moment */
#why.section { padding-bottom: 48px; }
#contact-cta.section { padding-top: 32px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.86; }
.btn-secondary {
  background: var(--panel);
  color: var(--navy);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--navy); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover:not(:disabled) { opacity: 0.9; }
.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 10px; }
.btn-lg { padding: 16px 34px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  background: transparent;
  transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
  border-bottom: 1px solid transparent;
}
header.scrolled, header.solid {
  background: rgba(251,251,253,0.88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--hairline);
}

.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-decoration: none;
}
.header-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--mid);
  text-decoration: none;
}
.header-back:hover { color: var(--navy); }

/* ── Eyebrow + section heads ── */
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 14px;
}

.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head h2 {
  font-size: clamp(25px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.025em;
  color: var(--navy);
}
.section-intro {
  margin-top: 16px;
  font-size: clamp(15px, 1.3vw, 17px);
  color: var(--mid);
}

/* ── Hero (overlay) ── */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 48%;
  z-index: 0;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to right,
      rgba(251,251,253,0.62) 0%,
      rgba(251,251,253,0.38) 36%,
      rgba(251,251,253,0.12) 62%,
      rgba(251,251,253,0) 100%),
    linear-gradient(to bottom,
      rgba(11,29,53,0.04) 0%,
      transparent 18%,
      transparent 72%,
      var(--bg) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
  padding: 88px 0 96px;
}
.hero-inner h1 {
  font-size: clamp(42px, 5.6vw, 76px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--navy);
  margin-bottom: 24px;
  text-shadow: 0 1px 22px rgba(255,255,255,0.32);
}
.hero-lead {
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.55;
  color: var(--mid);
  margin-bottom: 36px;
  max-width: 650px;
  text-shadow: 0 1px 18px rgba(255,255,255,0.4);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
}
.hero-scroll-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255,255,255,0.72);
  color: var(--navy);
  animation: nudge 1.9s ease-in-out infinite;
}
.hero-scroll:hover .hero-scroll-icon { border-color: var(--navy); }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* ── Service cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transform-origin: center;
  transition: border-color 0.18s ease, box-shadow 0.25s ease, transform 0.28s ease;
}
.card:hover {
  border-color: #BCBDC4;
  box-shadow: 0 8px 26px rgba(11,29,53,0.08);
  transform: translateY(-2px);
}
.card.open {
  border-color: var(--navy);
  transform: scale(1.025);
  box-shadow: 0 18px 46px rgba(11,29,53,0.14);
  z-index: 1;
}
.card.open:hover { transform: scale(1.025); }

.card-toggle {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 26px 24px;
  cursor: pointer;
  font-family: var(--font);
}
.card-index {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--soft);
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.card-desc { font-size: 14px; color: var(--mid); }
.card-cue {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.card-cue svg { transition: transform 0.28s ease; }
.card.open .card-cue svg { transform: rotate(180deg); }
.card-cue .cue-hide { display: none; }
.card.open .card-cue .cue-show { display: none; }
.card.open .card-cue .cue-hide { display: inline; }

.card-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.card.open .card-detail { grid-template-rows: 1fr; }
.card-detail-inner { overflow: hidden; }
.card-detail-body {
  padding: 18px 24px 26px;
  border-top: 1px solid var(--border);
}
.detail-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 10px;
}
.detail-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.detail-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text);
}
.detail-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy);
}
.detail-best {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--mid);
}
.detail-best strong { color: var(--navy); font-weight: 700; }

/* ── Who we support: ruled checklist ── */
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 56px;
  max-width: 900px;
}
.support-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 17px 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
  color: var(--text);
}
.support-item::before {
  content: '';
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 21 21'%3E%3Ccircle cx='10.5' cy='10.5' r='10.5' fill='%230B1D35'/%3E%3Cpath d='M6 10.8l3 3 6-6.4' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ── When to contact: scenario tiles ── */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 20px;
}
.scenario {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.scenario h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--navy);
  margin-bottom: 8px;
}
.scenario p { font-size: 14px; color: var(--mid); }

/* ── How we work: steps ── */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}
.step h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--navy);
  margin-bottom: 8px;
}
.step p { font-size: 14px; color: var(--mid); }

/* ── Why Grants Partner ── */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 40px;
}
.why { padding-left: 18px; border-left: 2px solid var(--navy); }
.why h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 8px;
}
.why p { font-size: 14px; color: var(--mid); }

/* ── CTA panel ── */
.cta-panel {
  background: var(--navy);
  color: #fff;
  border-radius: 22px;
  padding: 68px 48px;
  text-align: center;
}
.cta-panel .eyebrow { color: rgba(255,255,255,0.6); }
.cta-panel h2 {
  font-size: clamp(25px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.025em;
  color: #fff;
}
.cta-panel p {
  margin: 16px auto 28px;
  max-width: 520px;
  font-size: clamp(15px, 1.3vw, 17px);
  color: rgba(255,255,255,0.72);
}

/* ── Contact page ── */
.contact-section { padding: 64px 0 96px; }

.contact-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.contact-hero h1 {
  font-size: clamp(34px, 4.2vw, 52px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--navy);
  margin: 14px 0 20px;
}
.contact-hero-lead {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--mid);
  margin: 0 auto;
  max-width: 600px;
}
.contact-hero-direct {
  margin-top: 14px;
  font-size: 13px;
  color: var(--soft);
}
.contact-hero-direct a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.contact-hero-direct a:hover { text-decoration: underline; }

.form-shell {
  max-width: 940px;
  margin: 0 auto;
}

.form-section {
  padding: 36px 0;
  border-top: 1px solid var(--hairline);
}
.form-section:first-of-type {
  padding-top: 8px;
  border-top: none;
}

.form-section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}
.form-section-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--soft);
}
.form-section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--navy);
  line-height: 1.2;
}

.form-footer {
  padding-top: 30px;
  margin-top: 8px;
  border-top: 1px solid var(--hairline);
}
.form-footer .consent-row { margin-bottom: 18px; }

/* ── Toast ── */
.toast {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: calc(100% - 40px);
  max-width: 460px;
  padding: 14px 18px;
  background: var(--success-fg);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(11,29,53,0.28);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0;
  transform: translateX(-50%) translateY(-14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  font-size: 12px;
  font-weight: 700;
}

/* ── Forms ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.field { display: flex; flex-direction: column; }
.field-block { margin-top: 18px; }
.field-span-2 { grid-column: 1 / -1; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.req { color: var(--error-fg); }
.opt { color: var(--soft); font-weight: 400; }

input[type="text"],
input[type="email"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23515154' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
input::placeholder, textarea::placeholder { color: var(--soft); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(11, 29, 53, 0.1);
}
[aria-invalid="true"] { border-color: var(--error-fg); }

.field-error {
  font-size: 12px;
  font-weight: 500;
  color: var(--error-fg);
  padding: 4px 2px 0;
  display: none;
}
.field-error:not(:empty) { display: block; }

fieldset { border: none; }
fieldset legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  padding: 0;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.check-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 13px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.check-chip:hover { border-color: #BCBDC4; }
.check-chip:has(input:checked) {
  border-color: var(--navy);
  background: #F4F6F9;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--navy);
  cursor: pointer;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
  line-height: 1.6;
  margin: 0;
}
.consent-row input[type="checkbox"] { margin-top: 2px; }
.consent-row a, .data-note a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.consent-error {
  font-size: 12px;
  font-weight: 500;
  color: var(--error-fg);
  padding: 5px 0 0 29px;
  display: none;
}
.consent-error:not(:empty) { display: block; }

.form-status {
  font-size: 14px;
  font-weight: 500;
  padding: 13px 16px;
  border-radius: 10px;
  margin-top: 16px;
  display: none;
  line-height: 1.5;
}
.form-status.success {
  display: block;
  color: var(--success-fg);
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
}
.form-status.error {
  display: block;
  color: var(--error-fg);
  background: var(--error-bg);
  border: 1px solid var(--error-bd);
}

.data-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--soft);
  line-height: 1.6;
}
.submit-wrap { margin-top: 20px; }

/* ── Disclaimer ── */
.disclaimer-wrap {
  background: var(--panel);
  border-top: 1px solid var(--hairline);
}
.disclaimer {
  padding: 40px 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--soft);
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

/* ── Footer ── */
footer {
  background: var(--navy);
  color: #fff;
  padding: 48px 0 28px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.brand-footer { color: #fff; font-size: 18px; }
.footer-tag {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  max-width: 320px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
}
.footer-links a:hover { color: #fff; }
.footer-base {
  padding-top: 22px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  header { padding: 14px 20px; }
  .container { padding: 0 20px; }
  .section { padding: 60px 0; }
  #why.section { padding-bottom: 28px; }
  #contact-cta.section { padding-top: 20px; }
  .hero { min-height: 88vh; }
  .hero-scrim {
    background:
      linear-gradient(to bottom,
        rgba(251,251,253,0.92) 0%,
        rgba(251,251,253,0.74) 45%,
        rgba(251,251,253,0.80) 78%,
        var(--bg) 100%);
  }
  .hero-inner { padding-top: 80px; padding-bottom: 120px; }
  .section-head { margin-bottom: 32px; }
  .card-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; gap: 0; }
  .why-grid { grid-template-columns: 1fr; gap: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .cta-panel { padding: 52px 28px; }
  .contact-section { padding: 36px 0 64px; }
  .footer-inner { flex-direction: column; gap: 24px; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-detail { transition: none; }
  .card-cue svg { transition: none; }
  .hero-scroll-icon { animation: none; }
  .btn, header, .card { transition: none; }
  .card:hover, .card.open, .card.open:hover { transform: none; }
}
