/* =========================================================
   Finishing Well Foundation — Design System
   Palette pulled from the brand mark: purple runner, red
   speed lines, indigo wordmark.
   ========================================================= */

:root{
  --purple:        #5B2A83;
  --purple-deep:   #3B1B57;
  --purple-soft:   #F1E9F7;
  --red:           #E2362B;
  --red-deep:      #B82419;
  --navy:          #2B2E75;
  --cream:         #FAF9FC;
  --ink:           #211B2E;
  --gray:          #6C6577;
  --gray-line:     #E4DEEB;
  --white:         #FFFFFF;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Literata', serif;

  --container: 1180px;
  --radius: 6px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4{
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 .5em;
  letter-spacing: .2px;
}
h1{ font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; }
h2{ font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3{ font-size: clamp(1.3rem, 2vw, 1.6rem); }
p{ max-width: 62ch; }
.wrap{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
section{ padding: 88px 0; }
.section-tight{ padding: 56px 0; }

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .3px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-accent{ background: var(--red); color: var(--white); box-shadow: 0 8px 20px rgba(226,54,43,.28); }
.btn-accent:hover{ background: var(--red-deep); transform: translateY(-2px); }
.btn-outline{ background: transparent; color: var(--white); border-color: rgba(255,255,255,.6); }
.btn-outline:hover{ border-color: var(--white); transform: translateY(-2px); }
.btn-purple{ background: var(--purple); color: var(--white); }
.btn-purple:hover{ background: var(--purple-deep); transform: translateY(-2px); }
.btn-ghost{ background: transparent; color: var(--purple); border-color: var(--purple); }
.btn-ghost:hover{ background: var(--purple); color: var(--white); }

/* ---------- Top bar ---------- */
.topbar{ background: var(--navy); color: rgba(255,255,255,.85); font-size: .85rem; }
.topbar-inner{ display: flex; justify-content: space-between; gap: 20px; padding: 8px 24px; flex-wrap: wrap; }
.topbar-item a{ color: inherit; }
.topbar-item a:hover{ color: var(--white); }
@media (max-width: 700px){ .topbar-item.topbar-email{ display: none; } }

/* ---------- Header / Nav ---------- */
.site-header{
  position: sticky; top: 0; z-index: 500;
  background: rgba(250,249,252,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-line);
  transition: box-shadow .3s var(--ease), padding .3s var(--ease);
}
.site-header.is-scrolled{ box-shadow: 0 6px 24px rgba(43,46,117,.12); }
.header-inner{ display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 24px; }
.brand{ display: flex; align-items: center; flex-shrink: 0; }
.brand-logo{ height: 58px; width: auto; transition: height .3s var(--ease); }
.site-header.is-scrolled .brand-logo{ height: 44px; }

.main-nav ul{ display: flex; gap: 30px; }
.main-nav a{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
}
.main-nav a::after{
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--red);
  transition: right .25s var(--ease);
}
.main-nav a:hover::after, .main-nav a.is-active::after{ right: 0; }
.main-nav a.is-active{ color: var(--red); }

.header-actions{ display: flex; align-items: center; gap: 16px; }
.nav-toggle{
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 36px; background: none; border: none; cursor: pointer;
  position: relative; z-index: 700;
}
.nav-toggle span{ height: 2px; width: 100%; background: var(--navy); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }

@media (max-width: 900px){
  .main-nav{
    position: fixed; inset: 0 0 0 auto; width: min(320px, 86vw);
    background: var(--white); box-shadow: -12px 0 30px rgba(0,0,0,.15);
    transform: translateX(100%); transition: transform .35s var(--ease);
    padding: 100px 32px 32px; z-index: 600;
  }
  .main-nav.is-open{ transform: translateX(0); }
  .main-nav ul{ flex-direction: column; gap: 22px; }
  .nav-toggle{ display: flex; }
  .nav-toggle.is-open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2){ opacity: 0; }
  .nav-toggle.is-open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }
  .nav-backdrop{
    display: none; position: fixed; inset: 0; background: rgba(33,27,46,.45);
    z-index: 550; opacity: 0; transition: opacity .3s var(--ease);
  }
  .nav-backdrop.is-open{ display: block; opacity: 1; }
}

/* ---------- Page transition overlay ---------- */
#page-transition{
  position: fixed; inset: 0; z-index: 9999;
  background: var(--purple);
  transform: scaleY(1);
  transform-origin: top;
  pointer-events: none;
  animation: fwf-curtain-up .6s var(--ease) forwards;
  animation-delay: .05s;
}
@keyframes fwf-curtain-up{
  from{ transform: scaleY(1); }
  to{ transform: scaleY(0); }
}
body.is-leaving #page-transition{
  transform: scaleY(0);
  animation: fwf-curtain-down .45s var(--ease) forwards;
}
@keyframes fwf-curtain-down{
  from{ transform: scaleY(0); }
  to{ transform: scaleY(1); }
}

/* ---------- Speed line motif (from the logo) ---------- */
.speed-lines{
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.speed-lines span{
  position: absolute;
  height: 6px;
  background: var(--red);
  border-radius: 4px;
  transform: translateX(-120%) skewX(-18deg);
  opacity: 0;
  animation: fwf-dash .9s var(--ease) forwards;
}
@keyframes fwf-dash{
  to{ transform: translateX(0) skewX(-18deg); opacity: .85; }
}

/* ---------- Hero ---------- */
.hero{
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: stretch;
  min-height: 88vh;
  background: var(--navy);
  overflow: hidden;
}
.hero-copy{
  position: relative; z-index: 3;
  padding: 140px 6vw 80px 24px;
  display: flex; flex-direction: column; justify-content: center;
  color: var(--white);
}
.hero-copy .eyebrow{
  font-family: var(--font-display); color: var(--red); font-weight: 700;
  font-size: 1.1rem; margin-bottom: 14px;
  opacity: 0; transform: translateY(14px);
  animation: fwf-rise .7s var(--ease) forwards; animation-delay: .15s;
}
.hero-copy h1{
  color: var(--white); max-width: 14ch;
  opacity: 0; transform: translateY(24px);
  animation: fwf-rise .8s var(--ease) forwards; animation-delay: .3s;
}
.hero-copy p{
  color: rgba(255,255,255,.85); font-size: 1.15rem; max-width: 46ch;
  opacity: 0; transform: translateY(20px);
  animation: fwf-rise .8s var(--ease) forwards; animation-delay: .5s;
}
.hero-actions{
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px;
  opacity: 0; transform: translateY(20px);
  animation: fwf-rise .8s var(--ease) forwards; animation-delay: .7s;
}
@keyframes fwf-rise{ to{ opacity: 1; transform: translateY(0); } }

.hero-media{
  position: relative;
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 0% 100%);
}
.hero-media img{
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
  transform: scale(1.08);
}
.hero-media::after{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(200deg, rgba(91,42,131,.15), rgba(43,46,117,.55));
}

@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; min-height: auto; }
  .hero-media{ clip-path: none; height: 46vh; order: -1; position: relative; }
  .hero-copy{ padding: 48px 24px 56px; }
}

/* ---------- Section heading ---------- */
.section-head{ max-width: 640px; margin: 0 0 48px; }
.section-head p{ color: var(--gray); font-size: 1.08rem; }
.section-head.center{ margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Programs grid ---------- */
.programs-grid{
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.program-card{
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-left: 4px solid var(--purple);
  padding: 30px 26px;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.program-card:hover{
  transform: translateY(-6px);
  border-left-color: var(--red);
  box-shadow: 0 16px 30px rgba(43,46,117,.12);
}
.program-card .icon{
  width: 46px; height: 46px; margin-bottom: 18px;
  color: var(--purple);
}
.program-card h3{ margin-bottom: 8px; }
.program-card p{ color: var(--gray); margin: 0; font-size: .98rem; }

/* ---------- Diagonal band / CTA banners ---------- */
.band{
  position: relative;
  color: var(--white);
  text-align: center;
  padding: 100px 24px;
  background-size: cover; background-position: center;
  overflow: hidden;
}
.band::before{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(91,42,131,.88), rgba(226,54,43,.75));
}
.band > *{ position: relative; z-index: 2; }
.band h2{ color: var(--white); }
.band p{ margin: 0 auto 28px; color: rgba(255,255,255,.9); }

/* ---------- Impact counters ---------- */
.impact-grid{
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 20px;
}
.impact-item{ text-align: center; }
.impact-item .num{
  font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 800; color: var(--white); display: block; line-height: 1;
}
.impact-item .label{ color: rgba(255,255,255,.85); font-family: var(--font-display); font-size: 1.05rem; }

/* ---------- Testimonials ---------- */
.testimonial-grid{
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.testimonial-card{
  background: var(--white);
  padding: 30px;
  border: 1px solid var(--gray-line);
  position: relative;
}
.testimonial-card::before{
  content: "\201C";
  font-family: Georgia, serif;
  font-size: 4rem; color: var(--purple-soft);
  position: absolute; top: 6px; left: 16px; line-height: 1;
}
.testimonial-card p.quote{ position: relative; z-index: 1; font-style: italic; color: var(--ink); margin-bottom: 14px; }
.testimonial-card .author{ font-family: var(--font-display); font-weight: 700; color: var(--navy); }

/* ---------- Cards / content blocks ---------- */
.split{
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
@media (max-width: 860px){ .split{ grid-template-columns: 1fr; gap: 36px; } }
.split img{ width: 100%; height: auto; }

.card{ background: var(--white); border: 1px solid var(--gray-line); padding: 30px; }

/* ---------- Gallery ---------- */
.gallery-grid{
  display: grid; gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}
.gallery-grid a{
  display: block; overflow: hidden; aspect-ratio: 1 / 1;
  position: relative;
}
.gallery-grid img{
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease);
}
.gallery-grid a:hover img{ transform: scale(1.08); }
@media (max-width: 700px){ .gallery-grid{ grid-template-columns: repeat(2, 1fr); } }

/* ---------- Lightbox ---------- */
.lightbox{
  position: fixed; inset: 0; background: rgba(33,27,46,.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
  padding: 30px;
}
.lightbox.is-open{ opacity: 1; pointer-events: auto; }
.lightbox img{ max-width: 90vw; max-height: 85vh; }
.lightbox-close{
  position: absolute; top: 24px; right: 30px; color: var(--white);
  font-size: 2rem; background: none; border: none; cursor: pointer;
}

/* ---------- Blog ---------- */
.post-card{
  display: grid; grid-template-columns: 220px 1fr; gap: 26px;
  background: var(--white); border: 1px solid var(--gray-line);
  padding: 20px; margin-bottom: 22px; align-items: center;
}
.post-card img{ width: 100%; height: 150px; object-fit: cover; }
.post-card .tag{ font-family: var(--font-display); color: var(--red); font-weight: 700; font-size: .9rem; }
@media (max-width: 640px){ .post-card{ grid-template-columns: 1fr; } .post-card img{ height: 190px; } }

/* ---------- Forms ---------- */
.form-grid{ display: grid; gap: 20px; }
.form-row{ display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px){ .form-row{ grid-template-columns: 1fr; } }
label{ font-family: var(--font-display); font-weight: 600; display: block; margin-bottom: 6px; color: var(--navy); }
input, textarea, select{
  width: 100%; padding: 13px 14px; border: 1px solid var(--gray-line);
  border-radius: var(--radius); font-family: var(--font-body); font-size: 1rem;
  background: var(--white); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:focus, textarea:focus, select:focus{
  border-color: var(--purple); box-shadow: 0 0 0 3px rgba(91,42,131,.15); outline: none;
}

/* ---------- Donation ways ---------- */
.donate-grid{
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.donate-card{
  background: var(--white); border-top: 4px solid var(--red);
  padding: 32px; box-shadow: 0 10px 24px rgba(43,46,117,.08);
}

/* ---------- Scroll reveal ---------- */
[data-reveal]{
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].is-visible{ opacity: 1; transform: translateY(0); }

/* ---------- Utility ---------- */
.text-center{ text-align: center; }
.bg-purple{ background: var(--purple); color: var(--white); }
.bg-purple h2, .bg-purple h3{ color: var(--white); }
.mt-0{ margin-top: 0; }
.max-narrow{ max-width: 720px; margin-left: auto; margin-right: auto; }

/* Page header for interior pages */
.page-header{
  position: relative;
  background: var(--navy);
  color: var(--white);
  padding: 90px 24px 70px;
  text-align: center;
  overflow: hidden;
}
.page-header::after{
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 40px;
  background: var(--cream);
  clip-path: polygon(0 100%, 100% 40%, 100% 100%);
}
.page-header h1{ color: var(--white); margin-bottom: 10px; }
.page-header p{ color: rgba(255,255,255,.85); margin: 0 auto; }

/* Breadcrumb-ish crumb */
.crumb{ font-family: var(--font-display); color: var(--red); font-weight: 700; letter-spacing: .5px; display: inline-block; margin-bottom: 10px; }

/* ---------- Footer ---------- */
.site-footer{ background: var(--purple-deep); color: rgba(255,255,255,.85); padding-top: 72px; }
.footer-grid{
  display: grid; gap: 40px;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  padding-bottom: 56px;
}
@media (max-width: 900px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .footer-grid{ grid-template-columns: 1fr; } }
.footer-logo{ height: 52px; width: auto; background: var(--white); padding: 6px; border-radius: 6px; margin-bottom: 14px; }
.footer-brand p{ color: rgba(255,255,255,.7); max-width: 32ch; }
.footer-col h3{ color: var(--white); font-size: 1.15rem; margin-bottom: 16px; }
.footer-links li{ margin-bottom: 10px; color: rgba(255,255,255,.75); }
.footer-links a:hover{ color: var(--white); }
.social-row{ display: flex; gap: 12px; margin-top: 16px; }
.social-row a{
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--red); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.social-row a:hover{ background: var(--white); color: var(--purple); transform: translateY(-3px); }
.footer-bottom{ border-top: 1px solid rgba(255,255,255,.12); }
.footer-bottom-inner{
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px 24px; font-size: .88rem; color: rgba(255,255,255,.6);
}
.footer-verse{ font-style: italic; }
