/* ------------------------------------------------------------------
   Industries: sticky stacking cards
   Each card pins a little lower than the previous one (--peek), so the
   deck stays visible while the next card slides over it. index.js sets
   --depth (0 → n) on covered cards to scale and dim them.
   ------------------------------------------------------------------ */

.industries {
    position: relative;
    background: rgb(10 10 10);
}

.industries-head {
    padding: 0 6%;
}
.industries-head .sec4-heading {
    font-weight: 400;
}

.stack {
    --top: 24px;
    --peek: 18px;
    position: relative;
    width: min(1320px, 92vw);
    margin: 4rem auto 0;
}
/* keeps the last card pinned for a moment before the deck releases */
.stack::after {
    content: "";
    display: block;
    height: 30vh;
}

.stack-card {
    --depth: 0;
    position: sticky;
    top: calc(var(--top) + var(--i) * var(--peek));
    height: calc(
        100vh - var(--top) * 2 - (var(--count) - 1) * var(--peek)
    );
    min-height: 540px;
    margin-bottom: 18vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 3.5rem);
    padding: clamp(14px, 1.4vw, 20px);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: radial-gradient(
            120% 90% at 100% 0%,
            color-mix(in srgb, var(--accent) 14%, transparent),
            transparent 55%
        ),
        linear-gradient(160deg, #15161b 0%, #0c0c0f 55%, #09090b 100%);
    box-shadow: 0 -30px 60px -30px rgba(0, 0, 0, 0.95),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: var(--text-color);
    overflow: hidden;
    transform-origin: 50% 0;
    transform: scale(calc(1 - var(--depth) * 0.035));
    will-change: transform;
}

/* dims the card as more cards stack on top of it */
.stack-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #000;
    opacity: min(calc(var(--depth) * 0.28), 0.7);
    pointer-events: none;
}

.stack-card:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}
.stack-card:nth-child(even) .stack-card__media {
    order: 2;
}

/* ---------- media ---------- */
.stack-card__media {
    position: relative;
    min-height: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #050506;
    isolation: isolate;
}
.stack-card__media picture,
.stack-card__media img {
    width: 100%;
    height: 100%;
}
.stack-card__media img {
    object-fit: cover;
    transform: scale(1.06);
    transition: transform 1.4s var(--ease-out);
}
.stack-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.75),
            transparent 45%
        ),
        radial-gradient(
            120% 80% at 50% 50%,
            transparent 55%,
            rgba(0, 0, 0, 0.45)
        );
    pointer-events: none;
}
@media (hover: hover) {
    .stack-card:hover .stack-card__media img {
        transform: scale(1.1);
    }
}

/* ---------- body ---------- */
.stack-card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(0.9rem, 1.6vh, 1.4rem);
    min-width: 0;
    padding: clamp(0.5rem, 2vw, 2rem) clamp(0.5rem, 2vw, 2.2rem)
        clamp(0.5rem, 2vw, 2rem) 0;
}
.stack-card:nth-child(even) .stack-card__body {
    padding-left: clamp(0.5rem, 2vw, 2.2rem);
    padding-right: 0;
}

.stack-card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: Arkitech;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    color: var(--accent);
}
.stack-card__bar {
    display: inline-flex;
    gap: 5px;
}
.stack-card__bar i {
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.14);
}
.stack-card__bar i.on {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.stack-card__title {
    font-family: Arkitech;
    font-weight: 400;
    font-size: clamp(1.25rem, 2vw, 1.9rem);
    letter-spacing: 0.06em;
    line-height: 1.2;
    color: #fff;
}

.stack-card__quote {
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid var(--accent);
    font-family: Orenburg;
    font-size: clamp(0.95rem, 1.2vw, 1.12rem);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
}

.stack-card__desc {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.6);
}

.stack-card__list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.5rem;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    font-size: clamp(0.78rem, 0.85vw, 0.88rem);
    line-height: 1.45;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.78);
}
.stack-card__list li {
    position: relative;
    padding: 0.75rem 0 0.75rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.stack-card__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.15rem;
    width: 6px;
    height: 6px;
    transform: rotate(45deg);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.stack-card__cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.35rem 0;
    font-family: Arkitech;
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% /
        100% 1px;
    transition: background-size 0.4s var(--ease-out), color 0.3s ease;
}
.stack-card__cta span {
    display: inline-block;
    font-size: 1rem;
    transition: transform 0.35s var(--ease-out);
}
.stack-card__cta:hover,
.stack-card__cta:focus-visible {
    color: var(--accent);
}
.stack-card__cta:hover span,
.stack-card__cta:focus-visible span {
    transform: translateX(6px);
}
.stack-card__cta:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* ---------- entrance: body content rises in when the card arrives ---------- */
.stack-card__body > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.stack-card.is-visible .stack-card__body > * {
    opacity: 1;
    transform: none;
}
.stack-card.is-visible .stack-card__body > :nth-child(2) { transition-delay: 60ms; }
.stack-card.is-visible .stack-card__body > :nth-child(3) { transition-delay: 120ms; }
.stack-card.is-visible .stack-card__body > :nth-child(4) { transition-delay: 180ms; }
.stack-card.is-visible .stack-card__body > :nth-child(5) { transition-delay: 240ms; }
.stack-card.is-visible .stack-card__body > :nth-child(6) { transition-delay: 300ms; }

/* ---------- tablet / mobile ---------- */
@media (max-width: 1100px) {
    .stack-card__list {
        grid-template-columns: 1fr;
    }
    .stack-card__list li {
        padding: 0.55rem 0 0.55rem 1.2rem;
    }
    .stack-card__list li::before {
        top: 0.95rem;
    }
}

@media (max-width: 880px) {
    .stack {
        --top: 12px;
        --peek: 10px;
        width: 94vw;
        margin-top: 2.5rem;
    }
    .stack-card,
    .stack-card:nth-child(even) {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        height: auto;
        min-height: 0;
        margin-bottom: 12vh;
        padding: 10px;
        border-radius: 18px;
    }
    .stack-card:nth-child(even) .stack-card__media {
        order: 0;
    }
    .stack-card__body,
    .stack-card:nth-child(even) .stack-card__body {
        padding: 0.8rem 0.6rem 0.9rem;
        gap: 0.75rem;
    }
    .stack-card__media {
        aspect-ratio: 16 / 9;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stack-card {
        transform: none;
    }
    .stack-card__body > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .stack-card__media img {
        transition: none;
    }
}

/* ------------------------------------------------------------------
   Remaining page sections (products, reach out, footer)
   ------------------------------------------------------------------ */

.page-tail {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background-color: rgb(10 10 10);
    color: var(--text-color);
}

/* reveal on scroll (index.js adds .is-visible once) */
.fadein,
.fade-left,
.fade-right {
    opacity: 0;
    transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.fadein {
    transform: translateY(48px);
}
.fade-left {
    transform: translateX(-40px);
}
.fade-right {
    transform: translateX(40px);
}
.fadein.is-visible,
.fade-left.is-visible,
.fade-right.is-visible {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .fadein,
    .fade-left,
    .fade-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
