/* =========================================
   CSS Custom Properties & Reset
   ========================================= */
:root {
    /* Colors */
    --clr-cream: #EDE4CF;
    --clr-cream-light: #F5EFE3;
    --clr-forest: #1F3D2B;
    --clr-sage: #8C9678;
    --clr-body: #2A2E28;
    
    /* Typography */
    --font-serif: 'Fraunces', serif;
    --font-sans: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    
    /* Spacing */
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--clr-cream);
    color: var(--clr-body);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   Typography & Shared Styles
   ========================================= */
h1, h2, h3, h4, .logo {
    font-family: var(--font-serif);
    color: var(--clr-forest);
    font-weight: 400;
    line-height: 1.1;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-sage);
    display: block;
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hairline-divider {
    border: none;
    border-top: 1px solid rgba(31, 61, 43, 0.15);
    margin: 0;
}

.bg-green {
    background-color: var(--clr-forest);
    color: var(--clr-cream);
}

.bg-green .eyebrow {
    color: var(--clr-sage);
}

.bg-green h1, .bg-green h2, .bg-green h3, .bg-green h4 {
    color: var(--clr-cream);
}

.text-cream {
    color: var(--clr-cream-light) !important;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-sans);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: var(--clr-forest);
    color: var(--clr-cream);
}

.btn-primary:hover {
    background-color: var(--clr-body);
    color: var(--clr-cream-light);
}

.nav-btn.btn-primary:hover {
    background-color: var(--clr-cream-light);
    color: var(--clr-forest);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--clr-forest);
    color: var(--clr-forest);
}

.btn-outline:hover {
    background-color: var(--clr-forest);
    color: var(--clr-cream);
}

.btn-text {
    background-color: transparent;
    color: var(--clr-forest);
    border-bottom: 1px solid var(--clr-forest);
    padding: 0.25rem 0;
}

.btn-text:hover {
    color: var(--clr-sage);
    border-bottom-color: var(--clr-sage);
}

.btn-full {
    width: 100%;
    display: block;
}

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    z-index: 100;
    padding: 0.75rem 2rem;
    box-shadow: 0 10px 30px rgba(31, 61, 43, 0.08);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.site-header.nav-hidden {
    transform: translate(-50%, -150%) !important;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--clr-body);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--clr-sage);
}

.nav-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 50px;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    padding: 0.5rem;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 1px;
    background-color: var(--clr-forest);
    transition: all 0.3s ease;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    padding: var(--space-xl) 0 var(--space-lg);
    padding-top: calc(var(--space-xl) + 5rem);
    will-change: filter;
    --gray-val: 1;
    filter: grayscale(var(--gray-val));
}

.hero-container {
    max-width: 900px;
    margin: 0;
}

.hero-subline {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    color: var(--clr-sage);
    margin-bottom: 1.5rem;
    border-left: 2px solid var(--clr-sage);
    padding-left: 0.75rem;
}

.hero-headline {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

/* Pulse Animation */
.pulse-container {
    margin: 3rem 0;
    width: 100%;
    max-width: 500px;
    height: 50px;
}

.pulse-line {
    width: 100%;
    height: 100%;
    stroke: var(--clr-forest);
    stroke-width: 1px;
    fill: none;
}

.pulse-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* =========================================
   Mission / Quote Section
   ========================================= */
.mission-section {
    padding: var(--space-lg) 0;
    will-change: filter;
    --gray-val: 0.8;
    filter: grayscale(var(--gray-val));
}

.mission-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.mission-content .eyebrow {
    margin-bottom: 2rem;
}

/* =========================================
   State of Care Typographic Transition
   ========================================= */
.state-of-care-transition {
    position: relative;
    font-family: var(--font-heading);
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 1;
    font-weight: 500;
    margin: 4rem 0;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    overflow: hidden;
}

.soc-text {
    width: 100%;
}

.soc-base {
    color: var(--clr-sage);
    opacity: 0.5;
}

.soc-fill {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--clr-forest);
    clip-path: polygon(0 0, 0% 0, 0% 100%, 0 100%);
    white-space: nowrap;
}

.mission-quote {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-style: italic;
    color: var(--clr-forest);
    line-height: 1.4;
}

/* =========================================
   Programs Section
   ========================================= */
.programs-section {
    padding: var(--space-xl) 0;
    position: relative;
}

/* =========================================
   Community Thread SVGs
   ========================================= */
.thread-container {
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

@media (max-width: 768px) {
    .thread-container {
        display: none;
    }
}

.thread-path {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.thread-line {
    fill: none;
    stroke: var(--clr-sage);
    stroke-width: 2px;
    opacity: 0.6;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--space-lg);
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.program-card {
    position: relative;
    padding-top: 2rem;
    border-top: 1px solid var(--clr-forest);
}

.program-number {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--clr-sage);
    position: absolute;
    top: -1.5rem;
}

.program-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.program-desc {
    color: var(--clr-body);
}

/* =========================================
   Impact Section
   ========================================= */
.impact-section {
    padding: var(--space-xl) 0;
    position: relative;
}

.impact-statement {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4vw, 3rem);
    line-height: 1.3;
    max-width: 900px;
}

.impact-number {
    font-style: italic;
    color: var(--clr-sage);
}

/* =========================================
   Story Section
   ========================================= */
.story-section {
    padding: var(--space-xl) 0;
    position: relative;
}

.story-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
}

.story-image-wrapper {
    aspect-ratio: 4/5;
    background-color: var(--clr-forest);
    position: relative;
}

.image-placeholder {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    color: var(--clr-cream);
    font-size: 0.85rem;
    border: 1px solid rgba(237, 228, 207, 0.3);
}

.story-headline {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.story-text {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.story-author {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--clr-sage);
    text-transform: uppercase;
}

/* =========================================
   Raised So Far Section
   ========================================= */
.raised-section {
    padding: var(--space-lg) 0;
    position: relative;
}

.raised-card {
    border-top: 1px solid var(--clr-sage);
    border-bottom: 1px solid var(--clr-sage);
    padding: var(--space-lg) 0;
    text-align: left;
}

.tasbih-heading-container {
    text-align: center;
    margin-bottom: 1rem;
}

.tasbih-heading-container .eyebrow {
    margin-bottom: 0.5rem;
}

.tasbih-heading-container .section-title {
    margin-bottom: 0;
}

.tasbih-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.tasbih-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 2rem 0 3rem;
}

.tasbih-ayat-block {
  max-width: 340px;
  text-align: center;
}

.tasbih-ayat-arabic {
  font-family: 'Aref Ruqaa', serif;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.8;
  color: var(--clr-forest);
  opacity: 1;
}

.tasbih-ayat-translation {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--clr-body);
  margin-top: 0.75rem;
  line-height: 1.6;
}

.tasbih-ayat-ref {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.75rem;
  color: var(--clr-sage);
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .tasbih-section {
    flex-direction: column;
    gap: 2.5rem;
  }
  .tasbih-ayat-arabic {
    font-size: 1.6rem;
  }
  .tasbih-divider {
    display: none;
  }
}

.tasbih-divider {
  width: 2px;
  height: 200px;
  align-self: center;
}

.tasbih-ring {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  z-index: 1;
}

.bead {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.bead-filled {
  background: var(--clr-forest);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.bead-hollow {
  background: transparent;
  border: 1.5px solid var(--clr-sage);
  opacity: 0.5;
}

.tasbih-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 70%;
}

.tasbih-tail {
  position: relative;
  /* The wrapper is already flex-aligned center, but just in case, ensure it's flush */
  margin-top: 12px; 
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
}

.tasbih-tail .bead {
  position: static;
}

/* Offset tail beads for natural drape */
.tasbih-tail .bead:nth-child(1) { margin-left: 2px; }
.tasbih-tail .bead:nth-child(2) { margin-left: 4px; }
.tasbih-tail .bead:nth-child(3) { margin-left: 2px; }

.tasbih-end-bead {
  width: 20px;
  height: 26px;
  border-radius: 50% 50% 45% 45%;
  background: var(--clr-forest);
  margin-top: 4px;
}

.tasbih-amount {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--clr-forest);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.tasbih-goal {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--clr-sage);
    font-weight: 400;
    display: block;
    white-space: nowrap;
    margin-top: 2px;
}

.tasbih-caption {
    font-family: var(--font-sans);
    color: var(--clr-body);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.tasbih-mobile-detail {
    display: block;
    text-align: center;
    margin-top: 0.25rem;
    max-width: 85%;
}

.tasbih-mobile-detail .tasbih-caption {
    margin-bottom: 0;
}

.tasbih-mobile-detail .tasbih-updated {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--clr-sage);
    opacity: 0.8;
    margin-top: 4px;
    text-transform: uppercase;
}

.tasbih-progress-bar {
    width: 60%;
    height: 4px;
    background-color: rgba(31, 61, 43, 0.1);
    border-radius: 4px;
    margin: 0.75rem auto 0;
    overflow: hidden;
    display: block;
}

.tasbih-progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--clr-forest);
    border-radius: 4px;
}



.raised-updated {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--clr-sage);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 64px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo:hover .logo-image {
    opacity: 0.9;
    transform: scale(1.05);
}


/* =========================================
   Get Involved Section
   ========================================= */
.get-involved-section {
    padding: var(--space-xl) 0;
    position: relative;
}

.involved-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.involved-card {
    background-color: var(--clr-cream-light);
    padding: var(--space-md);
    border: 1px solid rgba(31, 61, 43, 0.1);
}

.card-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.card-desc {
    margin-bottom: 2rem;
}

/* JazzCash Specifics */
.jazzcash-info {
    margin-top: 2rem;
}

.payment-instruction {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.copy-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: transparent;
    border: 1px dashed var(--clr-forest);
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background-color: rgba(31, 61, 43, 0.05);
}

.copy-btn.copied {
    background-color: var(--clr-sage);
    border-color: var(--clr-sage);
    color: var(--clr-cream);
}

.copy-btn .number {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
}

.copy-btn .copy-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.confirmation-note {
    font-size: 0.85rem;
    color: var(--clr-sage);
    margin-bottom: 1.5rem;
}

/* =========================================
   Footer
   ========================================= */
.site-footer {
    padding: var(--space-lg) 0;
    border-top: 1px solid rgba(31, 61, 43, 0.15);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-md);
}

.footer-desc {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--clr-sage);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--clr-body);
    text-decoration: none;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--clr-forest);
}

.footer-heading {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-forest);
    margin-bottom: 1.5rem;
}

.location-text, .email-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--clr-body);
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.email-link:hover {
    color: var(--clr-forest);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-icon {
    color: var(--clr-forest);
    transition: transform 0.3s ease, color 0.3s ease;
    display: flex;
}

.social-icon:hover {
    transform: translateY(-3px);
    color: var(--clr-body);
}

.footer-bottom {
    border-top: 1px solid rgba(31, 61, 43, 0.1);
    margin-top: 3rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--clr-sage);
}

/* =========================================
   Animations
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.programs-grid .program-card:nth-child(2) { transition-delay: 0.1s; }
.programs-grid .program-card:nth-child(3) { transition-delay: 0.2s; }
.involved-grid .involved-card:nth-child(2) { transition-delay: 0.15s; }

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 860px) {
    :root {
        /* Reduce spacing on mobile for tighter layout */
        --space-lg: 3rem;
        --space-xl: 4rem;
    }

    .hero-headline {
        font-size: clamp(2rem, 8vw, 3rem); /* Slightly smaller on mobile to prevent wrapping issues */
        margin-bottom: 2rem;
    }

    .hamburger-menu {
        display: flex;
        z-index: 200;
    }

    .site-header {
        top: auto;
        bottom: 1.5rem;
        padding: 0.75rem 1.5rem;
        width: 95%;
        overflow: hidden; /* Contains the expanding menu items */
        /* height is auto by default, GSAP will animate it */
    }

    .site-header.nav-hidden {
        transform: translate(-50%, 150%) !important;
    }

    .header-container {
        /* Allow children to be absolutely positioned relative to .site-header */
        position: static;
        width: 100%;
        padding: 0;
        display: flex;
        justify-content: center;
    }

    .logo {
        transition: opacity 0.3s ease;
    }

    .hamburger-menu {
        display: flex;
        z-index: 200;
        /* Position absolute relative to .site-header */
        position: absolute;
        right: 1.5rem; /* Matches .site-header padding */
        top: 50%;
        transform: translateY(-50%);
    }

    .main-nav {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: calc(100% - 60px); /* Leave space at bottom for the X button */
        background-color: transparent;
        flex-direction: column;
        justify-content: center;
        gap: 3rem; /* More spacing between links and the button */
        /* Start hidden inside the pill */
        visibility: hidden;
        z-index: 99;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start; /* Left justify the text inside the block */
        gap: 1rem;
        width: max-content; /* Make block only as wide as its text */
        align-self: center; /* Center the whole block horizontally */
        padding-left: 0;
    }

    .nav-links a {
        font-size: 1.25rem; /* Smaller font size than before */
        font-family: var(--font-serif);
    }
    
    .main-nav .nav-btn {
        align-self: center; /* Keep the button centered */
    }
    
    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(3.5px) rotate(45deg);
    }
    
    .hamburger-menu.active .bar:nth-child(2) {
        transform: translateY(-3.5px) rotate(-45deg);
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        text-align: center;
    }

    .pulse-container {
        margin: 4.5rem 0;
    }

    .story-container {
        grid-template-columns: 1fr;
    }

    .involved-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 640px) {
    .raised-card {
        padding: var(--space-md) 0;
        text-align: center;
    }
    
    .raised-amount {
        font-size: clamp(36px, 10vw, 64px);
    }
}

/* =========================================
   Blob Cursor
   ========================================= */
.blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

@media (max-width: 860px), (hover: none) and (pointer: coarse) {
    .blob-container {
        display: none !important;
    }
}

.blob-main {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
    user-select: none;
    cursor: default;
}

.blob {
    position: absolute;
    will-change: transform;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: var(--clr-forest);
    box-shadow: 10px 10px 5px 0 rgba(0,0,0,0.75);
}

.blob:nth-child(1) { width: 60px; height: 60px; opacity: 0.6; }
.blob:nth-child(2) { width: 125px; height: 125px; opacity: 0.6; }
.blob:nth-child(3) { width: 75px; height: 75px; opacity: 0.6; }

.inner-dot {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.8);
}

.blob:nth-child(1) .inner-dot { width: 20px; height: 20px; top: 20px; left: 20px; }
.blob:nth-child(2) .inner-dot { width: 35px; height: 35px; top: 45px; left: 45px; }
.blob:nth-child(3) .inner-dot { width: 25px; height: 25px; top: 25px; left: 25px; }
