/* Products & Solutions: same before→after scroll story, redesigned as a split scene.
   Loaded after solution-page.css and overrides its layout and colours. */

.solutions-page .section {
    --panel: #0b2340;
    --split: 42%;
    background: var(--panel);
    padding-top: 80px;
    align-items: stretch;
    word-break: keep-all;
}

/* picture side: full-strength image, no fade into the text */
.solutions-page .section-bg {
    left: var(--split);
    right: 0;
    top: 80px;
    width: auto;
    height: calc(100% - 80px);
    opacity: 1;
    filter: none;
    mask-image: none;
    -webkit-mask-image: none;
}
.solutions-page #section1 .section-bg { opacity: 1; filter: none; mask-image: none; -webkit-mask-image: none; }
.solutions-page #section2 .section-bg,
.solutions-page #section3 .section-bg { mask-image: none; -webkit-mask-image: none; }
.solutions-page #section3 .section-bg {
    background: radial-gradient(circle at 60% 40%, #16406e 0%, #0d2a4c 70%);
}

/* the overlays play only on the picture side */
.solutions-page .dust-grid,
.solutions-page .puddle-overlay,
.solutions-page .city-grid {
    left: var(--split);
    width: calc(100% - var(--split));
    top: 80px;
    height: calc(100% - 80px);
    opacity: 1;
}
.solutions-page .city-grid { mix-blend-mode: normal; z-index: 5; }
#city-pattern path { stroke: rgba(160, 190, 230, 0.22); }

/* a thin edge where the two halves meet, echoing a kerb line */
.solutions-page .section-overlay {
    left: var(--split);
    width: 6px;
    top: 80px;
    height: calc(100% - 80px);
    background: repeating-linear-gradient(180deg, #e8ecef 0 28px, #2a2e33 28px 40px) !important;
    mix-blend-mode: normal !important;
    z-index: 6;
}

/* text side: solid panel, high contrast */
.solutions-page .section-content {
    width: var(--split);
    max-width: none;
    margin: 0;
    padding: 0 4.5% 0 7%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--panel);
    z-index: 4;
}
.sol-step {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #8fb4ff;
    margin-bottom: 1.2rem;
}
.sol-step i { font-style: normal; color: #5b7aa8; }
.solutions-page .section-title {
    font-size: 2.6rem;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: none;
    margin-bottom: 1.2rem;
}
.solutions-page .section-subtitle {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.7;
    color: #c9d6e6;
    text-shadow: none;
    margin: 0;
}
.solutions-page #section1 .highlight { color: #5fd39a; }
.solutions-page #section1 .highlight::after { background: #5fd39a; }
.solutions-page #section2 .highlight { color: #8fb4ff; }
.solutions-page #section2 .highlight::after { background: #8fb4ff; }
.solutions-page #section3 .highlight { color: #ffd166; }
.solutions-page #section3 .highlight::after { background: #ffd166; }

/* before → after caption that flips when the scene has played */
.sol-state {
    margin-top: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #9fb3cc;
}
.sol-state b { font-weight: 600; color: #9fb3cc; transition: color 0.6s ease 2.6s; }
.sol-state b + span { color: #5b7aa8; }
.sol-state b:last-child { color: #5b7aa8; }
.section.visible .sol-state b:first-child { color: #5b7aa8; }
.section.visible .sol-state b:last-child { color: #ffffff; }

@media (max-width: 1024px) {
    .solutions-page .section { --split: 46%; }
    .solutions-page .section-title { font-size: 2.1rem; }
}

/* phone: picture on top, text panel underneath, no floating glass card */
@media (max-width: 768px) {
    .solutions-page .section {
        display: block;
        height: auto;
        min-height: 0;
        padding-top: 64px;
    }
    .solutions-page .section-bg,
    .solutions-page .dust-grid,
    .solutions-page .puddle-overlay,
    .solutions-page .city-grid {
        left: 0;
        width: 100%;
        top: 64px;
        height: 46vh;
        opacity: 1;
    }
    .solutions-page .section-overlay {
        left: 0;
        width: 100%;
        top: calc(64px + 46vh);
        height: 6px;
        background: repeating-linear-gradient(90deg, #e8ecef 0 28px, #2a2e33 28px 40px) !important;
    }
    .solutions-page .section-content {
        position: relative;
        width: 100%;
        margin-top: calc(46vh + 6px);
        padding: 2rem 22px 2.6rem;
        background: var(--panel);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .solutions-page .section-title { font-size: 1.6rem; }
    .solutions-page .section-subtitle { font-size: 1rem; }
    .sol-state { margin-top: 1.4rem; }
}

/* ---------- scenes: the problem holds, then moves into the road edge ---------- */
.solutions-page .fx {
    position: absolute;
    left: calc(var(--split) + 6px);
    right: 0;
    top: 80px;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}

/* 1. dust: drawn by /js/pages/solution-dust.js into a canvas over the photo */
.solutions-page .fx-dust { left: var(--split); }
.fx-dust .dust-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#section1 .sol-state b { transition-delay: 3s; }

/* 2. water: drawn by /js/pages/solution-water.js into a canvas over the photo; rain falls on top */
.solutions-page .fx-water { left: var(--split); }
.fx-water .water-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fx-water .rain { position: absolute; inset: 0; clip-path: var(--rain-clip, none); }
.fx-water .rain i {
    position: absolute;
    left: var(--x);
    top: -18%;
    width: var(--w, 1px);
    height: var(--l, 8%);
    background: linear-gradient(180deg, rgba(230, 238, 248, 0), rgba(230, 238, 248, var(--o, 0.5)));
    transform: rotate(7deg);
    animation: rain-fall var(--f) linear infinite;
    animation-delay: var(--t);
}
.fx-water:not(.has-gl) .rain { display: none; }
@keyframes rain-fall { to { top: 108%; } }

/* 3. map: sensors pulse, a predicted hotspot appears, the sweeper route draws, the hotspot clears */
.fx-map { background: radial-gradient(circle at 60% 40%, #16406e 0%, #0d2a4c 75%); }
.fx-map svg { width: 100%; height: 100%; display: block; }
.fx-map .roads path { fill: none; stroke: #3d5f8c; stroke-width: 1.8; }
.fx-map .sensors circle { fill: #8fb4ff; }
.fx-map .pulses circle { fill: none; stroke: #8fb4ff; stroke-width: 0.5; transform-box: fill-box; transform-origin: center; animation: pulse 2s ease-out infinite; }
.fx-map .pulses circle:nth-child(2) { animation-delay: 0.5s; }
.fx-map .pulses circle:nth-child(3) { animation-delay: 1s; }
.fx-map .pulses circle:nth-child(4) { animation-delay: 1.5s; }
@keyframes pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(5); opacity: 0; } }
.fx-map .hotspot { fill: rgba(217, 150, 58, 0.55); filter: blur(1.2px); opacity: 0; transform-box: fill-box; transform-origin: center; }
.fx-map .depot { fill: #5fd39a; }
.fx-map .route { fill: none; stroke: #5fd39a; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.section.visible .fx-map .hotspot { animation: hot 5.4s ease forwards 0.8s; }
.section.visible .fx-map .route { animation: route 2s ease-in-out forwards 2.4s; }
@keyframes hot { 0% { opacity: 0; transform: scale(0.4); } 20%, 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0.15; transform: scale(0.6); } }
@keyframes route { to { stroke-dashoffset: 0; } }

.sol-patent {
    margin: 1rem 0 0;
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    border: 1px solid #ffd166;
    border-radius: 3px;
    font-size: 0.85rem;
    color: #ffd166;
}

/* the old overlays are no longer in the markup */
.solutions-page .dust-grid, .solutions-page .puddle-overlay, .solutions-page .city-grid { display: none; }

@media (max-width: 768px) {
    .solutions-page .fx { left: 0; top: 64px; bottom: auto; height: 46vh; }
}

@media (prefers-reduced-motion: reduce) {
    .fx-water .rain, .fx-map .pulses { display: none; }
    .fx-map .route { stroke-dashoffset: 0; animation: none !important; }
    .fx-map .hotspot { animation: none !important; opacity: 0.15; }
}

/* ---------- scroll-linked scenes: each section sticks while the reader scrolls through its track ---------- */
html:has(body.solutions-page) { scroll-snap-type: none; }
.solutions-page .sol-track { position: relative; height: 230vh; }
.solutions-page .sol-track > .section {
    position: sticky;
    top: 0;
    height: 100vh;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
}
/* the before/after words follow the scroll, not a timer */
.solutions-page .sol-track .sol-state b { transition: color 0.4s ease; transition-delay: 0s; }
.solutions-page .sol-track .section .sol-state b:first-child { color: #9fb3cc; }
.solutions-page .sol-track .section .sol-state b:last-child { color: #5b7aa8; }
.solutions-page .sol-track .section.is-after .sol-state b:first-child { color: #5b7aa8; }
.solutions-page .sol-track .section.is-after .sol-state b:last-child { color: #ffffff; }
/* the map follows the scroll too (solution-scroll.js sets the route and hotspot) */
.solutions-page .sol-track .fx-map .hotspot,
.solutions-page .sol-track .fx-map .route { animation: none !important; }
@media (max-width: 768px) {
    .solutions-page .sol-track > .section { height: 100svh; min-height: 0; overflow: hidden; }
}

/* scroll cue in each scene: tells the reader the scene moves with the scroll; shown on the first screen and whenever
   the reader pauses inside a scene (body.sol-cue, set by solution-scroll.js), hidden while they scroll */
.solutions-page .scroll-cue {
    position: absolute; left: 50%; bottom: 34px; z-index: 6; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; letter-spacing: .06em; color: rgba(255, 255, 255, .92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .45); transition: opacity .25s ease;
    opacity: 0; pointer-events: none;
}
.solutions-page .scroll-cue i {
    width: 22px; height: 34px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 12px; position: relative;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}
.solutions-page .scroll-cue i::after {
    content: ''; position: absolute; left: 50%; top: 7px; width: 4px; height: 7px; margin-left: -2px;
    border-radius: 2px; background: #fff; animation: cue-wheel 1.6s ease-in-out infinite;
}
@keyframes cue-wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }
body.sol-cue .scroll-cue { opacity: 1; transition-duration: .6s; }
/* the map scene has lines and rings under the cue: give it a quiet plate so it reads apart from the map */
.solutions-page .fx-map .scroll-cue { padding: 8px 14px 10px; border-radius: 8px; background: rgba(6, 18, 38, .62); }
@media (max-width: 768px) { .solutions-page .scroll-cue { bottom: 18px; } }
@media (prefers-reduced-motion: reduce) { .solutions-page .scroll-cue i::after { animation: none; } }

/* iPhone Safari: the scene is as tall as the screen right now (dvh, which follows the toolbar showing and hiding),
   and the picture is measured in the same unit (vh there means the largest screen, which pushed the text panel
   past the scene and cut it). Behind the scenes the track is navy, so any gap reads as panel, not white. */
.solutions-page .sol-track { background: #0b2340; }
@media (max-width: 768px) {
    .solutions-page .section { --pic: 40svh; }
    @supports (height: 100dvh) {
        .solutions-page .sol-track > .section { height: 100dvh; }
        .solutions-page .section { --pic: 40dvh; }
    }
    .solutions-page .section-bg,
    .solutions-page .dust-grid,
    .solutions-page .puddle-overlay,
    .solutions-page .city-grid,
    .solutions-page .fx { height: var(--pic); }
    .solutions-page .section-overlay { top: calc(64px + var(--pic)); }
    .solutions-page .section-content { margin-top: calc(var(--pic) + 6px); padding: 1.6rem 22px 2rem; }
}
@media (max-width: 768px) and (max-height: 700px) {
    .solutions-page .section { --pic: 34svh; }
    @supports (height: 100dvh) { .solutions-page .section { --pic: 34dvh; } }
    .solutions-page .section-title { font-size: 1.4rem; }
    .solutions-page .section-subtitle { font-size: .95rem; }
    .sol-state { margin-top: 1rem; }
}

/* closing band: a white section on the site column, like the other pages, with one plain button to the product */
.solutions-page .product-detail-cta { padding: 96px max(5%, calc((100% - 1200px) / 2)); background: #fff; border-top: 1px solid #eef1f4; text-align: left; }
.solutions-page .product-detail-cta::before, .solutions-page .product-detail-cta::after { display: none; }
.solutions-page .cta-content { max-width: none; margin: 0; text-align: left; }
.solutions-page .cta-content .kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: #009944; }
.solutions-page .cta-content h2 { margin: 10px 0 0; font-size: 32px; line-height: 1.35; letter-spacing: -.02em; color: #0b2340; background: none; -webkit-text-fill-color: currentColor; }
.solutions-page .cta-content p:not(.kicker) { margin: 12px 0 0; font-size: 17px; line-height: 1.7; color: #56606a; }
.solutions-page .cta-buttons { justify-content: flex-start; margin-top: 28px; }
.solutions-page .cta-button { display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 6px; background: #0b2340; color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.solutions-page .cta-button:hover { background: #123a78; transform: none; box-shadow: none; }
@media (max-width: 768px) {
    .solutions-page .product-detail-cta { padding: 64px 5%; }
    .solutions-page .cta-content h2 { font-size: 24px; }
    .solutions-page .cta-content p:not(.kicker) { font-size: 15.5px; }
}

/* phones: the picture fills the screen height the text panel leaves (--sol-text-h from solution-scroll.js),
   never less than 30% of the screen */
@media (max-width: 768px) {
    .solutions-page .section { --pic: max(30svh, calc(100svh - 70px - var(--sol-text-h, 320px))); }
    @supports (height: 100dvh) {
        .solutions-page .section { --pic: max(30dvh, calc(100dvh - 70px - var(--sol-text-h, 320px))); }
    }
}
/* touch screens: a downward arrow instead of the mouse-wheel picture */
@media (hover: none) and (pointer: coarse) {
    .solutions-page .scroll-cue i { width: 14px; height: 14px; border: 0; border-radius: 0; box-shadow: none;
        border-right: 2px solid rgba(255, 255, 255, .9); border-bottom: 2px solid rgba(255, 255, 255, .9);
        transform: rotate(45deg); animation: cue-down 1.6s ease-in-out infinite; }
    .solutions-page .scroll-cue i::after { display: none; }
}
@keyframes cue-down { 0%, 100% { transform: translateY(0) rotate(45deg); opacity: 1; } 60% { transform: translateY(8px) rotate(45deg); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .solutions-page .scroll-cue i { animation: none; } }
