/* Fable Funding public site: /, /how-it-works, /funding-options, /contact
   and the 404 page (src/lib/site.js). Brand kit v1.0: deep teal / warm
   ivory / copper accent / pale mint, Georgia Bold headings, Arial body,
   8px spacing, 12px card radius. Copper is an accent only, never text on
   ivory at body size. */
:root {
  --ff-ink: #123E3A;
  --ff-paper: #F7F3EA;
  --ff-copper: #B76542;
  --ff-copper-ink: #8E4A2F;
  --ff-mint: #DCE9DF;
  --ff-text: #172421;
  --ff-muted: #51635C;
  --ff-rule: #E3DED2;
  --ff-danger: #A3261B;
  --ff-heading: Georgia, 'Times New Roman', serif;
  --ff-body: Arial, Helvetica, sans-serif;
  --ff-radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ff-text);
  font-family: var(--ff-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ff-ink); }
h1, h2, h3 {
  font-family: var(--ff-heading);
  font-weight: 700;
  color: var(--ff-ink);
  margin: 0;
}
h1 { font-size: 56px; line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: 36px; line-height: 1.2; }
h3 { font-size: 24px; line-height: 1.25; }
p { margin: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 48px; }
.rule { width: 48px; height: 3px; background: var(--ff-copper); border: 0; margin: 0 0 24px; }
.label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ff-muted);
  margin-bottom: 16px;
}
.muted { color: var(--ff-muted); }

:focus-visible { outline: 3px solid var(--ff-copper); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  background: var(--ff-ink);
  color: var(--ff-paper);
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* Buttons: 48px tall, so every CTA clears the 44px target. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  font: 700 16px var(--ff-body);
  text-decoration: none;
  border-radius: 8px;
  padding: 12px 24px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn-primary { background: var(--ff-ink); color: var(--ff-paper); }
.btn-primary:hover { background: #0C2D2A; }
.btn-ghost { background: transparent; color: var(--ff-ink); border-color: var(--ff-ink); }
.btn-ghost:hover { background: var(--ff-mint); }
.btn-paper { background: var(--ff-paper); color: var(--ff-ink); }
.btn-paper:hover { background: #FFFFFF; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.cta-note { font-size: 15px; color: var(--ff-muted); margin-top: 16px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* ─── HEADER ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--ff-rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 80px;
}
.nav-logo { display: inline-flex; align-items: center; min-height: 44px; }
.nav-logo img { height: 56px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  color: var(--ff-text);
  text-decoration: none;
}
.nav-links a:not(.btn):hover,
.nav-links a[aria-current="page"] { color: var(--ff-ink); text-decoration: underline; text-underline-offset: 6px; }
.nav-links .btn { margin-left: 12px; padding: 10px 20px; }

/* Mobile menu: a native <details>, so it opens and closes without
   JavaScript and is keyboard operable. site.js only adds Escape and
   close-on-navigate. */
.menu { display: none; position: relative; }
.menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 2px solid var(--ff-ink);
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ff-ink);
  cursor: pointer;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu[open] .menu-icon { background: transparent; }
.menu[open] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu[open] .menu-icon::after { top: 0; transform: rotate(-45deg); }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(320px, calc(100vw - 32px));
  background: #FFFFFF;
  border: 1px solid var(--ff-rule);
  border-radius: var(--ff-radius);
  box-shadow: 0 12px 32px rgba(18, 62, 58, 0.14);
  padding: 8px;
}
.menu-panel a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ff-text);
  text-decoration: none;
  font-size: 17px;
}
.menu-panel a:not(.btn):hover { background: var(--ff-paper); }
.menu-panel a[aria-current="page"] { font-weight: 700; color: var(--ff-ink); }
.menu-panel .btn { width: 100%; margin-top: 8px; }

/* ─── PAGE BLOCKS ─── */
.hero { background: var(--ff-paper); padding: 96px 0; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}
.hero h1 { margin-bottom: 24px; }
.hero-sub { font-size: 20px; color: var(--ff-muted); max-width: 32em; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.hero-panel {
  background: var(--ff-ink);
  border-radius: var(--ff-radius);
  padding: 48px 40px;
  color: var(--ff-paper);
}
.hero-panel img { width: 72px; height: 72px; border-radius: 8px; margin-bottom: 32px; }
.hero-panel .panel-title {
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 24px;
}
.hero-panel ul { list-style: none; margin: 0; padding: 0; }
.hero-panel li {
  padding: 16px 0;
  border-top: 1px solid rgba(247, 243, 234, 0.2);
  font-size: 17px;
}
.hero-panel li strong { display: block; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: #E6AD8B; margin-bottom: 4px; }

.page-head { background: var(--ff-paper); padding: 80px 0 64px; }
.page-head h1 { font-size: 48px; margin-bottom: 16px; max-width: 18em; }
.page-head p { font-size: 20px; color: var(--ff-muted); max-width: 34em; }

.section { padding: 96px 0; }
.section-alt { background: var(--ff-paper); }
.section-head { max-width: 40em; margin-bottom: 48px; }
.section-head h2 { margin-bottom: 16px; }
.section-head p { color: var(--ff-muted); font-size: 18px; }
.section-actions { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; list-style: none; margin: 0; padding: 0; }
.step { border-top: 3px solid var(--ff-ink); padding-top: 24px; }
.step-num {
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 18px;
  color: var(--ff-copper-ink);
  margin-bottom: 8px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--ff-muted); font-size: 17px; }

.options-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.option {
  background: #FFFFFF;
  border: 1px solid var(--ff-rule);
  border-radius: var(--ff-radius);
  padding: 32px;
  scroll-margin-top: 104px;
}
.option h3, .option .h3 { font-size: 22px; margin-bottom: 8px; }
.option .fits { font-size: 14px; font-weight: 700; color: var(--ff-muted); margin-bottom: 16px; }
.option p { font-size: 16px; color: var(--ff-text); }
.option-help { background: var(--ff-mint); border: 0; }
.option-help p { margin-bottom: 24px; }

.ready { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.ready li {
  background: #FFFFFF;
  border: 1px solid var(--ff-rule);
  border-left: 4px solid var(--ff-ink);
  border-radius: 8px;
  padding: 20px 24px;
}
.ready strong { display: block; font-family: var(--ff-heading); font-size: 19px; color: var(--ff-ink); margin-bottom: 4px; }
.ready span { font-size: 16px; color: var(--ff-muted); }

.lede { font-size: 20px; max-width: 760px; color: var(--ff-text); margin: 0; }

.faq { max-width: 820px; }
.faq h3 { font-size: 21px; margin: 32px 0 8px; }
.faq h3:first-child { margin-top: 0; }
.faq p { font-size: 17px; color: var(--ff-text); margin: 0; }

.qualify-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-bottom: 32px; }
.qualify-card {
  background: #FFFFFF;
  border: 1px solid var(--ff-rule);
  border-top: 4px solid var(--ff-ink);
  border-radius: var(--ff-radius);
  padding: 28px 32px;
}
.qualify-card h3 { font-size: 22px; margin-bottom: 16px; }
.qualify-card ul { margin: 0; padding-left: 20px; }
.qualify-card li { font-size: 17px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }

.trust { padding: 48px 0; border-top: 1px solid var(--ff-rule); }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.trust-value { font-family: var(--ff-heading); font-weight: 700; font-size: 32px; color: var(--ff-ink); }
.trust-label { font-size: 14px; color: var(--ff-muted); }

.cta-band { background: var(--ff-ink); color: var(--ff-paper); padding: 96px 0; }
.cta-band h2 { color: var(--ff-paper); margin-bottom: 16px; max-width: 18em; }
.cta-band p { color: rgba(247, 243, 234, 0.88); max-width: 34em; margin-bottom: 32px; }
.cta-band .rule { background: #E6AD8B; }
.cta-band .cta-actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.cta-band a:not(.btn) { color: var(--ff-paper); }
.cta-band .disclosure { font-size: 15px; margin: 32px 0 0; color: rgba(247, 243, 234, 0.78); }

/* ─── CONTACT ─── */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.form-card {
  background: #FFFFFF;
  border: 1px solid var(--ff-rule);
  border-radius: var(--ff-radius);
  padding: 32px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.field label { font-weight: 700; font-size: 16px; color: var(--ff-text); }
.field .req { color: var(--ff-copper-ink); margin-left: 2px; }
.field .hint { font-size: 14px; color: var(--ff-muted); }
.field input, .field textarea {
  font: 17px var(--ff-body);
  color: var(--ff-text);
  background: #FFFFFF;
  border: 1px solid #B9B3A6;
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--ff-copper); outline-offset: 1px; border-color: var(--ff-ink); }
.field [aria-invalid="true"] { border-color: var(--ff-danger); border-width: 2px; }
.field-error { font-size: 15px; color: var(--ff-danger); font-weight: 700; }
.field-error:empty { display: none; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-note { font-size: 14px; color: var(--ff-muted); margin: 0 0 20px; }
.error-summary {
  border: 2px solid var(--ff-danger);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: var(--ff-danger);
}
.error-summary h2 { font-family: var(--ff-body); font-size: 17px; color: var(--ff-danger); margin-bottom: 8px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--ff-danger); font-weight: 700; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.side-panel {
  background: var(--ff-mint);
  border-radius: var(--ff-radius);
  padding: 32px;
}
.side-panel h2 { font-size: 26px; margin-bottom: 12px; }
.side-panel p { font-size: 17px; margin-bottom: 24px; }
.done h2 { margin-bottom: 12px; }
.done p { margin-bottom: 16px; }

/* ─── FOOTER ─── */
.footer { background: #FFFFFF; padding: 64px 0 32px; border-top: 1px solid var(--ff-rule); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-logo { display: inline-block; }
.footer-logo img { height: 52px; width: auto; margin-bottom: 16px; }
.footer-about { font-size: 15px; color: var(--ff-muted); max-width: 22em; }
.footer h2 {
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ff-muted);
  margin: 0 0 8px;
}
.footer-col a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--ff-text);
  text-decoration: none;
}
.footer-col a:hover { color: var(--ff-ink); text-decoration: underline; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--ff-rule);
  font-size: 13px;
  color: var(--ff-muted);
  display: grid;
  gap: 8px;
}
.footer-utility { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer-utility a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ff-muted);
  font-size: 13px;
}

/* Sticky Start Now on phones: content pages only (never /apply or
   /contact, where it could sit over an input), and the body gets matching
   bottom padding so it never covers the footer. */
.sticky-cta { display: none; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .wrap { padding: 0 24px; }
  h1, .page-head h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
  body { font-size: 16px; }
  .hero, .section, .cta-band { padding: 64px 0; }
  .page-head { padding: 48px 0 40px; }
  .page-head p { font-size: 18px; }
  .hero-grid, .steps, .options-grid, .footer-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 40px; }
  .hero-sub { font-size: 18px; }
  .hero-panel { padding: 32px 24px; }
  .nav-inner { height: 68px; }
  .nav-logo img { height: 44px; }
  .nav-links { display: none; }
  .menu { display: block; }
  .form-card, .side-panel { padding: 24px; }
  .has-sticky-cta { padding-bottom: 80px; }
  .has-sticky-cta .sticky-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--ff-rule);
  }
  .sticky-cta .btn { width: 100%; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .field-pair { grid-template-columns: 1fr; }
  .hero-actions .btn, .section-actions .btn, .cta-band .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
