/* =====================================================================
 * pages/home.css — home-only tweaks (hero, final CTA).
 * No hex literals.
 * ===================================================================== */

/* --- HERO — full-bleed photo, left-anchored scrim, bottom filmstrip ----
 * Composition (back to front): <img.hero__bg> (object-fit:cover photo) →
 * .hero__scrim (left-anchored gradient for text legibility) → .hero__inner
 * (copy, left, vertically centred) → .hero__strip (decorative marquee at
 * the bottom edge). No hex literals — tokens + color-mix() only. */
.hero {
    position: relative;
    width: 100%;
    /* Tall + immersive, with a floor so short viewports don't crush copy. */
    min-height: min(85vh, 52rem);
    display: flex;
    align-items: center;
    padding-block: var(--space-9);
    /* Reserve room at the bottom so the centred copy never overlaps the
     * filmstrip (strip ≈ 6.25rem thumb + its own padding). */
    padding-bottom: calc(var(--space-9) + 8.5rem);
    background-color: var(--color-ink);   /* fallback before the photo paints */
    color: var(--color-text-inverse);
    overflow: hidden;
    isolation: isolate;
}

/* Full-bleed photo behind everything. */
.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    user-select: none;
}

/* Left-anchored legibility scrim. Strong deep-ink/teal at the far left
 * (keeps white headline text WCAG-legible), fading to fully transparent by
 * ~62% so the right half of the photo reads nearly clean — NOT a full-width
 * wash. Built only from tokens + color-mix(). */
.hero__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to right,
        color-mix(in srgb, var(--color-ink)     90%, transparent) 0%,
        color-mix(in srgb, var(--color-primary) 68%, transparent) 32%,
        color-mix(in srgb, var(--color-primary) 22%, transparent) 50%,
        transparent 62%
    );
}

.hero__inner {
    position: relative;
    z-index: 2;
    /* Left-anchored copy; ~3-line title at the mockup's measure. */
    max-width: 40rem;
    margin-inline: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background-color: color-mix(in srgb, var(--color-text-inverse) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-text-inverse) 30%, transparent);
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    width: fit-content;
    color: var(--color-text-inverse);
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, var(--fs-4xl));
    line-height: 1.1;
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    color: var(--color-text-inverse);
    margin: 0;
}

.hero__subline {
    font-size: var(--fs-md);
    color: var(--color-ice-mist);
    max-width: 44rem;
    line-height: var(--lh-relaxed);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

/* --- Decorative filmstrip (bottom edge) -----------------------------
 * A slim, continuously-sliding row of rounded close-up thumbnails. The
 * track holds the 13-photo sequence FOUR times (52 cards); translating it
 * by -50% lands two sets exactly where the first two began, so the linear
 * loop is seamless. See .hero__strip-track for the spacing + speed maths. */
.hero__strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    overflow: hidden;
    padding-block: var(--space-3);
}

.hero__strip-track {
    display: flex;
    width: max-content;
    /* The 13-photo sequence is emitted FOUR times (52 cards). NO flex `gap`
     * and NO track padding-inline: either would make the sets unequal in
     * width (a flex gap is not added across the seam; track padding is
     * counted once, not per-set), so -50% would miss a clean boundary.
     * Spacing lives on each thumbnail instead (margin-right), so all 52
     * cards are identical "card + trailing space" units → -50% lands exactly
     * on a card boundary. With 4 identical sets, -50% == exactly TWO sets
     * (26 cards ≈ 227.5rem desktop) — wider than any target viewport, so the
     * strip is always full at the reset point → seamless, no seam gap.
     *
     * Duration matches the previous build's slide SPEED. Old: -50% = one
     * 8-card set = 70rem over 60s = 1.1667 rem/s. New: -50% = 26 cards =
     * 227.5rem; 227.5 / 1.1667 = 195s → same px/second. */
    animation: hero-strip-marquee 195s linear infinite;
    will-change: transform;
}

.hero__thumb {
    flex: 0 0 auto;
    height: 6.25rem;          /* ~100px desktop */
    width: 8rem;              /* rounded-rect, landscape close-up */
    /* Uniform trailing space on EVERY card (incl. the last duplicate) so
     * both sets stay byte-identical in width — see .hero__strip-track. */
    margin-right: var(--space-3);
    object-fit: cover;
    display: block;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--color-text-inverse) 45%, transparent);
    box-shadow: var(--shadow-md);
    background-color: var(--color-ink);  /* placeholder tint before load */
}

@keyframes hero-strip-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Honour reduced-motion: freeze the marquee; the strip becomes a static,
 * clipped row (only the first thumbnails show — overflow hidden). */
@media (prefers-reduced-motion: reduce) {
    .hero__strip-track { animation: none; }
}

/* --- Mobile (<1024px) ------------------------------------------------
 * Copy goes full-width; the scrim becomes a gentler FULL-WIDTH wash so
 * white text stays legible over any region of the photo. Hero height is
 * content-driven with comfortable padding; the filmstrip stays at the
 * bottom with smaller thumbnails (~2 visible). The fixed lang pill / WA
 * float (position:fixed, higher z) stay above the strip and clickable. */
@media (max-width: 1023.98px) {
    .hero {
        min-height: auto;
        padding-block: var(--space-8);
        padding-bottom: calc(var(--space-8) + 6.5rem);
    }

    .hero__scrim {
        background: linear-gradient(
            to right,
            color-mix(in srgb, var(--color-ink)     88%, transparent) 0%,
            color-mix(in srgb, var(--color-primary) 55%, transparent) 60%,
            color-mix(in srgb, var(--color-primary) 38%, transparent) 100%
        );
    }

    .hero__inner { max-width: none; }

    .hero__thumb {
        height: 4.5rem;       /* ~72px mobile */
        width: 6rem;
    }
}

/* --- "Why families" value-prop cards: photo-led + centered ----------
 * Section-scoped via .home-why-cards (the grid wrapper on Home only), so
 * .card--value-prop instances on other pages (about, why, indonesia,
 * malaysia) keep their icon + left-aligned layout. */
.home-why-cards .card__title,
.home-why-cards .card__body {
    text-align: center;
}

.home-why-cards .card__photo {
    /* Bleed the photo to the card edges (cancel the card's padding) and
     * round only the top corners to match the card radius. */
    margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background-color: var(--color-ice-mist);
}

.home-why-cards .card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The final-CTA section — slightly less dramatic than the hero. */
.final-cta {
    text-align: center;
}

.final-cta__title {
    font-size: clamp(1.75rem, 4vw, var(--fs-2xl));
    margin-bottom: var(--space-4);
}

.final-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-5);
}

/* --- PROMO VIDEO — copy left, square film right; stacks on mobile ------ */
.home-video__grid {
    display: grid;
    gap: var(--space-6);
    align-items: center;
}
@media (min-width: 900px) {
    .home-video__grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        gap: var(--space-8);
    }
}
.home-video__eyebrow {
    display: inline-block;
    margin-bottom: var(--space-3);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-turquoise-lighter);
    color: var(--color-deep-teal-dark);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.home-video__lead {
    max-width: 46ch;
    color: var(--color-text-muted);
}
.home-video__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    margin-top: var(--space-3);
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}
.home-video__link span { transition: transform 0.2s ease; }
.home-video__link:hover span,
.home-video__link:focus-visible span { transform: translateX(4px); }

.home-video__frame {
    position: relative;
    margin: 0;
    width: 100%;
    max-width: 36rem;
    justify-self: center;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-ink);
    box-shadow: var(--shadow-lg);
}
.home-video__media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--color-ink);
}
.home-video__play {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--color-white);
    font: inherit;
    background: linear-gradient(
        to top,
        color-mix(in srgb, var(--color-ink) 55%, transparent) 0%,
        color-mix(in srgb, var(--color-ink) 15%, transparent) 60%,
        transparent 100%
    );
    transition: background-color 0.25s ease;
}
.home-video__play-icon {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    padding-left: 4px;           /* optical centre for the triangle */
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-white) 22%, transparent);
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}
.home-video__play:hover .home-video__play-icon,
.home-video__play:focus-visible .home-video__play-icon {
    transform: scale(1.08);
    background: var(--color-primary-hover);
    box-shadow: 0 0 0 12px color-mix(in srgb, var(--color-white) 28%, transparent);
}
.home-video__play:active .home-video__play-icon { transform: scale(0.97); }
.home-video__play:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: -3px;
}
.home-video__play-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    text-shadow: 0 1px 3px color-mix(in srgb, var(--color-ink) 70%, transparent);
}
.home-video__duration {
    padding: 0.125rem var(--space-2);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-ink) 60%, transparent);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}
.home-video__frame.is-playing .home-video__play { display: none; }
