/* echoeassistance.com — 3D depth layer on top of style.css / upgrades.css (needs motion3d.css). */

/* existing scroll-in animations rise out of the page in 3D */
html.m3d-on [data-anim] {
    transform: perspective(1200px) translate3d(0, 40px, -80px) rotateX(12deg);
    transform-origin: 50% 100%;
}
html.m3d-on [data-anim].is-visible { transform: none; }
html.m3d-on [data-anim="fade"] { transform: none; }

/* hero: the 3D grid floor replaces the flat grid */
html.m3d-on .hero-grid { display: none; }
.hero .m3d-scene { z-index: 0; }
.hero-image { box-shadow: 0 50px 90px -40px rgba(10, 37, 64, .45); }

/* dark bands host their own scenes */
.stats-strip { position: relative; overflow: hidden; }
.stats-strip > .container { position: relative; z-index: 1; }
.page-hero, .service-hero, .error-404 { position: relative; overflow: hidden; }
.page-hero > .container, .service-hero > .container, .error-404 > .container { position: relative; z-index: 1; }
.cta-banner { position: relative; overflow: hidden; }
.cta-banner > .m3d-scene { position: absolute; z-index: 0; }

/* cards keep a soft depth shadow while tilting */
.m3d-tilt.is-tilting { box-shadow: 0 28px 50px -24px rgba(10, 37, 64, .35); }
.stat.m3d-tilt { border-radius: 14px; }

/* footer credit sits centred on its own line on small screens */
.footer-credit { margin: 0; }
@media (max-width: 879px) {
    .footer-credit { order: 3; width: 100%; text-align: center; }
}

/* ---------- Life at Echoe (office photos) ---------- */
.life-item { position: relative; display: block; overflow: hidden; border-radius: 18px; background: #e9eef6;
    box-shadow: 0 18px 40px -26px rgba(10, 37, 64, .45); isolation: isolate; }
.life-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.life-item:hover img, .life-item:focus-visible img { transform: scale(1.05); }
.life-item::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none;
    background: linear-gradient(to top, rgba(10, 37, 64, .45), transparent); opacity: 0; transition: opacity .4s; }
.life-item:hover::after { opacity: 1; }
.life-item:focus-visible { outline: 3px solid var(--c-accent, #1e63d8); outline-offset: 3px; }

.life-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 230px; grid-auto-flow: dense; gap: 16px; }
.life-big img, .life-wide img, .life-m1 img, .life-m3 img { object-position: 50% 30%; }
.life-tall img { object-position: 50% 35%; }
.life-big  { grid-column: span 2; grid-row: span 2; }
.life-wide { grid-column: span 2; }
.life-tall { grid-row: span 2; }

.life-teaser-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.life-teaser-copy .lead { margin-bottom: 1.5rem; }
.life-mosaic { display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: 190px 190px; gap: 14px; }
.life-m1 { grid-column: 1 / 3; grid-row: 1; }
.life-m2 { grid-column: 3; grid-row: 1 / 3; }
.life-m3 { grid-column: 1; grid-row: 2; }
.life-m4 { grid-column: 2; grid-row: 2; }
.life-m4 img { object-position: 50% 20%; }

@media (max-width: 900px) {
    .life-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; gap: 12px; }
    .life-teaser-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .life-grid { grid-auto-rows: 140px; }
    .life-mosaic { grid-template-rows: 150px 150px; gap: 10px; }
}

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 9999; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center;
    background: rgba(6, 18, 34, .92); opacity: 0; transition: opacity .25s; }
.lb.is-open { opacity: 1; }
.lb figure { margin: 0; display: grid; justify-items: center; gap: 12px; padding: 56px 0 24px; max-height: 100vh; }
.lb img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lb figcaption { color: #dbe4f0; font-size: .95rem; text-align: center; padding: 0 12px; }
.lb button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
    display: grid; place-items: center; justify-self: center; transition: background .2s; }
.lb button:hover, .lb button:focus-visible { background: rgba(255, 255, 255, .25); outline: none; }
.lb .lb-close { position: absolute; top: 14px; right: 14px; }
.lb-count { position: absolute; top: 24px; left: 20px; color: #9fb0c8; font-size: .85rem; }
html.lb-lock { overflow: hidden; }
@media (max-width: 600px) {
    .lb { grid-template-columns: 1fr; }
    .lb .lb-prev, .lb .lb-next { position: absolute; bottom: 18px; }
    .lb .lb-prev { left: 22%; } .lb .lb-next { right: 22%; }
    .lb figure { padding: 60px 8px 90px; }
}
@media (prefers-reduced-motion: reduce) {
    .life-item img, .lb { transition: none; }
}
