/* ==========================================================================
   Non-Profit CFO Roundtable — styles.css
   Brand tokens from SITE_BUILD_BRIEF.md §3
   ========================================================================== */

:root {
  --navy: #12314A;
  --teal: #2AA48D;
  --teal-dark: #23917C;
  --sky: #0BA5D1;
  --deep: #2A79AD;
  --green: #8FC97A;
  --bg: #F7FAFA;
  --card: #FFFFFF;
  --text: #1F2937;
  --muted: #5B6773;
  --line: #E1E8EC;
  --line-strong: #C9D4DB;

  --font-head: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(18, 49, 74, 0.04), 0 8px 24px rgba(18, 49, 74, 0.06);
  --shadow-lg: 0 2px 4px rgba(18, 49, 74, 0.05), 0 18px 48px rgba(18, 49, 74, 0.10);

  --container: 1120px;
  --header-h: 72px;
}

/* ---------- Reset / base ---------- */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Author display rules (e.g. .story-card) would otherwise beat the browser's default [hidden] styling */
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.5rem, 2rem + 2.6vw, 3.5rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.85rem, 1.5rem + 1.4vw, 2.5rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--sky); }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section { padding: 96px 0; }
@media (max-width: 720px) { .section { padding: 64px 0; } }

.centered { text-align: center; }

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.skip-link {
  position: absolute;
  left: 16px; top: -80px;
  background: var(--navy); color: #fff;
  padding: 10px 14px; border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { top: 16px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: 14px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 6px 18px rgba(42, 164, 141, 0.28);
}
.btn-primary:hover { background: var(--sky); color: #fff; box-shadow: 0 8px 22px rgba(11, 165, 209, 0.30); }
.btn-primary:disabled { background: #9DB8B3; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--sky); color: var(--sky); }

.btn-lg { font-size: 1.08rem; padding: 18px 32px; }
.btn-sm { font-size: 0.95rem; padding: 10px 20px; box-shadow: none; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(247, 250, 250, 0.86);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 4px 16px rgba(18, 49, 74, 0.06);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
}
.brand-mark { width: 40px; height: 40px; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
@media (max-width: 420px) { .brand-name { font-size: 0.98rem; } }

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

.hero {
  position: relative;
  overflow: hidden;
  padding: 104px 0 112px;
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(42, 164, 141, 0.10), transparent 60%),
    radial-gradient(700px 380px at 90% 100%, rgba(42, 121, 173, 0.10), transparent 60%),
    var(--bg);
}
@media (max-width: 720px) { .hero { padding: 64px 0 72px; } }

.hero-petal {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.16;
  pointer-events: none;
}
.hero-petal-a { width: 420px; height: 420px; right: -140px; top: -160px; background: var(--sky); opacity: 0.12; }
.hero-petal-b { width: 260px; height: 260px; left: -120px; bottom: -120px; background: var(--green); }

.hero-inner {
  position: relative;
  max-width: 820px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 20px;
}

.hero h1 { margin-bottom: 20px; }

.hero-sub {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-note {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Founder ---------- */

.founder { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.founder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 64px;
  align-items: center;
}
@media (max-width: 860px) {
  .founder-grid { grid-template-columns: 1fr; gap: 36px; }
  /* Photo first on narrow screens so the note reads under the face, not under the signature */
  .founder-aside { order: -1; }
  .founder-grid .founder-photo { max-width: 260px; }
}

.founder-text p { font-size: 1.08rem; }

.founder-sig {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.founder-name { font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.founder-role { font-size: 0.95rem; color: var(--muted); }

.founder-photo {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}


/* ---------- Who ---------- */

.who-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: center;
}
@media (max-width: 860px) {
  .who-grid { grid-template-columns: 1fr; gap: 32px; }
}

.check-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 12px;
}
.check-list li {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px 16px 54px;
  font-weight: 500;
  color: var(--navy);
  box-shadow: var(--shadow);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312314A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* ---------- How it works ---------- */

.how { background: var(--navy); color: #E6EEF3; }
.how h2 { color: #fff; margin-bottom: 44px; }

.how-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 860px) { .how-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .how-grid { grid-template-columns: 1fr; } }

.how-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  padding: 26px 28px;
}
.how-card-wide { grid-column: span 3; }
@media (max-width: 860px) { .how-card-wide { grid-column: span 2; } }
@media (max-width: 560px) { .how-card-wide { grid-column: span 1; } }

.how-card dt {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}
.how-card dd { margin: 0; font-size: 1.08rem; color: #fff; line-height: 1.6; }
.how-card-rules { border-color: rgba(143, 201, 122, 0.40); }

/* ---------- Member stories ---------- */

.stories h2 { margin-bottom: 44px; }

.story-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 960px) { .story-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .story-grid { grid-template-columns: 1fr; } }

.story-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--deep);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.story-card blockquote { margin: 0; }
.story-card blockquote p {
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.65;
}
.story-card blockquote p::before { content: "\201C"; color: var(--teal); font-family: var(--font-head); font-weight: 700; }
.story-card blockquote p::after { content: "\201D"; color: var(--teal); font-family: var(--font-head); font-weight: 700; }

.story-person {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.story-person img {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--line);
}
.story-person div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.story-name { font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: 1rem; }
.story-title { font-size: 0.9rem; color: var(--muted); }

.stories-toggle-wrap { text-align: center; margin-top: 36px; }

/* ---------- FAQ ---------- */

.faq { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.faq h2 { margin-bottom: 36px; }
.faq-inner { max-width: 760px; }

.faq-list { display: grid; gap: 12px; }

.faq-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 56px 18px 22px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--navy);
  position: relative;
  transition: color .15s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--sky); }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 22px; top: 50%;
  width: 10px; height: 10px;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-body { padding: 0 22px 20px; color: var(--text); }
.faq-body p { font-size: 1.02rem; }

/* ---------- Application form ---------- */

.apply { padding-bottom: 112px; }
.apply-inner { max-width: 760px; }
.apply-head { text-align: center; margin-bottom: 40px; }

.app-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 22px;
}
@media (max-width: 600px) { .app-form { padding: 26px 20px; } }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--navy);
  line-height: 1.4;
}
.req { color: var(--teal); }
.opt { color: var(--muted); font-weight: 400; }

.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 96px; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312314A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}
.field select:invalid { color: var(--muted); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(11, 165, 209, 0.16);
}
.field input::placeholder { color: #A3AEB8; }

/* Validation feedback appears only after the user tries to submit */
.app-form.was-validated .field input:invalid,
.app-form.was-validated .field select:invalid,
.app-form.was-validated .field textarea:invalid {
  border-color: #C2410C;
}
.field-error {
  display: none;
  font-size: 0.88rem;
  color: #9A3412;
}
.app-form.was-validated .field :invalid ~ .field-error { display: block; }

/* Honeypot — off-screen, not display:none so naive bots still fill it */
.hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-top: 6px;
}
.form-actions .btn { width: 100%; }

.form-message {
  display: none;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
}
.form-message.is-success { display: block; background: #E9F6F0; color: #14523F; border: 1px solid #BFE3D3; }
.form-message.is-error   { display: block; background: #FDF1EC; color: #7C2D12; border: 1px solid #F3C7B4; }

.privacy {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}

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

.site-footer {
  background: var(--navy);
  color: #C7D3DC;
  padding: 48px 0 36px;
}
.footer-inner {
  display: grid;
  gap: 24px;
  justify-items: center;
  text-align: center;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 560px;
}
.footer-brand img { width: 32px; height: 32px; }
.footer-brand p { color: #E6EEF3; font-size: 0.98rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 28px;
}
.footer-link {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-link:hover { color: var(--green); }

.footer-copy { font-size: 0.85rem; color: #93A4B2; }
