/* ==========================================================================
   Luxe Shield — home page
   Uses the tokens defined in header-footer.css. Namespaced with "lx-".
   ========================================================================== */

/* ---------- Hero ---------- */

section.lx-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-ui);
}

.lx-hero a { color: inherit; text-decoration: none; }
.lx-hero a:focus-visible {
    outline: 2px solid var(--color-accent-ink) !important;
    outline-offset: 3px;
}

.lx-hero__content {
    display: flex;
    flex-direction: column;
    padding: 32px var(--lx-gutter) 40px;
}

.lx-hero .lx-hero__eyebrow { color: var(--color-accent-ink); }

.lx-hero__title {
    margin: 18px 0 0;
    max-width: 12ch;
    font-family: var(--font-ui);
    font-size: clamp(2.5rem, 9vw, 5.25rem);
    font-weight: 600;
    font-stretch: 108%;
    line-height: .98;
    letter-spacing: -.02em;
    color: var(--color-text);
    text-wrap: balance;
}

.lx-hero .lx-hero__lead {
    max-width: 44ch;
    margin: 22px 0 0;
    font-family: var(--font-ui);
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.55;
    color: var(--color-muted);
}

/* Actions */
.lx-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    margin-top: 26px;
}
.lx-hero .lx-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    padding: 0 28px;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: 16px;
    font-weight: 600;
    transition: background-color .18s var(--lx-ease), color .18s var(--lx-ease);
}
.lx-hero .lx-hero__cta svg { transition: transform .18s var(--lx-ease); }
.lx-hero .lx-hero__cta:hover { background: var(--color-text); color: var(--color-bg); }
.lx-hero .lx-hero__cta:hover svg { transform: translateX(4px); }

.lx-hero .lx-hero__link {
    display: inline-block;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(var(--color-text), var(--color-text)) 0 calc(100% - 8px) / 100% 1px no-repeat;
    transition: background-size .25s var(--lx-ease), color .16s var(--lx-ease);
}
.lx-hero .lx-hero__link:hover {
    color: var(--color-accent-ink);
    background-image: linear-gradient(var(--color-accent-line), var(--color-accent-line));
    background-size: 100% 2px;
}


/* Photo */
.lx-hero__media {
    order: -1;                  /* phones: photo first, short */
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #c9c3b8;
}
.lx-hero__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 60%;
}


/* Tablet: text first, wide photo below */
@media (min-width: 720px) {
    .lx-hero__content { padding: 56px var(--lx-gutter) 56px; }
    .lx-hero__media { order: 0; aspect-ratio: 16 / 9; }
    .lx-hero__media img { object-position: 50% 15%; }
}

/* Desktop: text left, photo bleeding to the right edge */
@media (min-width: 1080px) {
    section.lx-hero {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
        min-height: clamp(560px, calc(100svh - var(--lx-header-h)), 760px);
    }
    .lx-hero__content {
        justify-content: center;
        padding-block: 64px 56px;
        padding-inline: var(--lx-gutter) clamp(32px, 4vw, 72px);
    }
    /* sized to the text column (~half the viewport), not the full width */
    .lx-hero__title { font-size: clamp(2.75rem, 4.4vw, 5.25rem); }
    .lx-hero__media {
        aspect-ratio: auto;
        border-inline-start: 1px solid var(--color-border);
    }
    .lx-hero__media img { object-position: 20% 55%; }
}

@media (prefers-reduced-motion: reduce) {
    .lx-hero *,
    .lx-hero *::before,
    .lx-hero *::after { transition: none !important; }
}


/* ==========================================================================
   Hero entrance — runs once on load, ~1.3s in total.
   Only transform, opacity and clip-path are animated, so nothing shifts the layout.
   Skipped entirely for visitors who prefer reduced motion.
   ========================================================================== */

.lx-hero__title .lx-line { display: block; }

@media (prefers-reduced-motion: no-preference) {

    /* Headline: each line rises out of its own masked edge, like stencil lettering */
    .lx-hero__title .lx-line {
        overflow: hidden;
        padding-bottom: .14em;          /* room for descenders (g, p) inside the mask */
        margin-bottom: -.14em;
    }
    .lx-hero__title .lx-line > span {
        display: block;
        animation: lx-rise .8s cubic-bezier(.2, .8, .2, 1) both;
    }
    .lx-hero__title .lx-line:nth-child(1) > span { animation-delay: .12s; }
    .lx-hero__title .lx-line:nth-child(2) > span { animation-delay: .2s; }
    .lx-hero__title .lx-line:nth-child(3) > span { animation-delay: .28s; }

    /* Supporting content settles in after the headline */
    .lx-hero__eyebrow   { animation: lx-fade-up .6s var(--lx-ease) .04s both; }
    .lx-hero__lead      { animation: lx-fade-up .7s var(--lx-ease) .42s both; }
    .lx-hero .lx-live   { animation: lx-fade-up .7s var(--lx-ease) .47s both; }
    .lx-hero__actions   { animation: lx-fade-up .7s var(--lx-ease) .52s both; }


    /* Photo: painted in from left to right, like a line-marking machine laying a stripe.
       Waits for the image to load (the img's onload adds .is-ready), so the reveal never
       runs over an empty frame. Without JavaScript the photo simply shows. */
    .lx-js .lx-hero__media { position: relative; background: transparent; }
    .lx-js .lx-hero__media img { clip-path: inset(0 100% 0 0); }
    .lx-js .lx-hero__media.is-ready img {
        animation:
            lx-paint 1.1s cubic-bezier(.65, 0, .35, 1) both,
            lx-settle 1.8s var(--lx-ease) both;
    }
    .lx-js .lx-hero__media.is-ready::after {
        content: "";
        position: absolute;
        top: 0; bottom: 0;
        inset-inline-start: 0;
        width: 3px;
        background: var(--color-accent);
        animation: lx-paint-edge 1.1s cubic-bezier(.65, 0, .35, 1) both;
        pointer-events: none;
    }
}


@keyframes lx-rise {
    from { transform: translateY(105%); }
    to   { transform: none; }
}
@keyframes lx-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
@keyframes lx-paint {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}
@keyframes lx-settle {
    from { transform: scale(1.06); }
    to   { transform: none; }
}
@keyframes lx-paint-edge {
    0%   { inset-inline-start: 0;    opacity: 1; }
    88%  { opacity: 1; }
    100% { inset-inline-start: calc(100% - 3px); opacity: 0; }
}

/* The desktop header already shows the 24/7 number */
@media (min-width: 1080px) {
    .lx-hero .lx-live { display: none; }
}

/* Arabic: larger line-height for Arabic script; the photo is painted in from the right */
html[lang="ar"] .lx-hero__title { line-height: 1.25; }
@media (prefers-reduced-motion: no-preference) {
    [dir="rtl"].lx-js .lx-hero__media img { clip-path: inset(0 0 0 100%); }
    [dir="rtl"].lx-js .lx-hero__media.is-ready img { animation-name: lx-paint-rtl, lx-settle; }
}
@keyframes lx-paint-rtl {
    from { clip-path: inset(0 0 0 100%); }
    to   { clip-path: inset(0 0 0 0); }
}

/* ==========================================================================
   Luxe redesign — full-bleed hero and service tiles
   ========================================================================== */
section.lx-hero {
    position: relative;
    display: block;
    min-height: clamp(560px, calc(100svh - var(--lx-header-h)), 860px);
    background: #080809;
    overflow: hidden;
}
section.lx-hero .lx-hero__media {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    border: 0;
    background: #080809;
}
section.lx-hero .lx-hero__media img { object-position: 62% 50%; }
section.lx-hero .lx-hero__media::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to right, rgba(8, 8, 9, .94) 0%, rgba(8, 8, 9, .72) 38%, rgba(8, 8, 9, .12) 72%),
        linear-gradient(to top, rgba(8, 8, 9, .9) 0%, rgba(8, 8, 9, 0) 35%);
}
[dir="rtl"] section.lx-hero .lx-hero__media::before {
    background:
        linear-gradient(to left, rgba(8, 8, 9, .94) 0%, rgba(8, 8, 9, .72) 38%, rgba(8, 8, 9, .12) 72%),
        linear-gradient(to top, rgba(8, 8, 9, .9) 0%, rgba(8, 8, 9, 0) 35%);
}
section.lx-hero .lx-hero__media::after { z-index: 2; }
section.lx-hero .lx-hero__content {
    position: relative;
    z-index: 3;
    justify-content: center;
    min-height: inherit;
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(96px, 16vh, 160px) var(--lx-gutter) clamp(56px, 10vh, 96px);
}
section.lx-hero .lx-hero__content > * { max-width: 620px; }
.lx-hero .lx-hero__title { color: #fff; font-size: clamp(2.75rem, 6.2vw, 5.5rem); max-width: 13ch; }
.lx-hero .lx-hero__lead { color: #cfc9bd; }
.lx-hero .lx-hero__link { color: #fff; }
@media (max-width: 719.98px) {
    section.lx-hero .lx-hero__media img { object-position: 70% 50%; }
    section.lx-hero .lx-hero__media::before,
    [dir="rtl"] section.lx-hero .lx-hero__media::before { background: linear-gradient(to top, rgba(8, 8, 9, .96) 25%, rgba(8, 8, 9, .55) 70%, rgba(8, 8, 9, .35) 100%); }
    section.lx-hero .lx-hero__content { justify-content: flex-end; }
}

/* Service tiles */
.lx-tiles { display: grid; gap: 12px; margin-bottom: 16px; }
@media (min-width: 640px) { .lx-tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .lx-tiles { grid-template-columns: repeat(4, 1fr); } }
.lx-tile {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 380px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: #111;
    color: #fff !important;
    text-decoration: none;
    isolation: isolate;
}
.lx-tile img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--lx-ease);
}
.lx-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(8, 8, 9, .95) 20%, rgba(8, 8, 9, .35) 65%, rgba(8, 8, 9, .15));
}
.lx-tile::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 2px;
    background: var(--lx-gold-grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--lx-ease);
}
[dir="rtl"] .lx-tile::after { transform-origin: right; }
.lx-tile:hover img { transform: scale(1.06); }
.lx-tile:hover::after, .lx-tile:focus-visible::after { transform: none; }
.lx-tile:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.lx-tile__body { display: grid; gap: 8px; padding: 24px; }
.lx-tile .lx-tag { color: var(--color-accent-ink) !important; }
.lx-tile__name { font-size: 21px; font-weight: 600; font-stretch: 105%; line-height: 1.2; }
.lx-tile__text { font-size: 14.5px; line-height: 1.5; color: #cfc9bd; }
@media (prefers-reduced-motion: reduce) { .lx-tile img, .lx-tile::after { transition: none; } }

/* Construction panel on its own: full width */
.lx-divisions { grid-template-columns: 1fr !important; }
.lx-division--construction { border-inline-end: 1px solid var(--color-border) !important; background: var(--color-bg) !important; }
section.lx-hero .lx-hero__content > * { max-width: 760px; }
.lx-hero .lx-hero__title { max-width: none; }
.lx-tile img[src*="storefront-night"] { object-position: 40% 100%; }
.lx-tile img[src*="storefront-lit"] { object-position: 50% 100%; }
.lx-tile img[src*="ppf-coverage"] { object-position: 50% 70%; }
