/* Reversible homepage service-scroll experiment; shared service styling stays in style.css. */
.homepage #services[data-scroll-handoff] { --services-nav-height: 77px; }

/* Keep the photograph open, with readable captions over a soft bottom gradient. */
.homepage #services .sticky-card { isolation: isolate; padding: 28px 24px; align-items: flex-end; text-align: left; }
.homepage #services .sticky-card::before { z-index: 0; filter: brightness(1); }
.homepage #services .sticky-card::after {
    z-index: 1;
    background: linear-gradient(180deg, transparent 35%, rgba(5, 10, 18, .12) 50%, rgba(5, 10, 18, .78) 78%, rgba(5, 10, 18, .96) 100%);
}
.homepage #services .sticky-card h3 {
    z-index: 2;
    width: 100%;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff !important;
    font-size: clamp(24px, 2.3vw, 32px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    box-shadow: none;
}
.homepage #services .sticky-card h3::before { content: ''; display: block; width: 30px; height: 3px; margin-bottom: 12px; border-radius: 2px; background: var(--primary); }
.homepage #services .sticky-card h3 span {
    display: inline-block;
    max-width: 100%;
    margin-top: 3px;
    padding: 0;
    border: 0;
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    font: inherit;
    text-shadow: inherit;
}
@media (max-height: 480px) {
    .homepage #services.services-motion-ready .sticky-card { padding: 16px 20px; }
    .homepage #services.services-motion-ready .sticky-card h3 { font-size: 22px; }
    .homepage #services.services-motion-ready .sticky-card h3::before { margin-bottom: 8px; }
}

.homepage #services .services-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 17px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-card);
    color: var(--text-main) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    z-index: 12;
}
.homepage #services .services-continue i { color: var(--primary); }
.homepage #services .services-continue:hover { border-color: var(--primary); }
.homepage #services .services-continue:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.homepage #service-results { scroll-margin-top: 100px; }

/* GSAP handles pinning alone. Stable viewport units avoid changing the scroll
   distance when a mobile browser's toolbar hides. */
.homepage #services.services-motion-ready .sticky-wrapper { height: 460svh; }
.homepage #services.services-motion-ready .card-stack {
    position: relative;
    top: 0;
    height: calc(100svh - var(--services-nav-height));
}
.homepage #services.services-motion-ready .sticky-card {
    width: min(320px, calc(100% - 64px));
    height: min(420px, calc(100% - 130px));
    transition: border-color .3s;
}
.homepage #services.services-motion-ready .services-continue { position: absolute; bottom: 22px; }

/* Readable fallback when scripts are unavailable or reduced motion is requested. */
.homepage #services[data-scroll-handoff]:not(.services-motion-ready) .sticky-wrapper { height: auto; }
.homepage #services[data-scroll-handoff]:not(.services-motion-ready) .card-stack {
    position: relative;
    top: auto;
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 320px));
    gap: 24px;
    padding: 60px 24px;
    overflow: visible;
}
.homepage #services[data-scroll-handoff]:not(.services-motion-ready) .bg-heading-container {
    position: static;
    grid-column: 1 / -1;
    transform: none;
}
.homepage #services[data-scroll-handoff]:not(.services-motion-ready) .bg-text { font-size: clamp(32px, 6vw, 64px); line-height: 1; }
.homepage #services[data-scroll-handoff]:not(.services-motion-ready) .sticky-card {
    position: relative;
    width: 100%;
    height: 320px;
    transform: none !important;
    z-index: 0;
    isolation: isolate;
    transition: border-color .3s;
}
.homepage #services[data-scroll-handoff]:not(.services-motion-ready) .services-continue { grid-column: 1 / -1; justify-self: center; }
@media (max-width: 575px) {
    .homepage #services[data-scroll-handoff]:not(.services-motion-ready) .card-stack { grid-template-columns: minmax(0, 320px); }
    .homepage #services.services-motion-ready .services-continue { bottom: 18px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .homepage #services[data-scroll-handoff] *, .homepage #services[data-scroll-handoff] *::before { transition: none !important; animation: none !important; }
}
