// Variation A: STANDALONE (built out)
// Polished site for Restoring Hope, with real photos, real logo, modal bios.
const { useState, useEffect, useRef } = React;

// ─── Line icons ──────────────────────────────────────────
const Icon = {
  individual: (
    <svg
      viewBox="0 0 32 32"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <circle cx="16" cy="11" r="5" />
      <path d="M6 27c0-5.5 4.5-10 10-10s10 4.5 10 10" />
    </svg>
  ),
  family: (
    <svg
      viewBox="0 0 32 32"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <circle cx="10" cy="11" r="3.5" />
      <circle cx="22" cy="11" r="3.5" />
      <circle cx="16" cy="20" r="2.5" />
      <path d="M3 26c0-3.5 3-6 7-6s7 2.5 7 6" />
      <path d="M15 26c0-3.5 3-6 7-6s7 2.5 7 6" />
    </svg>
  ),
  emdr: (
    <svg
      viewBox="0 0 32 32"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <path d="M3 16c2-4 5-6 8-6s5 2 5 6-2 6-5 6-6-2-8-6z" />
      <path d="M29 16c-2-4-5-6-8-6s-5 2-5 6 2 6 5 6 6-2 8-6z" />
      <circle cx="11" cy="16" r="2" fill="currentColor" />
      <circle cx="21" cy="16" r="2" fill="currentColor" />
    </svg>
  ),
  early: (
    <svg
      viewBox="0 0 32 32"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <path d="M16 6c-4 0-7 3-7 7v4c0 1.5 1 3 3 3h8c2 0 3-1.5 3-3v-4c0-4-3-7-7-7z" />
      <circle cx="13" cy="14" r="0.8" fill="currentColor" />
      <circle cx="19" cy="14" r="0.8" fill="currentColor" />
      <path d="M9 13c-2 0-3 1-3 2.5S7 18 9 18" />
      <path d="M23 13c2 0 3 1 3 2.5S25 18 23 18" />
      <path d="M14 26c0-1 1-2 2-2s2 1 2 2" />
    </svg>
  ),
  neuro: (
    <svg
      viewBox="0 0 32 32"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <path d="M16 6c-3 0-5 2-5 4 0 1-2 2-2 4s2 2 2 4-2 2-2 4 2 4 5 4" />
      <path d="M16 6c3 0 5 2 5 4 0 1 2 2 2 4s-2 2-2 4 2 2 2 4-2 4-5 4" />
      <path d="M16 6v20" />
      <circle cx="13" cy="13" r="1" fill="currentColor" />
      <circle cx="19" cy="19" r="1" fill="currentColor" />
    </svg>
  ),
  free: (
    <svg
      viewBox="0 0 32 32"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <path d="M16 26S5 20 5 12.5C5 9 7.5 6.5 11 6.5c2 0 4 1 5 3 1-2 3-3 5-3 3.5 0 6 2.5 6 6C27 20 16 26 16 26z" />
    </svg>
  ),
  arrow: (
    <svg
      viewBox="0 0 16 16"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <path d="M3 8h10M9 4l4 4-4 4" />
    </svg>
  ),
  email: (
    <svg
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <rect x="3" y="6" width="18" height="13" rx="1.5" />
      <path d="M3 7l9 7 9-7" />
    </svg>
  ),
  phone: (
    <svg
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <path d="M5 4h4l2 5-3 2c1.5 3 3.5 5 6 6l2-3 5 2v4c0 1-1 2-2 2C10 22 2 14 2 6c0-1 1-2 3-2z" />
    </svg>
  ),
  pin: (
    <svg
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.25"
    >
      <path d="M12 22s8-7 8-13a8 8 0 10-16 0c0 6 8 13 8 13z" />
      <circle cx="12" cy="9" r="3" />
    </svg>
  ),
};

const services = [
  {
    icon: "individual",
    title: "Individual Therapy",
    desc: "One-on-one sessions tailored to your unique challenges: anxiety, depression, stress, grief, and life transitions.",
  },
  {
    icon: "family",
    title: "Family Counseling",
    desc: "Strengthen bonds and improve communication. Resolve conflict and build healthier relationship dynamics.",
  },
  {
    icon: "emdr",
    title: "EMDR Therapy",
    desc: "Eye Movement Desensitization and Reprocessing to process traumatic memories and reduce their emotional impact.",
  },
  {
    icon: "early",
    title: "Early Development",
    desc: "Support for early childhood development and parenting challenges. Navigate milestones and behavioral concerns.",
  },
  {
    icon: "neuro",
    title: "Neurodivergent Support",
    desc: "Specialized therapy that celebrates strengths alongside challenges, offering a supportive space for the neurodivergent.",
  },
  {
    icon: "free",
    title: "Sliding Scale Care",
    desc: "Compassionate counseling provided by supervised interns, providing affordable support for those who need it most.",
  },
];

const team = [
  {
    key: "kim",
    name: "Kim McLeod",
    credentials: "LPC, EMDR Therapist",
    focus: "Anxiety · Depression · Trauma",
    years: "Practicing since 2013",
    img: "assets/kim.webp",
    quote:
      "Between stimulus and response, there is a space. In that space lies our power to choose.",
    short:
      "Master of Science in Clinical Mental Health Counseling from Troy University, with extensive training in EMDR. Kim takes an eclectic, individualized approach, sometimes joined by Braeleigh, her therapy dog in training.",
    full: `"Between stimulus and response, there is a space. In that space is our power to choose our response. In our response lies our growth and our freedom." - Victor E. Frankl

Life can feel overwhelming at times, and how we respond to it plays a huge role in our mental and emotional well-being. Our thoughts shape our actions, and our actions shape our lives. I believe that by challenging negative thought patterns and shifting our focus, we can create meaningful and lasting change. My passion is helping others make those changes so they can live happier, more fulfilling lives. My primary areas of focus include anxiety, depression, and trauma.

I earned my Master of Science in Clinical Mental Health Counseling from Troy University in 2013 and I have had the privilege of working with children, adults, and families throughout my career. I take an eclectic approach to therapy, tailoring each session to meet the needs of each individual client. No two people are the same, and neither are the challenges they face, so therapy should never be one-size-fits-all.

I am also trained in Eye Movement Desensitization and Reprocessing (EMDR), a powerful tool for working through trauma, anxiety, and distressing life experiences.

Another addition to my therapeutic work is a wonderful dog named Braeleigh, who joins me when clients feel comfortable, offering comfort and support in sessions.

Whether it's through talk therapy, EMDR, or even a little support from Braeleigh, we're here to help you find your path toward healing. It's okay to not be okay. We are here for you!`,
  },
  {
    key: "george",
    name: "George Storey",
    credentials: "LPC",
    focus: "Trauma · ADHD · LGBTQ+",
    years: "Several years in mental health",
    img: "assets/george.webp",
    quote:
      "My role is to empower clients to make the best choices for their own lives.",
    short:
      "Bachelor's in Psychology and Master's in Clinical Mental Health Counseling, Troy University. Background spans youth program direction, GED counseling, and substance use support.",
    full: `George Storey is a Licensed Professional Counselor with several years of experience in the social services, nonprofit, and mental health fields. His prior experience includes directing a youth program, counseling those struggling with substance abuse, assisting foster children in transitioning to adoptive homes, and directing a program to assist students in obtaining their GEDs.

George, originally from Huntsville, Alabama, graduated from Huntsville High School and earned his Bachelor's of Psychology before completing his Master's in Clinical Mental Health Counseling at Troy University.

George's counseling approach is to empower clients to make the best choices for their lives. He has extensive training in trauma-informed care and experience treating depression, anxiety, ADHD, and LGBTQ+ issues.

When not working with clients, he enjoys spending time with his wife and four kids, playing guitar, reading, and gaming.`,
  },
  {
    key: "abbie",
    name: "Abbie Davies",
    credentials: "ALC",
    focus: "Social · Emotional · Behavioral",
    years: "Master's, 2023",
    img: "assets/abbie.webp",
    quote:
      "We all deserve the respect and space to share about the roads we have walked.",
    short:
      "Bachelor of Science in Psychology with a Minor in Criminal Justice (Troy University, 2016) and Master of Science in Counseling Clinical Mental Health (Troy University, 2023). Under supervision of Carol Booker, LPC-S.",
    full: `"When you change the way you think, you change the way you feel. When you change the way you feel, you change the way you act. When you change the way you act, you change your life." - Daniel Chidiac

My educational background includes receiving my Bachelor of Science in Psychology with a Minor in Criminal Justice from Troy University in 2016. Additionally, I completed my Master of Science in Counseling Clinical Mental Health at Troy University in 2023.

I believe in an eclectic approach to counseling, as no one person is the same. We all deserve to have the respect and space to share about the roads we have walked, where those roads have led, and how they have impacted us. As a counselor, we are the keeper and protector of our client's stories, whether they be from the past, present, or even future.

Being a counselor, I strive to provide each person with a safe space to share their stories, help them process and face their challenges, and guide them into healthier aspects of living. To help them find peace and healing so they can move toward the life they have dreamed of. I enjoy helping clients develop the tools and skills needed to manage various social, emotional, and behavioral struggles.

From a young age, I knew I wanted to help others and aid in their journey because I know what it is like to walk on those difficult paths. To watch someone take back their power and grow into the human they want to be is an incredible thing to witness, and it is the whole reason I come to work every day.

Practicing under supervision of Carol Booker, LPC-S (License # SC00225).`,
  },
  {
    key: "brae",
    name: "Braeleigh",
    credentials: "Therapy Partner",
    focus: "Comfort · Calm · Quiet support",
    years: "Working with Kim for 4 years",
    img: "assets/brae.webp",
    quote: "A name that means \u201CRay of Hope.\u201D",
    short:
      "AKC Canine Good Citizen. Joins Kim in sessions when clients feel comfortable, offering a calm, reassuring presence.",
    full: `Braeleigh is a dedicated therapy dog in training who has proudly earned her AKC Canine Good Citizen (CGC) title, a reflection of her excellent manners, steady obedience, and calm, reassuring presence. Her name, meaning "Ray of Hope," beautifully captures her gentle spirit and natural gift for bringing comfort to those around her.

For the past four years, Braeleigh has worked closely alongside her owner and therapeutic partner, Kim McLeod, LPC, forming a strong bond and a shared passion for supporting others. Together, they are committed to creating a warm, welcoming environment for every individual they serve.

Braeleigh is currently continuing her journey toward full therapy dog certification, with the heartfelt goal of making each day a little brighter for everyone she meets.`,
  },
];

const insurance = [
  "Blue Cross Blue Shield",
  "Medicare",
  "Medicaid",
  "UnitedHealthcare",
  "Cigna",
  "Aetna",
  "Humana",
];

const faqs = [
  {
    q: "How do I know if therapy is right for me?",
    a: "If you're navigating something difficult, such as grief, anxiety, a relationship strain, or a season of transition, therapy can help. There's no threshold of 'bad enough.' If you're considering it, that itself is enough reason to reach out. We offer a free initial conversation to feel out fit.",
  },
  {
    q: "Do you accept my insurance?",
    a: "We are in-network with Blue Cross Blue Shield, Medicare, Medicaid, UnitedHealthcare, Cigna, Aetna, and Humana. If your plan isn't listed, email us at contact@restoringhopellc.org and we'll check your specific coverage.",
  },
  {
    q: "What happens in a first session?",
    a: "The first session is mostly listening. Your therapist will ask about what's bringing you in, your history, and what you're hoping to work toward. There's no pressure; you can share as much or as little as feels right. Together, we will outline a path forward.",
  },
  {
    q: "Do you offer telehealth?",
    a: "Yes. Most of our clinicians offer secure video sessions for clients in Alabama. We're happy to discuss whether in-person, virtual, or a mix works best for you.",
  },
  {
    q: "How long does therapy take?",
    a: "It depends entirely on the work and the person. Some clients meet for a few months around a specific challenge; others stay longer for sustained growth. We'll talk openly about goals and pacing, and there's no obligation to continue beyond what serves you.",
  },
];

// ─── Hero bubbles ────────────────────────────────────
function playBubblePop(radius) {
  try {
    const Ctx = window.AudioContext || window.webkitAudioContext;
    if (!Ctx) return;
    const ctx = new Ctx();
    const t = ctx.currentTime;
    // brief click transient at the moment of pop
    const click = ctx.createOscillator();
    const clickGain = ctx.createGain();
    click.connect(clickGain);
    clickGain.connect(ctx.destination);
    click.type = "square";
    click.frequency.value = 1800;
    clickGain.gain.setValueAtTime(0.1, t);
    clickGain.gain.exponentialRampToValueAtTime(0.001, t + 0.022);
    click.start(t);
    click.stop(t + 0.03);
    // main tone: pitch drops fast, bigger bubble = lower pitch
    const pop = ctx.createOscillator();
    const popGain = ctx.createGain();
    pop.connect(popGain);
    popGain.connect(ctx.destination);
    const freq = Math.max(180, 720 - radius * 7);
    pop.type = "sine";
    pop.frequency.setValueAtTime(freq, t);
    pop.frequency.exponentialRampToValueAtTime(50, t + 0.13);
    popGain.gain.setValueAtTime(0.26, t);
    popGain.gain.exponentialRampToValueAtTime(0.001, t + 0.13);
    pop.start(t);
    pop.stop(t + 0.18);
  } catch (e) {}
}

const BUBBLE_DEFS = [
  { id: 0, r: 30, color: "#2A5754" },
  { id: 1, r: 18, color: "#B89456" },
  { id: 2, r: 44, color: "#93BCAD" },
  { id: 3, r: 14, color: "#B89456" },
  { id: 4, r: 26, color: "#2A5754" },
  { id: 5, r: 34, color: "#93BCAD" },
  { id: 6, r: 20, color: "#B89456" },
];

function HeroBubbles({ onPop, opacity }) {
  const containerRef = useRef(null);
  const elRefs = useRef([]);
  const physics = useRef(null);
  const raf = useRef(null);
  const opacityRef = useRef(opacity);

  // Keep opacityRef current and sync all live (non-popping) bubbles
  useEffect(() => {
    opacityRef.current = opacity;
    elRefs.current.forEach((el) => {
      if (el && !el.classList.contains("popping")) {
        el.style.opacity = String(opacity);
      }
    });
  }, [opacity]);

  useEffect(() => {
    const rand = (a, b) => a + Math.random() * (b - a);
    const sign = () => (Math.random() < 0.5 ? 1 : -1);
    physics.current = BUBBLE_DEFS.map((b) => ({
      ...b,
      x: rand(10, 90),
      y: rand(10, 90),
      vx: rand(0.008, 0.02) * sign(),
      vy: rand(0.008, 0.018) * sign(),
      popped: false,
    }));

    const tick = () => {
      const container = containerRef.current;
      if (!container) {
        raf.current = requestAnimationFrame(tick);
        return;
      }
      const { width, height } = container.getBoundingClientRect();

      physics.current.forEach((b, i) => {
        if (b.popped) return;
        const el = elRefs.current[i];
        if (!el) return;

        b.x += b.vx;
        b.y += b.vy;

        const mx = (b.r / width) * 100;
        const my = (b.r / height) * 100;
        if (b.x < mx) {
          b.x = mx;
          b.vx = Math.abs(b.vx);
        }
        if (b.x > 100 - mx) {
          b.x = 100 - mx;
          b.vx = -Math.abs(b.vx);
        }
        if (b.y < my) {
          b.y = my;
          b.vy = Math.abs(b.vy);
        }
        if (b.y > 100 - my) {
          b.y = 100 - my;
          b.vy = -Math.abs(b.vy);
        }

        el.style.left = b.x + "%";
        el.style.top = b.y + "%";
      });

      raf.current = requestAnimationFrame(tick);
    };

    raf.current = requestAnimationFrame(tick);
    return () => cancelAnimationFrame(raf.current);
  }, []);

  function handlePop(i) {
    const b = physics.current[i];
    const el = elRefs.current[i];
    if (!el || b.popped) return;
    b.popped = true;
    onPop();
    playBubblePop(b.r);
    el.classList.add("popping");
    setTimeout(() => {
      const rand = (a, v) => a + Math.random() * (v - a);
      b.x = rand(10, 90);
      b.y = rand(10, 90);
      b.vx = rand(0.008, 0.02) * (Math.random() < 0.5 ? 1 : -1);
      b.vy = rand(0.008, 0.018) * (Math.random() < 0.5 ? 1 : -1);
      const el2 = elRefs.current[i];
      if (el2) {
        el2.classList.remove("popping");
        el2.style.left = b.x + "%";
        el2.style.top = b.y + "%";
        el2.style.opacity = String(opacityRef.current);
      }
      b.popped = false;
    }, 520);
  }

  return (
    <div ref={containerRef} className="va-bubbles" aria-hidden="true">
      {BUBBLE_DEFS.map((b, i) => (
        <div
          key={b.id}
          ref={(el) => (elRefs.current[i] = el)}
          className="va-bubble"
          style={{
            width: b.r * 2 + "px",
            height: b.r * 2 + "px",
            "--bubble-color": b.color,
          }}
          onClick={() => handlePop(i)}
        />
      ))}
    </div>
  );
}

// ─── Components ────────────────────────────────────
function Nav({ scrolled, onOpenMobile }) {
  return (
    <nav className={`rh-nav${scrolled ? " scrolled" : ""}`}>
      <div className="container">
        <div className="rh-nav__inner">
          <a href="#home" className="rh-nav__brand">
            <span className="rh-nav__brand-text">
              <span>Restoring Hope</span>
              <em>Counseling LLC</em>
            </span>
          </a>
          <ul className="rh-nav__links">
            <li>
              <a href="#about">About</a>
            </li>
            <li>
              <a href="#services">Services</a>
            </li>
            <li>
              <a href="#team">Team</a>
            </li>
            <li>
              <a href="#insurance">Insurance</a>
            </li>
            <li>
              <a href="#faq">FAQ</a>
            </li>
          </ul>
          <button
            className="rh-nav__hamburger"
            onClick={onOpenMobile}
            aria-label="Menu"
          >
            Menu
          </button>
        </div>
      </div>
    </nav>
  );
}

function Hero() {
  const [poppedCount, setPoppedCount] = useState(0);
  const total = BUBBLE_DEFS.length;

  const contentOpacity =
    poppedCount === 0 ? 1 : Math.max(0, 1 - poppedCount / total);
  const bubbleOpacity = 0.14 + (poppedCount / total) * 0.5;

  // Reset when the hero section scrolls fully out of view
  useEffect(() => {
    const section = document.getElementById("home");
    const onScroll = () => {
      if (section && section.getBoundingClientRect().bottom < 0) {
        setPoppedCount(0);
      }
    };
    window.addEventListener("scroll", onScroll, { passive: true });
    return () => window.removeEventListener("scroll", onScroll);
  }, []);

  return (
    <section id="home" className="va-hero">
      <svg
        className="va-hero__motif"
        viewBox="0 0 1400 900"
        preserveAspectRatio="xMidYMid slice"
        aria-hidden="true"
      >
        <defs>
          <linearGradient id="vaGrad1" x1="0" y1="0" x2="1" y2="1">
            <stop offset="0" stopColor="#B89456" stopOpacity="0.18" />
            <stop offset="1" stopColor="#7FAF9F" stopOpacity="0.08" />
          </linearGradient>
          <linearGradient id="vaGrad2" x1="1" y1="0" x2="0" y2="1">
            <stop offset="0" stopColor="#7FAF9F" stopOpacity="0.12" />
            <stop offset="1" stopColor="#B89456" stopOpacity="0.05" />
          </linearGradient>
        </defs>
        <ellipse cx="1180" cy="180" rx="420" ry="380" fill="url(#vaGrad1)" />
        <ellipse cx="180" cy="780" rx="380" ry="300" fill="url(#vaGrad2)" />
        <path
          d="M-50 600 Q 350 500 700 580 T 1450 540"
          stroke="#B89456"
          strokeWidth="1"
          fill="none"
          opacity="0.22"
        />
        <path
          d="M-50 640 Q 350 540 700 620 T 1450 580"
          stroke="#B89456"
          strokeWidth="1"
          fill="none"
          opacity="0.13"
        />
      </svg>

      <HeroBubbles
        onPop={() => setPoppedCount((c) => Math.min(c + 1, total))}
        opacity={bubbleOpacity}
      />

      <div className="container">
        <div
          className="va-hero__inner"
          style={{ opacity: contentOpacity, transition: "opacity 1s ease" }}
        >
          <div className="va-hero__copy">
            <h1 className="va-hero__title">
              A quiet space to <em>listen</em>,<br />
              heal, and grow.
            </h1>
            <p className="va-hero__lede">
              Compassionate, evidence-based therapy for individuals, families,
              and children. Whether you're navigating anxiety, trauma, or a
              season of change, we're here.
            </p>
            <div className="va-hero__cta">
              <a href="#contact" className="btn btn--primary">
                Start your journey <span className="arrow">→</span>
              </a>
              <a href="#services" className="btn btn--ghost">
                Explore services
              </a>
            </div>
          </div>

          <div className="va-hero__logo">
            <img
              src="assets/new_logo.PNG"
              alt="Restoring Hope Counseling LLC, formerly Care Counseling of Troy"
            />
          </div>
        </div>
      </div>
    </section>
  );
}

function InsuranceStrip() {
  return (
    <section className="va-strip" aria-label="Accepted insurance">
      <div className="va-strip__track">
        {[...insurance, ...insurance, ...insurance].map((name, i) => (
          <span key={i} className="va-strip__item">
            {name}
          </span>
        ))}
      </div>
    </section>
  );
}

function About() {
  return (
    <section id="about" className="rh-section rh-section--paper va-about">
      <div className="container">
        <div className="va-about__grid">
          <div className="va-about__head">
            <span className="eyebrow">About</span>
            <h2 className="va-about__title">
              Healing happens in safe, considered spaces.
            </h2>
          </div>
          <div className="va-about__body">
            <p className="va-about__lead">
              At Restoring Hope, we believe everyone deserves compassionate,
              professional support on their journey toward emotional wellness.
            </p>
            <p>
              Our team of licensed therapists creates a non-judgmental space
              where healing can happen. Whether you're working through anxiety,
              grief, relationship issues, or simply seeking growth, we meet you
              where you are at the pace your life requires.
            </p>
            <div className="va-about__pillars">
              <div className="va-about__pillar">
                <span className="va-about__pillar-n">01</span>
                <h4>Evidence-based</h4>
                <p>
                  EMDR, CBT, and other modalities matched to your needs, held
                  inside a warm relationship.
                </p>
              </div>
              <div className="va-about__pillar">
                <span className="va-about__pillar-n">02</span>
                <h4>Individualized</h4>
                <p>
                  No one-size-fits-all. Every plan is built for the person in
                  the room.
                </p>
              </div>
              <div className="va-about__pillar">
                <span className="va-about__pillar-n">03</span>
                <h4>Confidential</h4>
                <p>
                  Privacy and trust are the foundation of every relationship we
                  build.
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

function Process() {
  return (
    <section className="rh-section va-process">
      <div className="container">
        <div className="rh-sec-head">
          <div>
            <span className="eyebrow">How it Works</span>
            <h2 className="rh-sec-head__title">
              A simple, unhurried path forward.
            </h2>
          </div>
          <p className="rh-sec-head__lede">
            From first reach-out to ongoing care; here's what to expect when you
            work with us.
          </p>
        </div>
        <div className="va-process__steps">
          <div className="va-process__step">
            <span className="va-process__step-n">Step 01</span>
            <h4>Reach out</h4>
            <p>
              Send a brief note about what's bringing you in. We respond within
              one business day.
            </p>
          </div>
          <div className="va-process__step">
            <span className="va-process__step-n">Step 02</span>
            <h4>Find your fit</h4>
            <p>
              We'll suggest a clinician whose specialties and approach match
              what you're working through.
            </p>
          </div>
          <div className="va-process__step">
            <span className="va-process__step-n">Step 03</span>
            <h4>First session</h4>
            <p>
              An unhurried conversation. You share what feels right. We listen,
              and we plan together.
            </p>
          </div>
          <div className="va-process__step">
            <span className="va-process__step-n">Step 04</span>
            <h4>The work</h4>
            <p>
              Weekly or biweekly sessions, paced to you. We check in often on
              what's helping, and what's not.
            </p>
          </div>
        </div>
      </div>
    </section>
  );
}

function Services() {
  return (
    <section id="services" className="rh-section rh-section--cream va-services">
      <div className="container">
        <div className="rh-sec-head">
          <div>
            <span className="eyebrow">Services</span>
            <h2 className="rh-sec-head__title">
              Care, tailored to where you are.
            </h2>
          </div>
          <p className="rh-sec-head__lede">
            Six specialties, one shared standard: respectful, evidence-based,
            and led by your goals.
          </p>
        </div>

        <div className="va-services__grid">
          {services.map((s, i) => (
            <article key={s.title} className="va-service">
              <div className="va-service__top">
                <span className="va-service__num">
                  {String(i + 1).padStart(2, "0")} / 06
                </span>
                <span className="va-service__icon">{Icon[s.icon]}</span>
              </div>
              <h3 className="va-service__title">{s.title}</h3>
              <p className="va-service__desc">{s.desc}</p>
              <a href="#contact" className="va-service__more">
                Learn more
                <span style={{ display: "inline-flex", width: 14, height: 14 }}>
                  {Icon.arrow}
                </span>
              </a>
            </article>
          ))}
        </div>
      </div>
    </section>
  );
}

function Testimonial() {
  return (
    <section className="va-testimonial">
      <div className="container">
        <div className="va-testimonial__inner">
          <div className="va-testimonial__mark">"</div>
          <blockquote>
            For the first time in years, I felt like someone was really
            listening. The work has been hard, but it's the first thing that's
            actually helped.
          </blockquote>
          <span className="va-testimonial__cite">Client, Anonymous</span>
        </div>
      </div>
    </section>
  );
}

function Team({ onOpenBio }) {
  return (
    <section id="team" className="rh-section rh-section--paper va-team">
      <div className="container">
        <div className="rh-sec-head">
          <div>
            <span className="eyebrow">The Team</span>
            <h2 className="rh-sec-head__title">
              The people who'll walk alongside you.
            </h2>
          </div>
          <p className="rh-sec-head__lede">
            Each member of our team brings their own training, perspective, and
            warmth, along with a shared belief that you don't have to figure it
            out alone.
          </p>
        </div>

        <div className="va-team__list">
          {team.map((m) => (
            <article key={m.name} className="va-team__row">
              <div className="va-team__photo">
                <div className="va-team__frame" data-who={m.key}>
                  <img src={m.img} alt={m.name} />
                </div>
              </div>
              <div className="va-team__body">
                <span className="eyebrow">{m.years}</span>
                <h3 className="va-team__name">{m.name}</h3>
                <p className="va-team__cred">{m.credentials}</p>
                <blockquote className="va-team__quote">"{m.quote}"</blockquote>
                <p className="va-team__bio">{m.short}</p>
                <div className="va-team__meta">
                  <div>
                    <span className="va-team__meta-k">Focus areas</span>
                    <span className="va-team__meta-v">{m.focus}</span>
                  </div>
                  <button
                    className="btn btn--primary va-team__book"
                    onClick={() => onOpenBio(m)}
                  >
                    Read full bio <span className="arrow">→</span>
                  </button>
                </div>
              </div>
            </article>
          ))}
        </div>
      </div>
    </section>
  );
}

function Insurance() {
  return (
    <section
      id="insurance"
      className="rh-section rh-section--teal va-insurance"
    >
      <div className="container">
        <div className="va-insurance__inner">
          <div>
            <span className="eyebrow">Coverage</span>
            <h2 className="va-insurance__title">
              In-network with most major insurers.
            </h2>
            <p className="va-insurance__lede">
              We work with seven of the largest providers in the country. Not
              sure about your plan? Use our secure portal to send us your
              details and we'll verify your coverage before your first visit.
            </p>
            <a
              href="https://restoringhopellc.clientsecure.me/contact-widget"
              target="_blank"
              rel="noreferrer"
              className="btn btn--ghost-light"
            >
              Verify my coverage <span className="arrow">→</span>
            </a>
          </div>
          <ul className="va-insurance__list">
            {insurance.map((name, i) => (
              <li key={name}>
                <span className="va-insurance__num">
                  {String(i + 1).padStart(2, "0")}
                </span>
                <span className="va-insurance__name">{name}</span>
                <span className="va-insurance__status">In-network</span>
              </li>
            ))}
          </ul>
        </div>
      </div>
    </section>
  );
}

function FAQ() {
  const [open, setOpen] = useState(0);
  return (
    <section id="faq" className="rh-section rh-section--paper va-faq">
      <div className="container">
        <div className="rh-sec-head">
          <div>
            <span className="eyebrow">Frequently Asked</span>
            <h2 className="rh-sec-head__title">
              Common questions, candid answers.
            </h2>
          </div>
          <p className="rh-sec-head__lede">
            Still wondering? Email us at{" "}
            <a href="mailto:contact@restoringhopellc.org">
              contact@restoringhopellc.org
            </a>{" "}
            and we read every note.
          </p>
        </div>
        <div className="va-faq__list">
          {faqs.map((f, i) => (
            <div key={i} className={`va-faq__item${open === i ? " open" : ""}`}>
              <button
                className="va-faq__btn"
                onClick={() => setOpen(open === i ? -1 : i)}
                aria-expanded={open === i}
              >
                <span className="va-faq__num">
                  {String(i + 1).padStart(2, "0")}
                </span>
                <span className="va-faq__q">{f.q}</span>
                <span className="va-faq__plus" aria-hidden="true"></span>
              </button>
              <div className="va-faq__a">
                <div>
                  <p>{f.a}</p>
                </div>
              </div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

function Contact() {
  const address = "1305 Elba Highway, Troy, AL 36079";
  const email = "contact@restoringhopellc.org";
  const mapsUrl = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;
  const [addressCopied, setAddressCopied] = useState(false);
  const [emailCopied, setEmailCopied] = useState(false);

  function copyAddress() {
    if (!navigator.clipboard) return;
    navigator.clipboard.writeText(address).then(() => {
      setAddressCopied(true);
      window.setTimeout(() => setAddressCopied(false), 1800);
    });
  }

  function copyEmail() {
    if (!navigator.clipboard) return;
    navigator.clipboard.writeText(email).then(() => {
      setEmailCopied(true);
      window.setTimeout(() => setEmailCopied(false), 1800);
    });
  }

  return (
    <section id="contact" className="rh-section va-contact">
      <div className="container container--narrow">
        <div className="va-contact__card">
          <span className="eyebrow">Begin</span>
          <h2 className="va-contact__title">
            Take the <em>first</em> step.
            <br />
            We'll meet you there.
          </h2>
          <p className="va-contact__lede">
            Booking an intake takes about two minutes. We'll respond within one
            business day to confirm your fit and schedule.
          </p>
          <div className="va-contact__cta">
            <a
              href="mailto:contact@restoringhopellc.org"
              className="btn btn--gold btn--large"
            >
              Contact us <span className="arrow">→</span>
            </a>
            <a
              href="https://restoringhopellc.clientsecure.me"
              className="btn btn--gold btn--large"
            >
              Book a session <span className="arrow">→</span>
            </a>
            <a
              href="tel:+13347701423"
              className="btn btn--gold btn--large va-contact__call"
              data-number="(334) 770-1423"
            >
              <span className="va-contact__call-label">
                <span style={{ display: "inline-flex", width: 16, height: 16 }}>
                  {Icon.phone}
                </span>
                Call us
              </span>
              <span className="va-contact__call-number">(334) 770-1423</span>
            </a>
          </div>
          <div className="va-contact__meta">
            <div>
              <span className="va-contact__meta-k">Email</span>
              <span className="va-contact__meta-v va-contact__meta-action">
                <span>{email}</span>
                <span
                  className="va-contact__meta-actions"
                  aria-label="Email actions"
                >
                  <a href={`mailto:${email}`}>Send an email</a>
                  <button type="button" onClick={copyEmail}>
                    {emailCopied ? "Copied" : "Copy email"}
                  </button>
                </span>
              </span>
            </div>
            <div>
              <span className="va-contact__meta-k">Office</span>
              <span className="va-contact__meta-v va-contact__meta-action">
                <span>{address}</span>
                <span
                  className="va-contact__meta-actions"
                  aria-label="Office address actions"
                >
                  <a href={mapsUrl} target="_blank" rel="noreferrer">
                    Open on Google Maps
                  </a>
                  <button type="button" onClick={copyAddress}>
                    {addressCopied ? "Copied" : "Copy address"}
                  </button>
                </span>
              </span>
            </div>
            <div>
              <span className="va-contact__meta-k">Hours</span>
              <span className="va-contact__meta-v">
                Mon–Thurs · 8 A.M. – 5 P.M. CST
              </span>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

function Footer() {
  return (
    <footer className="rh-footer">
      <div className="container">
        <div className="rh-footer__top">
          <div>
            <h3 className="rh-footer__brand">Restoring Hope</h3>
            <p style={{ maxWidth: 360, color: "rgba(244,234,211,0.6)" }}>
              Licensed therapists offering individual, family, and EMDR therapy
              for the Troy, Alabama community and beyond.
            </p>
          </div>
          <div>
            <h4>Visit</h4>
            <ul>
              <li>
                <a href="#about">About</a>
              </li>
              <li>
                <a href="#services">Services</a>
              </li>
              <li>
                <a href="#team">Team</a>
              </li>
              <li>
                <a href="#insurance">Insurance</a>
              </li>
              <li>
                <a href="#faq">FAQ</a>
              </li>
            </ul>
          </div>
          <div>
            <h4>Contact</h4>
            <ul>
              <li>
                <a href="mailto:contact@restoringhopellc.org">
                  contact@restoringhopellc.org
                </a>
              </li>
              <li>Troy, Alabama</li>
              <li>Mon–Thurs · 8 A.M. – 5 P.M. CST</li>
            </ul>
          </div>
          <div>
            <h4>Practice</h4>
            <ul>
              <li>Restoring Hope LLC</li>
              <li>Formerly Care Counseling of Troy</li>
            </ul>
          </div>
        </div>
        <div className="rh-footer__bottom">
          <span>© 2026 Restoring Hope Counseling LLC</span>
          <span>Confidentiality is our highest priority</span>
        </div>
      </div>
    </footer>
  );
}

function BioModal({ member, onClose }) {
  useEffect(() => {
    if (!member) return;
    const onKey = (e) => {
      if (e.key === "Escape") onClose();
    };
    document.addEventListener("keydown", onKey);
    document.body.style.overflow = "hidden";
    return () => {
      document.removeEventListener("keydown", onKey);
      document.body.style.overflow = "";
    };
  }, [member, onClose]);

  if (!member) return null;
  return (
    <div className={`va-modal${member ? " open" : ""}`}>
      <div className="va-modal__backdrop" onClick={onClose}></div>
      <div className="va-modal__inner" onClick={(e) => e.stopPropagation()}>
        <button
          className="va-modal__close"
          onClick={onClose}
          aria-label="Close"
        >
          ×
        </button>
        <div className="va-modal__body">
          <div className="va-modal__head">
            <div className="va-modal__photo" data-who={member.key}>
              <img src={member.img} alt={member.name} />
            </div>
            <div className="va-modal__identity">
              <p className="va-modal__cred">{member.credentials}</p>
              <h2 className="va-modal__name">{member.name}</h2>
              <p className="va-modal__focus">{member.focus}</p>
            </div>
          </div>
          <div className="va-modal__bio">{member.full}</div>
        </div>
      </div>
    </div>
  );
}

function App() {
  const [scrolled, setScrolled] = useState(false);
  const [bio, setBio] = useState(null);

  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 60);
    window.addEventListener("scroll", onScroll, { passive: true });
    onScroll();
    return () => window.removeEventListener("scroll", onScroll);
  }, []);

  // Smooth scroll for anchor links
  useEffect(() => {
    const handler = (e) => {
      const a = e.target.closest('a[href^="#"]');
      if (!a) return;
      const id = a.getAttribute("href").slice(1);
      if (!id) return;
      const el = document.getElementById(id);
      if (el) {
        e.preventDefault();
        window.scrollTo({ top: el.offsetTop - 80, behavior: "smooth" });
      }
    };
    document.addEventListener("click", handler);
    return () => document.removeEventListener("click", handler);
  }, []);

  return (
    <div className="rh va-root">
      <Nav scrolled={scrolled} onOpenMobile={() => {}} />
      <Hero />
      <About />
      <Services />
      <Team onOpenBio={setBio} />
      <Insurance />
      <FAQ />
      <Contact />
      <Footer />
      <BioModal member={bio} onClose={() => setBio(null)} />
    </div>
  );
}

ReactDOM.createRoot(document.getElementById("root")).render(<App />);
