/* ==========================================================================
   SECTION 5 · DEMAND SENSING — The User Journey
   • Clean white background, premium light palette (no neon, no glow)
   • Strict 16:9 aspect ratio on desktop & tablet
   • 5 horizontal step cards on a connecting progress rail
   • Scroll-driven progress animation across the rail
   • Fully responsive — collapses to vertical stack on mobile
   ========================================================================== */

/* ---------- Scoped tokens (light palette) ---------- */
.ds5-journey {
    /* Surface */
    --ds5-bg:          #ffffff;
    --ds5-bg-2:        #fafbfc;
    --ds5-bg-3:        #f3f5f9;

    /* Ink (text) */
    --ds5-ink:         #0d1a33;     /* deepest text */
    --ds5-ink-2:       #2a3a5a;     /* body */
    --ds5-ink-3:       #5a6b8a;     /* muted */
    --ds5-ink-4:       #8b97b3;     /* meta */

    /* Lines */
    --ds5-line:        rgba(13, 26, 51, 0.08);
    --ds5-line-strong: rgba(13, 26, 51, 0.14);

    /* Accent (deep blue – NO neon, NO glow) */
    --ds5-accent:      #1e4ea8;
    --ds5-accent-2:    #2a62c8;
    --ds5-accent-3:    #4a86e8;
    --ds5-accent-soft: #eaf0fb;

    /* Shadow */
    --ds5-shadow:      rgba(13, 26, 51, 0.08);
    --ds5-shadow-2:    rgba(13, 26, 51, 0.04);

    max-width: 1200px;
    width: calc(100% - 48px);
    margin: 56px auto;
    color: var(--ds5-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}
.ds5-journey *,
.ds5-journey *::before,
.ds5-journey *::after { box-sizing: border-box; }

/* ---------- 16:9 Frame ---------- */
.ds5-aspect {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 28px;
    background: var(--ds5-bg);
    border: 1px solid var(--ds5-line);
    box-shadow:
        0 1px 0 rgba(255,255,255,1) inset,
        0 30px 80px -40px var(--ds5-shadow),
        0 10px 30px -20px var(--ds5-shadow-2);
    overflow: hidden;
    isolation: isolate;
}

/* Subtle dot grid (very faint, no glow) */
.ds5-bg-grid {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(rgba(13,26,51,0.06) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.7;
}

/* ---------- Container ---------- */
.ds5-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 3.2% 4%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: clamp(14px, 2vw, 22px);
}

/* =================================================================
   HEADER
   ================================================================= */
.ds5-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(8px, 1vw, 12px);
}

.ds5-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--ds5-accent-soft);
    border: 1px solid var(--ds5-line-strong);
    color: var(--ds5-accent);
    font-size: clamp(0.6rem, 0.85vw, 0.7rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.ds5-eyebrow-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ds5-accent);
}

.ds5-title {
    font-size: clamp(1.2rem, 2.4vw, 1.95rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
    font-weight: 800;
    margin: 0;
    color: var(--ds5-ink);
    max-width: 800px;
}
.ds5-accent {
    color: var(--ds5-accent);
    font-style: italic;
    font-weight: 800;
}

.ds5-subtitle {
    margin: 0;
    max-width: 640px;
    font-size: clamp(0.72rem, 1vw, 0.88rem);
    line-height: 1.55;
    color: var(--ds5-ink-3);
    font-weight: 400;
}
.ds5-subtitle strong { color: var(--ds5-ink-2); font-weight: 700; }

/* =================================================================
   JOURNEY TRACK (horizontal · 5 steps)
   ================================================================= */
.ds5-journey-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    padding: clamp(8px, 1.5vw, 16px) clamp(4px, 1vw, 12px);
}

/* Progress rail — single horizontal line that connects all 5 nodes */
.ds5-rail {
    position: absolute;
    /* Vertically center on the node row */
    top: calc(clamp(8px, 1.5vw, 16px) + clamp(20px, 2.6vw, 30px));
    left: 10%;
    right: 10%;
    height: 2px;
    z-index: 0;
}
.ds5-rail-track {
    position: absolute;
    inset: 0;
    background: var(--ds5-line-strong);
    border-radius: 2px;
}
.ds5-rail-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--ds5-accent) 0%, var(--ds5-accent-2) 100%);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Steps row */
.ds5-steps {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(8px, 1.2vw, 14px);
    height: 100%;
}

.ds5-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    gap: clamp(8px, 1.1vw, 12px);
}

/* Node (circle on the rail) */
.ds5-node {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(40px, 5.2vw, 60px);
    height: clamp(40px, 5.2vw, 60px);
    border-radius: 50%;
    background: var(--ds5-bg);
    border: 2px solid var(--ds5-line-strong);
    color: var(--ds5-ink-3);
    z-index: 2;
    transition:
        border-color 0.4s ease,
        color 0.4s ease,
        background 0.4s ease,
        transform 0.4s ease;
}
.ds5-node-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.ds5-node svg {
    width: 44%;
    height: 44%;
}
.ds5-node-num {
    position: absolute;
    bottom: -18px;
    font-size: clamp(0.55rem, 0.78vw, 0.7rem);
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--ds5-ink-4);
    transition: color 0.4s ease;
}

/* Active state — applied when step is reached by scroll progress */
.ds5-step.is-active .ds5-node {
    background: var(--ds5-accent);
    border-color: var(--ds5-accent);
    color: #ffffff;
    transform: scale(1.04);
}
.ds5-step.is-active .ds5-node-num {
    color: var(--ds5-accent);
}

/* Card */
.ds5-card {
    width: 100%;
    margin-top: clamp(12px, 1.4vw, 18px);
    padding: clamp(10px, 1.3vw, 16px);
    border-radius: 14px;
    background: var(--ds5-bg);
    border: 1px solid var(--ds5-line);
    box-shadow:
        0 1px 0 rgba(255,255,255,1) inset,
        0 6px 18px -12px var(--ds5-shadow);
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 0.6vw, 7px);
    text-align: left;
    transition:
        border-color 0.4s ease,
        box-shadow 0.4s ease,
        transform 0.4s ease;
}
.ds5-step.is-active .ds5-card {
    border-color: var(--ds5-line-strong);
    box-shadow:
        0 1px 0 rgba(255,255,255,1) inset,
        0 10px 24px -14px var(--ds5-shadow);
    transform: translateY(-2px);
}

.ds5-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--ds5-accent-soft);
    color: var(--ds5-accent);
    font-size: clamp(0.5rem, 0.7vw, 0.6rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    width: max-content;
}
.ds5-card-title {
    margin: 0;
    font-size: clamp(0.78rem, 1.1vw, 0.95rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--ds5-ink);
}
.ds5-card-desc {
    margin: 0;
    font-size: clamp(0.62rem, 0.82vw, 0.74rem);
    line-height: 1.5;
    color: var(--ds5-ink-3);
    font-weight: 400;
}
.ds5-card-bullets {
    list-style: none;
    padding: 0;
    margin: clamp(2px, 0.4vw, 4px) 0 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ds5-card-bullets li {
    position: relative;
    padding-left: 14px;
    font-size: clamp(0.58rem, 0.78vw, 0.7rem);
    color: var(--ds5-ink-2);
    font-weight: 500;
    line-height: 1.4;
}
.ds5-card-bullets li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.55em;
    width: 8px; height: 2px;
    border-radius: 2px;
    background: var(--ds5-accent);
}

/* =================================================================
   FOOTER
   ================================================================= */
.ds5-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(10px, 1.4vw, 18px);
    padding-top: clamp(6px, 1vw, 12px);
    border-top: 1px solid var(--ds5-line);
}
.ds5-foot-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ds5-foot-k {
    font-size: clamp(0.85rem, 1.3vw, 1.05rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    color: var(--ds5-ink);
}
.ds5-foot-l {
    font-size: clamp(0.58rem, 0.78vw, 0.68rem);
    color: var(--ds5-ink-3);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.ds5-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: clamp(8px, 1vw, 11px) clamp(14px, 1.6vw, 18px);
    border-radius: 999px;
    text-decoration: none;
    color: #ffffff;
    font-size: clamp(0.72rem, 0.95vw, 0.84rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    background: var(--ds5-accent);
    border: 1px solid var(--ds5-accent);
    box-shadow: 0 4px 14px -6px rgba(30, 78, 168, 0.4);
    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}
.ds5-cta svg { width: 14px; height: 14px; color: #ffffff; }
.ds5-cta:hover {
    transform: translateY(-2px);
    background: var(--ds5-accent-2);
    box-shadow: 0 10px 22px -8px rgba(30, 78, 168, 0.45);
}

/* ---------- Reveal animation (v5: safe default — always visible) ---------- */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Large tablet / small desktop */
@media (max-width: 1180px) {
    .ds5-journey {
        max-width: 1024px;
        width: calc(100% - 40px);
        margin: 48px auto;
    }
    .ds5-container { padding: 3% 3.5%; }
}

/* Tablet — keep 16:9, slightly tighter cards */
@media (max-width: 960px) {
    .ds5-journey {
        max-width: 100%;
        width: calc(100% - 32px);
        margin: 36px auto;
    }
    .ds5-aspect { border-radius: 22px; }
    .ds5-container { padding: 3% 3.2%; gap: 14px; }
    .ds5-steps { gap: 8px; }
    .ds5-card { padding: 9px; }
    .ds5-card-desc { font-size: 0.62rem; }
    .ds5-card-bullets li { font-size: 0.58rem; padding-left: 12px; }
}

/* Mobile — release 16:9, stack vertically with a left vertical rail */
@media (max-width: 720px) {
    .ds5-journey {
        width: calc(100% - 24px);
        margin: 24px auto;
    }
    .ds5-aspect {
        aspect-ratio: auto;
        border-radius: 18px;
        min-height: 0;
    }
    .ds5-container {
        position: relative;
        inset: auto;
        padding: 26px 18px;
        grid-template-rows: auto auto auto;
        gap: 22px;
    }

    .ds5-header { gap: 10px; }
    .ds5-title { font-size: clamp(1.3rem, 6vw, 1.7rem); }
    .ds5-subtitle { font-size: 0.82rem; max-width: 100%; }

    /* Switch journey to vertical layout */
    .ds5-journey-wrap {
        padding: 4px 0 4px 4px;
    }
    /* Vertical rail on the left */
    .ds5-rail {
        top: 30px;
        bottom: 30px;
        left: 26px;
        right: auto;
        width: 2px;
        height: auto;
    }
    .ds5-rail-fill {
        width: 100%;
        height: 0%;
        background: linear-gradient(180deg, var(--ds5-accent) 0%, var(--ds5-accent-2) 100%);
        transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .ds5-steps {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .ds5-step {
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
    }
    .ds5-node {
        width: 54px;
        height: 54px;
        flex-shrink: 0;
    }
    .ds5-node-num {
        position: absolute;
        bottom: auto;
        top: -16px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.58rem;
    }
    .ds5-card {
        margin-top: 0;
        flex: 1;
        min-width: 0;
        padding: 12px 14px;
    }
    .ds5-card-title { font-size: 0.92rem; }
    .ds5-card-desc { font-size: 0.74rem; line-height: 1.5; }
    .ds5-card-bullets li { font-size: 0.68rem; padding-left: 14px; }

    /* Footer */
    .ds5-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .ds5-cta { font-size: 0.78rem; padding: 9px 16px; }
}

/* Small mobile */
@media (max-width: 420px) {
    .ds5-journey {
        width: calc(100% - 16px);
        margin: 18px auto;
    }
    .ds5-aspect { border-radius: 16px; }
    .ds5-container { padding: 22px 14px; gap: 18px; }
    .ds5-title { font-size: 1.35rem; }
    .ds5-subtitle { font-size: 0.76rem; }
    .ds5-rail { left: 22px; }
    .ds5-node { width: 46px; height: 46px; }
    .ds5-card-title { font-size: 0.88rem; }
    .ds5-card-desc { font-size: 0.7rem; }
    .ds5-card-bullets li { font-size: 0.64rem; }
}

/* Ultra-narrow */
@media (max-width: 340px) {
    .ds5-step { gap: 10px; }
    .ds5-node { width: 42px; height: 42px; }
    .ds5-rail { left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .ds5-rail-fill,
    .ds5-node,
    .ds5-card { transition: none; }
}
