/* ==========================================================================
   Service & category pages: banner, intro image, process timeline,
   quick facts, in-depth text and the image/video gallery.
   Every image keeps its own shape: frames size themselves to the picture.
   ========================================================================== */

/* ---------- Banner background (picture or video set in the admin) ---------- */
.sp-hero--media { padding-bottom: 5rem; }
.sp-hero--media::before { display: none; }   /* the picture replaces the gradient */
.sp-hero--media::after { display: none; }    /* and the logo watermark */
.sp-hero-bg { position: absolute; inset: 0; z-index: 1; overflow: hidden; background: #0B1438; }
.sp-hero-bg img, .sp-hero-bg video { width: 100%; height: 100%; object-fit: cover; display: block; animation: sp-fade .8s ease both; }
.sp-hero-bg::after { content: ''; position: absolute; inset: 0; }
.sp-ov-light .sp-hero-bg::after { background: linear-gradient(90deg, rgba(8, 12, 40, .7) 0%, rgba(8, 12, 40, .35) 55%, rgba(8, 12, 40, .1) 100%); }
.sp-ov-medium .sp-hero-bg::after { background: linear-gradient(90deg, rgba(8, 12, 40, .88) 0%, rgba(8, 12, 40, .6) 50%, rgba(8, 12, 40, .3) 100%); }
.sp-ov-strong .sp-hero-bg::after { background: linear-gradient(90deg, rgba(8, 12, 40, .95) 0%, rgba(8, 12, 40, .82) 55%, rgba(8, 12, 40, .65) 100%); }
@media (max-width: 768px) {
    /* Text covers more of the picture on phones, so darken evenly */
    .sp-ov-light .sp-hero-bg::after { background: rgba(8, 12, 40, .5); }
    .sp-ov-medium .sp-hero-bg::after { background: rgba(8, 12, 40, .68); }
    .sp-ov-strong .sp-hero-bg::after { background: rgba(8, 12, 40, .82); }
}
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Image frames inside sections (intro, overview) ---------- */
.sp-media-frame {
    margin: 0; justify-self: center; display: inline-flex; max-width: 100%; position: relative;
    border-radius: 24px; overflow: hidden; background: #F1F4FB;
    border: 1px solid rgba(31, 39, 184, 0.08);
    box-shadow: 0 30px 60px -28px rgba(31, 39, 184, 0.35);
}
.sp-media-frame img { display: block; width: auto; max-width: 100%; height: auto; max-height: 520px; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.sp-media-frame:hover img { transform: scale(1.04); }

.sp-intro { margin-bottom: 3.5rem; }
.sp-intro .sp-intro-text {
    max-width: 860px; margin: 0 auto; text-align: center;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.75; color: var(--gray-700);
}
.sp-intro .sp-intro-text p { color: inherit; font-size: inherit; line-height: inherit; }
.sp-intro .sp-intro-text p + p { margin-top: 1rem; }
.sp-intro--media { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3.5rem; align-items: center; }
.sp-intro--media .sp-intro-text { text-align: left; margin: 0; }
.sp-intro--media .sp-intro-text p:first-child { font-size: 1.15em; color: var(--gray-900, #0F172A); font-weight: 500; }

/* ---------- Process timeline ---------- */
.sp-process { overflow: hidden; }
.pt { list-style: none; margin: 3rem auto 0; padding: 0; position: relative; max-width: 1080px; }
.pt-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
.pt-line-fill {
    position: absolute; top: 0; left: 0; right: 0; height: calc(var(--pt-progress, 0) * 100%); border-radius: inherit;
    background: linear-gradient(180deg, #4CC6FF, #A87BFF 50%, #FF3D9A 80%, #FF9A2E);
}
.pt-line-fill::after {
    content: ''; position: absolute; bottom: -7px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
    background: #ffffff; box-shadow: 0 0 0 5px rgba(168, 123, 255, 0.35), 0 0 24px #A87BFF;
}
.pt-step { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); align-items: center; }
.pt-step + .pt-step { margin-top: -2.25rem; }
.pt-node { grid-column: 2; grid-row: 1; justify-self: center; position: relative; z-index: 2; }
.pt-node span {
    width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-weight: 800; font-size: 1rem; color: rgba(255, 255, 255, 0.55);
    background: #0E1438; border: 2px solid rgba(255, 255, 255, 0.14);
    transition: color .4s, background .4s, border-color .4s, box-shadow .4s, transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.pt-step.is-active .pt-node span {
    color: #ffffff; border-color: transparent; transform: scale(1.12);
    background: linear-gradient(135deg, #4CC6FF, #7B3CF5 60%, #FF3D9A);
    box-shadow: 0 0 0 6px rgba(123, 60, 245, 0.18), 0 10px 30px -6px rgba(76, 198, 255, 0.8);
}

.pt-card {
    grid-row: 1; position: relative; overflow: hidden; padding: 1.6rem 1.7rem;
    border-radius: 22px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color .4s, transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .4s;
}
.pt-left .pt-card { grid-column: 1; text-align: right; }
.pt-right .pt-card { grid-column: 3; }
.pt-card::before {
    content: ''; position: absolute; top: 0; height: 2px; width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1) .2s;
    background: linear-gradient(90deg, #4CC6FF, #A87BFF, #FF3D9A);
}
.pt-left .pt-card::before { right: 0; }
.pt-right .pt-card::before { left: 0; }
.pt-step.is-active .pt-card::before { width: 100%; }
.pt-card:hover { transform: translateY(-4px); border-color: rgba(168, 123, 255, 0.4); box-shadow: 0 24px 50px -24px rgba(123, 60, 245, 0.6); }
.pt-num {
    position: absolute; top: -0.6rem; font-family: var(--font-heading); font-size: 5.5rem; font-weight: 800; line-height: 1;
    color: rgba(255, 255, 255, 0.035); pointer-events: none;
}
.pt-left .pt-num { left: 1rem; }
.pt-right .pt-num { right: 1rem; }
.pt-kicker {
    display: inline-block; margin-bottom: .45rem; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    background: linear-gradient(90deg, #8AD9FF, #A87BFF, #FFB347); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pt-card h3 { color: #ffffff; font-size: 1.2rem; margin-bottom: .4rem; position: relative; }
.pt-card p { color: rgba(226, 232, 255, 0.72); font-size: .93rem; margin: 0; position: relative; }

@media (max-width: 900px) {
    .pt-line { left: 27px; }
    .pt-step { grid-template-columns: 54px minmax(0, 1fr); gap: 1rem; align-items: start; }
    .pt-step + .pt-step { margin-top: 1.1rem; }
    .pt-node { grid-column: 1; }
    .pt-left .pt-card, .pt-right .pt-card { grid-column: 2; text-align: left; }
    .pt-left .pt-card::before { left: 0; right: auto; }
    .pt-left .pt-num { left: auto; right: 1rem; }
    .pt-card { padding: 1.25rem 1.3rem; }
    .pt-card.slide-left { transform: translateX(40px); }
    .pt-card.slide-left.in-view { transform: none; }
}

/* ---------- At a glance ---------- */
.sp-glance {
    position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 2.5rem; align-items: center;
    padding: clamp(1.75rem, 4vw, 3.25rem); border-radius: 30px; color: #ffffff;
    background: radial-gradient(60% 90% at 100% 0%, rgba(123, 60, 245, 0.45), transparent 60%),
                radial-gradient(50% 80% at 0% 100%, rgba(76, 198, 255, 0.3), transparent 60%),
                linear-gradient(140deg, #0B1438, #1F2944);
    box-shadow: 0 40px 80px -40px rgba(11, 20, 56, 0.8);
}
.sp-glance::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: radial-gradient(70% 70% at 70% 30%, #000, transparent);
}
.sp-glance-head { position: relative; z-index: 1; }
.sp-glance-head .section-badge { background: rgba(255, 255, 255, 0.08); color: #ffffff; border-color: rgba(255, 255, 255, 0.16); }
.sp-glance-head .section-badge i { color: #8AD9FF; }
.sp-glance-head h2 { color: #ffffff; margin: 1rem 0 .75rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.sp-glance-head .highlight { background-image: linear-gradient(90deg, #4CC6FF, #A87BFF 50%, #FF9A2E); }
.sp-glance-head p { color: rgba(226, 232, 255, 0.75); margin: 0; }
.sp-glance-head p strong { color: #ffffff; }
.sp-glance-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.sp-stat {
    padding: 1.4rem 1.3rem; border-radius: 20px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform .5s cubic-bezier(.2, .8, .2, 1), border-color .4s, background .4s;
}
.sp-stat:hover { transform: translateY(-6px); border-color: rgba(138, 217, 255, 0.45); background: rgba(255, 255, 255, 0.09); }
.sp-stat-value {
    display: block; font-family: var(--font-heading); font-size: clamp(1.45rem, 2.6vw, 1.95rem); font-weight: 800; line-height: 1.15; margin-bottom: .4rem;
    background: linear-gradient(90deg, #8AD9FF, #C9B3FF 55%, #FFC27A); -webkit-background-clip: text; background-clip: text; color: transparent;
    overflow-wrap: anywhere;
}
.sp-stat-label { color: rgba(226, 232, 255, 0.78); font-size: .9rem; line-height: 1.45; }
@media (max-width: 900px) { .sp-glance { grid-template-columns: 1fr; } }

/* ---------- In depth ---------- */
.sp-depth-grid { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); gap: 3.5rem; align-items: start; max-width: 1100px; }
.sp-depth-head { position: sticky; top: 7.5rem; }
.sp-depth-head h2 { margin: 1rem 0 1.25rem; }
.sp-depth-body { font-size: 1.05rem; }
.sp-depth-body p:first-child::first-letter {
    float: left; font-family: var(--font-heading); font-size: 3.4em; line-height: .85; font-weight: 800; margin: .08em .12em 0 0;
    background: linear-gradient(135deg, #2D5BFF, #7B3CF5); -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (max-width: 900px) { .sp-depth-grid { grid-template-columns: 1fr; gap: 1.25rem; } .sp-depth-head { position: static; } }

/* ---------- Gallery ---------- */
/* Columns follow the number of items (1, 2, or 3+); each picture keeps its own shape,
   with its title and description underneath */
.sp-gallery { display: grid; gap: 1.5rem; align-items: start; }
.sp-gallery--1 { grid-template-columns: 1fr; max-width: 960px; margin: 0 auto; }
.sp-gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1024px) { .sp-gallery--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .sp-gallery--2, .sp-gallery--3 { grid-template-columns: 1fr; } }
.sp-gm {
    break-inside: avoid; margin: 0; border-radius: 22px; overflow: hidden; position: relative;
    background: #ffffff; border: 1px solid rgba(31, 39, 184, 0.07); box-shadow: 0 24px 50px -30px rgba(31, 39, 184, 0.35);
}
.sp-gm img, .sp-gm video { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }
.sp-gm video { background: #0B1438; max-height: 70vh; }
.sp-gm-open { all: unset; display: block; cursor: zoom-in; position: relative; overflow: hidden; }
.sp-gm-open:focus-visible { outline: 3px solid #4CC6FF; outline-offset: -3px; }
.sp-gm-open img { transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.sp-gm-open:hover img { transform: scale(1.05); }
.sp-gm-zoom {
    position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: .9rem;
    background: rgba(11, 20, 56, 0.6); opacity: 0; transform: scale(.7); transition: opacity .3s, transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.sp-gm-open:hover .sp-gm-zoom, .sp-gm-open:focus-visible .sp-gm-zoom { opacity: 1; transform: none; }
.sp-gm-embed { position: relative; aspect-ratio: 16 / 9; background: #0B1438; }
.sp-gm-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sp-gm figcaption { padding: 1.1rem 1.25rem 1.25rem; border-top: 1px solid rgba(31, 39, 184, 0.06); }
.sp-gm figcaption strong { display: block; font-family: var(--font-heading); font-size: 1.05rem; color: var(--gray-900, #0F172A); margin-bottom: .3rem; }
.sp-gm figcaption p { margin: 0; font-size: .92rem; line-height: 1.6; color: var(--gray-600); }

/* Lightbox */
.sp-lb {
    position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
    padding: 4.5rem 1rem 2rem; background: rgba(5, 8, 28, 0.94);
    opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.sp-lb.is-open { opacity: 1; visibility: visible; }
.sp-lb img { max-width: min(1200px, 100%); max-height: calc(100vh - 9rem); border-radius: 16px; box-shadow: 0 40px 90px -30px #000; transform: scale(.94); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.sp-lb.is-open img { transform: none; }
.sp-lb p { color: rgba(255, 255, 255, 0.85); margin: 0; text-align: center; }
.sp-lb button {
    position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08); color: #ffffff; font-size: 1.05rem; cursor: pointer; transition: background .2s;
}
.sp-lb button:hover { background: rgba(255, 255, 255, 0.18); }
.sp-lb-close { top: 1rem; right: 1rem; }
.sp-lb-prev { left: 1rem; top: 50%; translate: 0 -50%; }
.sp-lb-next { right: 1rem; top: 50%; translate: 0 -50%; }
.sp-lb-count { position: absolute; top: 1.6rem; left: 1.4rem; color: rgba(255, 255, 255, .7); font-size: .9rem; }

/* ---------- Phones & tablets ---------- */
@media (max-width: 991px) {
    .sp-intro--media { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 576px) {
    .sp-media-frame img { max-height: 340px; }
    .sp-lb-prev, .sp-lb-next { top: auto; bottom: 1rem; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-hero-bg img, .sp-hero-bg video { animation: none; }
}
