/* ================================================================
   MOTION.CSS — Three small scroll/hover effects for growuild

   1. Text Mask scroll reveal — word-by-word opacity fade as a heading
      / paragraph enters the viewport. Excludes card-internal text.
   2. Sitewide skeleton preview — text starts as a soft grey bar and
      fades to the real text when scrolled into view.
   3. Fluid Card hover — project-card overlay with title + EXPLORE → on
      hover; image scales smoothly underneath.

   Pairs with assets/motion.js. Each effect is independently enabled.
   ================================================================ */


/* ---------------- 1) Text Mask scroll reveal ----------------
   The JS sets --mw-op (0..1) on each .mw-word as the user scrolls.
   Words start at low opacity and ramp to 1 once they pass the
   viewport's reveal line. */

.mw-text .mw-word {
    display: inline-block;
    opacity: var(--mw-op, 0.18);
    transition: opacity 0.18s ease-out;
    will-change: opacity;
}

/* Inside cards we never split text — but if a stray .mw-word lands
   inside a card class, force it to render as plain text. */
.package-card .mw-word,
.addon-card  .mw-word,
.care-card   .mw-word,
.project-card .mw-word,
.tier        .mw-word,
.bundle-card .mw-word,
.sticky-card .mw-word,
.review-card-new .mw-word {
    opacity: 1 !important;
    display: inline !important;
}

@media (prefers-reduced-motion: reduce) {
    .mw-text .mw-word { opacity: 1 !important; }
}


/* ---------------- 2) Sitewide skeleton preview ----------------
   Element starts with text invisible + soft grey background fill.
   When the IntersectionObserver fires `is-revealed`, the background
   fades out and the text colour fades in. */

.sk-bar {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    background-color: rgba(120, 120, 120, 0.13);
    border-radius: 6px;
    transition:
        color                  0.40s ease 0.05s,
        -webkit-text-fill-color 0.40s ease 0.05s,
        background-color        0.35s ease;
}

.sk-bar.is-revealed {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    background-color: transparent !important;
}

body.dark-mode .sk-bar {
    background-color: rgba(255, 255, 255, 0.05);
}

@media (prefers-reduced-motion: reduce) {
    .sk-bar {
        color: inherit !important;
        background-color: transparent !important;
    }
}


/* ---------------- 3) Fluid Card hover (Project Library) ----------------
   On hover the project image scales gently and a centred title +
   "EXPLORE →" overlay fades up over a darkening gradient. */

.project-card {
    /* Make sure card itself is the positioning context */
    position: relative;
}

.project-card .project-preview-wrapper {
    position: relative;
    overflow: hidden;
}

.project-card .project-preview-wrapper img {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                filter    0.45s ease;
    will-change: transform;
}

.project-card:hover .project-preview-wrapper img {
    transform: scale(1.06);
    filter: saturate(1.05) brightness(0.85);
}

/* Overlay — injected by JS once per card. */
.project-fluid-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(180deg,
                rgba(0, 0, 0, 0.05) 0%,
                rgba(0, 0, 0, 0.55) 70%,
                rgba(0, 0, 0, 0.70) 100%);
    z-index: 2;
}

.project-card:hover .project-fluid-overlay,
.project-card:focus-visible .project-fluid-overlay {
    opacity: 1;
}

.project-fluid-overlay .fluid-title {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-weight: 800;
    font-size: clamp(1.05rem, 2.1vw, 1.4rem);
    letter-spacing: -0.01em;
    line-height: 1.15;
    transform: translateY(12px);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
    padding: 0 16px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.project-fluid-overlay .fluid-explore {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
                opacity   0.40s ease 0.18s;
    padding: 8px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.project-fluid-overlay .fluid-explore .arrow {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .project-fluid-overlay .fluid-title {
    transform: translateY(0);
}

.project-card:hover .project-fluid-overlay .fluid-explore {
    transform: translateY(0);
    opacity: 1;
}

.project-card:hover .project-fluid-overlay .fluid-explore .arrow {
    transform: translateX(5px);
}

/* The legacy .project-hover-overlay (simple "View Site" pill) is hidden
   in favour of the new fluid overlay. */
.project-card .project-hover-overlay {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .project-card .project-preview-wrapper img,
    .project-fluid-overlay,
    .project-fluid-overlay .fluid-title,
    .project-fluid-overlay .fluid-explore,
    .project-fluid-overlay .fluid-explore .arrow {
        transition: none !important;
    }
}
