/* ===================================================================
   Access Funding Network — main.css
   Components shared across every page. Depends on tokens.css.
   =================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--afn-font);
  font-size: var(--afn-fs-base);
  line-height: var(--afn-lh-body);
  color: var(--afn-body);
  background: var(--afn-surface);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--afn-ink); font-weight: 700; line-height: var(--afn-lh-tight); margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: var(--afn-fs-3xl); }
h2 { font-size: var(--afn-fs-2xl); letter-spacing: -0.015em; }
h3 { font-size: var(--afn-fs-xl); }
p  { margin: 0 0 1em; }
a  { color: var(--afn-primary); text-decoration: none; }
a:hover { color: var(--afn-primary-dark); text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--afn-ring); border-radius: 4px; }

.afn-wrap { max-width: var(--afn-maxw); margin: 0 auto; padding: 0 1.5rem; }
.afn-prose { max-width: var(--afn-maxw-prose); }
.afn-eyebrow {
  display: inline-block; font-size: var(--afn-fs-xs); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--afn-primary);
  background: var(--afn-tint); padding: 0.4rem 0.85rem; border-radius: var(--afn-radius-pill);
}
.afn-muted { color: var(--afn-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- Buttons --- */
.afn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: inherit; font-size: var(--afn-fs-base); font-weight: 700;
  padding: 0.95rem 1.75rem; border-radius: var(--afn-radius); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s ease, transform .08s ease, box-shadow .15s ease;
  line-height: 1;
}
.afn-btn:hover { text-decoration: none; }
.afn-btn:active { transform: translateY(1px); }
.afn-btn--cta { background: var(--afn-accent); color: var(--afn-accent-text); box-shadow: var(--afn-shadow-sm); }
.afn-btn--cta:hover { background: var(--afn-accent-dark); color: var(--afn-accent-text); box-shadow: var(--afn-shadow-md); }
.afn-btn--primary { background: var(--afn-primary); color: #fff; }
.afn-btn--primary:hover { background: var(--afn-primary-dark); color: #fff; }
.afn-btn--ghost { background: transparent; color: var(--afn-primary); border-color: var(--afn-border-strong); }
.afn-btn--ghost:hover { background: var(--afn-tint); color: var(--afn-primary-dark); }
.afn-btn--block { width: 100%; }
.afn-btn--lg { font-size: var(--afn-fs-lg); padding: 1.1rem 2rem; }

/* --- Header --- */
.afn-header {
  background: var(--afn-card); border-bottom: 1px solid var(--afn-border);
  position: sticky; top: 0; z-index: 50;
}
.afn-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.afn-logo { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.afn-logo:hover { text-decoration: none; }
.afn-logo__mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--afn-primary);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.25rem;
  flex: none;
}
.afn-logo__text { display: flex; flex-direction: column; line-height: 1.05; }
.afn-logo__name { font-weight: 700; color: var(--afn-ink); font-size: 1.0625rem; letter-spacing: -0.01em; }
.afn-logo__tag  { font-size: 0.6875rem; color: var(--afn-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.afn-nav { margin-left: auto; display: flex; align-items: center; gap: 1.75rem; }
.afn-nav a { color: var(--afn-body); font-weight: 500; font-size: var(--afn-fs-sm); }
.afn-nav a:hover { color: var(--afn-primary); text-decoration: none; }
.afn-header__phone { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--afn-ink); font-size: var(--afn-fs-sm); }
.afn-header__phone span { color: var(--afn-muted); font-weight: 500; font-size: var(--afn-fs-xs); display: block; }
.afn-nav-toggle { display: none; margin-left: auto; background: none; border: 1.5px solid var(--afn-border-strong); border-radius: 8px; width: 44px; height: 44px; font-size: 1.4rem; color: var(--afn-ink); cursor: pointer; }

/* --- Lead-gen disclaimer band --- */
.afn-disclaimer-band {
  background: var(--afn-tint); color: var(--afn-primary-darker);
  font-size: var(--afn-fs-xs); text-align: center; padding: 0.6rem 1.5rem; line-height: 1.5;
  border-bottom: 1px solid var(--afn-tint-2);
}
.afn-disclaimer-band strong { font-weight: 700; }

/* --- Trust strip --- */
.afn-trust { background: var(--afn-card); border-top: 1px solid var(--afn-border); border-bottom: 1px solid var(--afn-border); }
.afn-trust__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 2.25rem; padding: 1.1rem 1.5rem; }
.afn-trust__item { display: inline-flex; align-items: center; gap: 0.55rem; font-size: var(--afn-fs-sm); font-weight: 600; color: var(--afn-body); }
.afn-trust__item .ic { color: var(--afn-primary); display: inline-grid; place-items: center; }

/* --- How it works --- */
.afn-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.afn-step { background: var(--afn-card); border: 1px solid var(--afn-border); border-radius: var(--afn-radius-lg); padding: 1.75rem; }
.afn-step__num { width: 38px; height: 38px; border-radius: 50%; background: var(--afn-tint); color: var(--afn-primary); font-weight: 700; display: grid; place-items: center; margin-bottom: 1rem; }
.afn-step h3 { font-size: var(--afn-fs-lg); margin-bottom: 0.4rem; }
.afn-step p { margin: 0; color: var(--afn-muted); font-size: var(--afn-fs-sm); }

/* --- Footer --- */
.afn-footer { background: var(--afn-ink); color: #C9D3CD; margin-top: 4rem; }
.afn-footer a { color: #C9D3CD; font-size: var(--afn-fs-sm); }
.afn-footer a:hover { color: #fff; }
.afn-footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
.afn-footer__brand .afn-logo__name { color: #fff; }
.afn-footer__brand .afn-logo__tag { color: #8FA39A; }
.afn-footer__brand p { color: #9FB0A8; font-size: var(--afn-fs-sm); margin-top: 1rem; max-width: 38ch; }
.afn-footer h4 { color: #fff; font-size: var(--afn-fs-sm); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }
.afn-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.afn-footer__legal { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.75rem 0; font-size: var(--afn-fs-xs); color: #8FA39A; line-height: 1.6; }
.afn-footer__legal p { margin: 0 0 0.75rem; }
.afn-footer__legal .copy { color: #C9D3CD; }

/* --- Generic section rhythm --- */
.afn-section { padding: 4.5rem 0; }
.afn-section--tight { padding: 3rem 0; }
.afn-section__head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.afn-section__head p { color: var(--afn-muted); font-size: var(--afn-fs-lg); }

/* --- Responsive --- */
@media (max-width: 860px) {
  :root { --afn-fs-3xl: 2.25rem; --afn-fs-2xl: 1.85rem; }
  .afn-nav, .afn-header__phone { display: none; }
  .afn-nav-toggle { display: inline-grid; place-items: center; }
  .afn-nav.is-open { display: flex; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--afn-card); border-bottom: 1px solid var(--afn-border); padding: 0.5rem 1.5rem 1rem; }
  .afn-nav.is-open a { padding: 0.75rem 0; width: 100%; border-bottom: 1px solid var(--afn-border); }
  .afn-steps { grid-template-columns: 1fr; }
  .afn-footer__top { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* ===================================================================
   ACCENT LAYER — typography emphasis, color, transparent texture.
   Visual richness without imagery. Added 2026-06.
   =================================================================== */

/* Stronger display weight (hero/display headlines) */
h1 { font-weight: 800; }

/* Emerald emphasis span — color ONE key phrase per headline. Never gold. */
.afn-em { color: var(--afn-primary); }

/* Gradient text — reserved for the homepage hero phrase only */
.afn-grad {
  background: linear-gradient(100deg, var(--afn-primary) 0%, var(--afn-primary-darker) 92%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--afn-primary);
}

/* Eyebrow upgraded to a tint pill */
.afn-eyebrow {
  background: var(--afn-tint); color: var(--afn-primary-darker);
  padding: 0.4rem 0.85rem; border-radius: var(--afn-radius-pill);
}

/* Step badges: solid emerald with white numeral */
.afn-step__num { background: var(--afn-primary); color: #fff; box-shadow: 0 4px 12px rgba(14,124,90,0.25); }

/* Hero: faint dotted-grid texture over the existing emerald glow */
.afn-home-hero { position: relative; overflow: hidden; }
.afn-home-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(var(--afn-primary) 1.2px, transparent 1.2px);
  background-size: 24px 24px; opacity: 0.045;
}
.afn-home-hero__inner { position: relative; z-index: 1; }

/* Article (guide) header: soft emerald glow accent */
.afn-article-head { position: relative; overflow: hidden; }
.afn-article-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 400px at 90% -30%, rgba(14,124,90,0.10) 0%, rgba(14,124,90,0) 60%);
}
.afn-article-head__inner { position: relative; z-index: 1; }

/* CTA band: faint brand watermark + depth */
.afn-cta-band { position: relative; overflow: hidden; }
.afn-cta-band::after {
  content: "A"; position: absolute; right: -1.5rem; bottom: -6rem;
  font-size: 26rem; font-weight: 800; line-height: 1; font-family: var(--afn-font);
  color: rgba(255,255,255,0.055); pointer-events: none; z-index: 0;
}
.afn-cta-band > * { position: relative; z-index: 1; }

/* Hero stat strip — bold emerald numbers as trust accents */
.afn-stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 1.9rem; }
.afn-stat__num { font-size: var(--afn-fs-xl); font-weight: 800; color: var(--afn-primary); line-height: 1; letter-spacing: -0.02em; }
.afn-stat__label { font-size: var(--afn-fs-xs); color: var(--afn-muted); margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Nav link hover polish */
.afn-nav a:hover { color: var(--afn-primary); }

@media (max-width: 860px) {
  .afn-stats { gap: 1.5rem 2rem; }
}

/* Sectional color bands + heading accent rule */
.afn-section--tint { background: var(--afn-tint); }
.afn-section--emerald { background: var(--afn-primary); }
.afn-section--emerald .afn-eyebrow { background: rgba(255,255,255,0.16); color: #fff; }
.afn-section--emerald h2, .afn-section--emerald h3 { color: #fff; }
.afn-section--emerald .afn-section__head p,
.afn-section--emerald .afn-value p { color: #C9E6DB; }
.afn-section--emerald .afn-value__ic { color: var(--afn-accent); }
.afn-section__head h2 { position: relative; }
.afn-section__head h2::after {
  content: ""; display: block; width: 48px; height: 3px; border-radius: 2px;
  background: var(--afn-primary); margin: 0.9rem auto 0;
}
.afn-section--emerald .afn-section__head h2::after { background: var(--afn-accent); }

/* ============================================================================
   SOCIAL PROOF / ACTIVITY POPUP  (js/social-proof.js — see SOCIAL-PROOF.md)
   ========================================================================== */
.afn-sp {
  position: fixed; left: 20px; bottom: 20px; z-index: 60;
  max-width: 384px; display: flex; align-items: center; gap: 14px;
  padding: 16px 40px 16px 16px;
  background: linear-gradient(155deg, #14241F 0%, #08160F 100%);
  color: #fff; border-radius: 16px; border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 18px 45px -12px rgba(7,40,30,0.55), 0 4px 14px rgba(0,0,0,0.20);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.afn-sp.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.afn-sp__mark {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: linear-gradient(150deg, var(--afn-primary), var(--afn-primary-dark));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.afn-sp__body { display: flex; flex-direction: column; min-width: 0; }
.afn-sp__text { font-size: 0.98rem; line-height: 1.38; font-weight: 600; color: #fff; }
.afn-sp__close {
  position: absolute; top: 50%; right: 11px; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; background: transparent;
  color: rgba(255,255,255,0.42); cursor: pointer; font-size: 20px; line-height: 1;
  border-radius: 6px; display: grid; place-items: center;
}
.afn-sp__close:hover { color: #fff; background: rgba(255,255,255,0.10); }
@media (max-width: 520px) {
  .afn-sp { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .afn-sp { transition: opacity .2s linear; transform: none; }
  .afn-sp.is-visible { transform: none; }
}
