/* ==================================================
   RIDO SECTION WOW — per-section choreography (home only)
   ==================================================
   Companion file: js/section-wow.js
   Loaded after micro-interactions.css; linked from index.html ONLY.
   Principles:
   - Visual/motion treatment only: no structural styles, no
     content. Decorative pseudo-elements + composable CSS
     `scale` / `rotate` / `translate` properties so existing
     GSAP inline transforms and style.css reveal transitions
     are never overridden or fought.
   - Every moving rule is gated: prefers-reduced-motion AND
     html[data-motion], hover effects behind (hover:hover) +
     (pointer:fine). Reduced motion = static, fully legible.
   - Transform/opacity (+filter on tiny logos) only. No layout
     animation; absolute-positioned decorations are CLS-safe.
   ================================================== */

/* ==================================================
   1. ABOUT — scroll-linked word reveal
   js/section-wow.js splits the two paragraphs into .wow-word
   spans and scrubs their opacity 0.18 -> 1 (GSAP inline).
   These rules are only safety nets: words must never strand
   dim when motion is off or JS dies mid-flight.
   ================================================== */
.wow-word {
    display: inline;
}

html[data-motion="reduced"] .wow-word {
    opacity: 1 !important;
}

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

/* ==================================================
   2. SECTION HEADERS — oversized ghost index numerals
   data-wow-index ("01"–"04") added on each
   .rido-topic-divider__header in index.html. Outlined numeral
   sits behind the title; js scrubs --wow-ghost for a slower-
   than-scroll parallax (transform-only on the pseudo).
   The header already carries a transform (style.css reveal),
   so it is a containing block + stacking context: z-index -1
   stays above the page background but under the title.
   ================================================== */
.rido-topic-divider__header[data-wow-index] {
    position: relative;
    isolation: isolate;
}

.rido-topic-divider__header[data-wow-index]::before {
    content: attr(data-wow-index);
    position: absolute;
    left: 50%;
    top: -0.12em;
    transform: translate3d(-50%, var(--wow-ghost, 0px), 0);
    font-family: var(--font-display, "Helvetica Neue", Arial, sans-serif);
    font-weight: 800;
    font-size: calc(var(--text-3xl, clamp(3rem, 1.8rem + 5.2vw, 6.5rem)) * 2);
    line-height: 1;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1px var(--hairline-strong, rgba(10, 10, 10, 0.32));
    text-stroke: 1px var(--hairline-strong, rgba(10, 10, 10, 0.32));
    z-index: -1;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Browsers without text-stroke would paint nothing-on-nothing;
   give them a whisper of ink instead of an invisible numeral. */
@supports not ((-webkit-text-stroke: 1px black) or (text-stroke: 1px black)) {
    .rido-topic-divider__header[data-wow-index]::before {
        color: var(--hairline, rgba(10, 10, 10, 0.14));
    }
}

/* Section deck: give the description real presence so it reads as an
   intentional sub-headline under the title, not floating text. */
.rido-topic-divider__desc {
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.55;
    color: #555;
    margin-top: 12px;
}

/* Anchor the centered deck with a short accent rule so the header reads as a
   composed lockup instead of a line of text floating under the title. */
.rido-topic-divider__desc::after {
    content: "";
    display: block;
    width: 44px;
    height: 2px;
    margin: 20px auto 0;
    background: #0a0a0a;
}

/* The accent rule draws out from its centre once the section has revealed
   (motion.js adds .is-revealed when the section timeline starts). */
@media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduced"]) .rido-topic-divider__desc::after {
        transform: scaleX(0);
        transition: transform 0.9s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) 0.35s;
    }

    html:not([data-motion="reduced"]) .rido-topic-divider.is-revealed .rido-topic-divider__desc::after,
    html:not([data-motion="reduced"]) section.is-revealed .rido-topic-divider__desc::after {
        transform: scaleX(1);
    }
}

/* ==================================================
   3. STATS ROW — hairline draw across each KPI cell top
   [data-wow-stats] added on .hero-kpi-row. js adds
   .wow-stats-in once (guarded — see js: never re-triggers,
   never touches the .timer count-up).
   ================================================== */
[data-wow-stats] .de_count {
    position: relative;
}

[data-wow-stats] .de_count::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--hairline-strong, rgba(10, 10, 10, 0.32));
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.9s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    pointer-events: none;
}

[data-wow-stats] > div:nth-child(2) .de_count::before { transition-delay: 0.1s; }
[data-wow-stats] > div:nth-child(3) .de_count::before { transition-delay: 0.2s; }
[data-wow-stats] > div:nth-child(4) .de_count::before { transition-delay: 0.3s; }

[data-wow-stats].wow-stats-in .de_count::before {
    transform: scaleX(1);
}

html[data-motion="reduced"] [data-wow-stats] .de_count::before {
    transform: scaleX(1);
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    [data-wow-stats] .de_count::before {
        transform: scaleX(1);
        transition: none;
    }
}

/* ==================================================
   4a. PROJECT CARDS — accent chip ink slide on hover
   The chip is always present; on card hover an accent panel
   sweeps in from the left and the label inverts to paper.
   --accent defaults to ink (design-system.css).
   ================================================== */
@media (hover: hover) and (pointer: fine) {
    html:not([data-motion="reduced"]) .home-project-card .project-card__category {
        position: relative;
        isolation: isolate;
        overflow: hidden;
        transition: color 0.3s ease, border-color 0.3s ease;
    }

    html:not([data-motion="reduced"]) .home-project-card .project-card__category::before {
        content: "";
        position: absolute;
        inset: 0;
        background: var(--accent, #0a0a0a);
        transform: translateX(-101%);
        transition: transform 0.4s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
        z-index: -1;
        pointer-events: none;
    }

    html:not([data-motion="reduced"]) .home-project-card:hover .project-card__category,
    html:not([data-motion="reduced"]) .home-project-card:focus-visible .project-card__category {
        color: var(--paper, #ffffff);
        border-color: var(--accent, #0a0a0a);
    }

    html:not([data-motion="reduced"]) .home-project-card:hover .project-card__category::before,
    html:not([data-motion="reduced"]) .home-project-card:focus-visible .project-card__category::before {
        transform: translateX(0);
    }
}

/* ==================================================
   4b. PROJECT CARDS — cover parallax headroom
   js adds .wow-parallax-frame to .project-thumb and scrubs the
   image yPercent ±6 with scale 1.13 baked into the SAME GSAP
   transform (GSAP folds/clears independent scale on elements
   it animates, so the headroom must live inside the tween).
   Here we only:
   - guarantee the crop (overflow hidden)
   - neutralize home-projects.css's `transition: transform`
     on the image so the scrub is never smoothed/laggy
     (micro-interactions' .mi-img-in reveal outranks this rule
     while it plays, so the cover reveal still animates)
   - move the hover zoom onto the frame via the composable
     `scale` property (the frame is never GSAP-managed).
   ================================================== */
@media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduced"]) .wow-parallax-frame {
        overflow: hidden;
        transition: scale 340ms var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    }

    html:not([data-motion="reduced"]) .wow-parallax-frame .project-thumb-image {
        transition: none;
    }

    html:not([data-motion="reduced"]) .home-project-card:hover .wow-parallax-frame,
    html:not([data-motion="reduced"]) .home-project-card:focus-visible .wow-parallax-frame {
        scale: 1.02;
    }
}

/* ==================================================
   5. IMPACT CARDS — metric emphasis + shadow lift + logo wake
   `translate`/`scale` properties compose with the style.css
   reveal transforms; the transition lists below REPLICATE the
   originals (opacity/transform + --card-d delays) and append
   the hover channels so the reveal choreography is preserved.
   ================================================== */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    /* No translate lift here: motion.js GSAP-tweens the card's
       transform channel on reveal — the shadow alone reads as
       the elevation change. The transition list replicates the
       style.css reveal pair and appends box-shadow. */
    html:not([data-motion="reduced"]) .rido-case-card {
        transition:
            opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--card-d, 0ms) + 0ms),
            transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--card-d, 0ms) + 0ms),
            box-shadow 0.45s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    }

    html:not([data-motion="reduced"]) .rido-case-card:hover {
        box-shadow: 0 28px 64px -30px rgba(10, 10, 10, 0.32);
    }

    html:not([data-motion="reduced"]) .rido-case-title {
        transform-origin: 0% 60%;
        transition:
            opacity 0.5s ease calc(var(--card-d, 0ms) + 180ms),
            transform 0.5s ease calc(var(--card-d, 0ms) + 180ms),
            scale 0.35s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)),
            letter-spacing 0.35s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    }

    html:not([data-motion="reduced"]) .rido-case-card:hover .rido-case-title {
        scale: 1.02;
        letter-spacing: -0.03em;
    }

    html:not([data-motion="reduced"]) .rido-case-logo {
        opacity: 0.45;
        filter: grayscale(1);
        transition: opacity 0.35s ease, filter 0.35s ease;
    }

    html:not([data-motion="reduced"]) .rido-case-card:hover .rido-case-logo {
        opacity: 1;
        filter: grayscale(0);
    }
}

/* ==================================================
   6. UI-SHOTS MARQUEE: retired. The strip is display only now
   (no hover focus, no pause); see rido-editorial-sections.css.
   ================================================== */

/* ==================================================
   7. LOGO WALL — one-time diagonal cascade
   js sets --wow-d per logo from its grid row+column, arms the
   grid (.wow-logos-armed), then reveals (.wow-logos-in) on
   first intersection. The wave scales the INNER image —
   motion.js GSAP-animates the .logo-wall-item wrappers
   (opacity/y) and would fold away any independent scale there,
   so the two systems never share an element or a channel.
   .wow-logos-done zeroes the delays so hover stays instant.
   ================================================== */
@media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduced"]) .wow-logos-armed .logo-wall-item-image {
        scale: 0.8;
        transition: scale 0.8s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) var(--wow-d, 0ms);
    }

    html:not([data-motion="reduced"]) .wow-logos-armed.wow-logos-in .logo-wall-item-image {
        scale: 1;
    }

    html:not([data-motion="reduced"]) .wow-logos-armed.wow-logos-done .logo-wall-item-image {
        transition: scale 0.3s ease;
    }
}

html[data-motion="reduced"] .wow-logos-armed .logo-wall-item-image {
    scale: none;
    transition: none;
}

/* ==================================================
   8. RECOMMENDATIONS — editorial pinboard tilt
   Alternating ±0.4deg via the composable `rotate` property
   (the existing hover translateY keeps working untouched);
   cards straighten on hover, avatar gets a quiet ring.
   ================================================== */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduced"]) .rido-recommendation-card {
        rotate: -0.4deg;
        transition:
            border-color 180ms ease,
            transform 180ms ease,
            rotate 260ms var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)),
            box-shadow 260ms var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    }

    html:not([data-motion="reduced"]) .rido-recommendation-card:nth-child(even) {
        rotate: 0.4deg;
    }

    html:not([data-motion="reduced"]) .rido-recommendation-card:hover {
        rotate: 0deg;
        box-shadow: 0 16px 40px -24px rgba(10, 10, 10, 0.3);
    }

    html:not([data-motion="reduced"]) .rido-recommendation-card__avatar {
        transition: box-shadow 220ms ease;
    }

    html:not([data-motion="reduced"]) .rido-recommendation-card:hover .rido-recommendation-card__avatar {
        box-shadow:
            0 0 0 2px #ffffff,
            0 0 0 3px rgba(23, 32, 51, 0.65);
    }
}

/* ==================================================
   9. CAL / BOOKING — kicker + elevated embed frame
   Decorative ::before kicker (CSS-generated, no markup change)
   + a soft editorial shadow around the Cal embed. The gentle
   reveal itself is the existing [data-reveal="fade-up"]
   handled by motion.js.
   ================================================== */
#design-consultation [data-reveal] {
    position: relative;
}

#design-consultation [data-reveal]::before {
    content: "// BOOKING: DESIGN CONSULTATION";
    display: block;
    font-family: var(--font-ui, "Helvetica Neue", Arial, sans-serif);
    font-weight: 700;
    font-size: var(--text-xs, 12px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-60, rgba(10, 10, 10, 0.6));
    border-top: 1px solid var(--hairline, rgba(10, 10, 10, 0.14));
    padding-top: var(--space-3, 14px);
    margin-bottom: var(--space-4, 20px);
}

#design-consultation #my-cal-inline-design-consultation {
    border: 1px solid var(--hairline, rgba(10, 10, 10, 0.14));
    background: var(--paper, #ffffff);
    box-shadow: 0 28px 80px -36px rgba(10, 10, 10, 0.28);
}

/* ==================================================
   OWNER FEEDBACK (2026-06-11): ghost numerals read as
   "overlapping lines" and the stat hairline draw doubles the
   existing stat-row border. Both removed.
   ================================================== */
.rido-topic-divider__header[data-wow-index]::before {
    content: none !important;
}

[data-wow-stats] .de_count::after,
[data-wow-stats].wow-stats-in .de_count::after,
.wow-stats-in .de_count::before,
[data-wow-stats] .de_count::before {
    content: none !important;
    animation: none !important;
}
