/* ==========================================================================
   SECTION 4 · DEMAND SENSING — Industries We Power
   • Dark navy metallic palette matching Section 2 (--ds-* tokens)
   • Strict 16:9 aspect ratio on desktop & tablet
   • Left: tagline / messaging  |  Right: interactive tabs + detail panel
   • Aspect ratio releases on mobile so all content stays visible
   ========================================================================== */

/* ---------- Scoped tokens (mirror Section 2 palette) ---------- */
.ds4-industry {
    --ds4-deep:        #050b1a;
    --ds4-base:        #0b1a36;
    --ds4-mid:         #122a52;
    --ds4-hi:          #1d3a6e;
    --ds4-rim:         #2a4a83;
    --ds4-edge:        rgba(255,255,255,0.10);
    --ds4-edge-soft:   rgba(255,255,255,0.05);
    --ds4-shadow:      rgba(2,6,14,0.65);
    --ds4-ink:         #f4f7ff;
    --ds4-ink-2:       #c9d4ee;
    --ds4-ink-3:       #93a5c8;
    --ds4-ink-4:       #6a7ea4;
    --ds4-line:        rgba(255,255,255,0.08);
    --ds4-line-strong: rgba(255,255,255,0.16);
    --ds4-accent:      #6ea8ff;
    --ds4-accent-2:    #b9d0ff;
    --ds4-accent-3:    #4a86e8;

    --ds4-metallic:
        radial-gradient(1200px 600px at 80% -10%, rgba(110,168,255,0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(40,80,160,0.18), transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 35%),
        linear-gradient(135deg, #0a1730 0%, #14274d 40%, #0d1c3a 70%, #050d22 100%);

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

/* ---------- 16:9 Frame ---------- */
.ds4-aspect {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 28px;
    background: var(--ds4-metallic);
    border: 1px solid var(--ds4-line-strong);
    box-shadow:
        inset 0 1px 0 var(--ds4-edge),
        inset 0 -1px 0 rgba(0,0,0,0.5),
        0 30px 80px -30px var(--ds4-shadow),
        0 10px 30px -10px rgba(2,6,14,0.45);
    overflow: hidden;
    isolation: isolate;
}

/* Brushed-metal noise */
.ds4-aspect::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(
            135deg,
            rgba(255,255,255,0.012) 0px,
            rgba(255,255,255,0.012) 1px,
            transparent 1px,
            transparent 3px
        );
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: overlay;
    opacity: 0.7;
}

/* Top rim highlight */
.ds4-aspect::after {
    content: "";
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    z-index: 1;
    pointer-events: none;
}

/* Decorative glints */
.ds4-bg-glint {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
    opacity: 0.55;
}
.ds4-bg-glint--a {
    top: -140px; right: -100px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(110,168,255,0.35), transparent 65%);
}
.ds4-bg-glint--b {
    bottom: -160px; left: -80px;
    width: 460px; height: 460px;
    background: radial-gradient(circle, rgba(38,78,160,0.45), transparent 65%);
}

/* Dot grid */
.ds4-bg-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
}

/* ---------- Container Grid ---------- */
.ds4-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 3.2% 4%;
    display: grid;
    grid-template-columns: 0.95fr 1.4fr;
    gap: clamp(20px, 3vw, 44px);
    align-items: stretch;
}

/* =================================================================
   LEFT · TAGLINE BLOCK
   ================================================================= */
.ds4-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(10px, 1.4vw, 16px);
    min-width: 0;
}

.ds4-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #122a52 0%, #1d3a6e 50%, #0d1f3e 100%);
    border: 1px solid var(--ds4-line-strong);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.14),
        inset 0 -1px 0 rgba(0,0,0,0.4),
        0 4px 14px rgba(2,6,14,0.5);
    color: var(--ds4-ink-2);
    font-size: clamp(0.6rem, 0.92vw, 0.72rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: max-content;
    max-width: 100%;
}
.ds4-eyebrow-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #d4dff3 0%, #8aa3cc 45%, #3e588a 100%);
    box-shadow: 0 0 8px rgba(110,168,255,0.6);
}

.ds4-title {
    font-size: clamp(1.3rem, 2.7vw, 2.15rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
    font-weight: 800;
    margin: 0;
    color: var(--ds4-ink);
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
.ds4-accent {
    background: linear-gradient(135deg, #b9d0ff 0%, #6ea8ff 55%, #4a86e8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
}

.ds4-tagline {
    margin: 0;
    max-width: 460px;
    font-size: clamp(0.74rem, 1.05vw, 0.92rem);
    line-height: 1.55;
    color: var(--ds4-ink-2);
    font-weight: 400;
}
.ds4-tagline strong { color: var(--ds4-ink); font-weight: 700; }
.ds4-tagline em { color: var(--ds4-accent-2); font-style: italic; }

/* Stat meta row */
.ds4-meta-row {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.2vw, 14px);
    padding: clamp(8px, 1.2vw, 12px) clamp(10px, 1.4vw, 16px);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #112750 0%, #1a3464 100%);
    border: 1px solid var(--ds4-line-strong);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        0 4px 12px rgba(2,6,14,0.45);
    width: max-content;
    max-width: 100%;
}
.ds4-meta { display: flex; flex-direction: column; gap: 2px; }
.ds4-meta-k {
    font-size: clamp(0.95rem, 1.45vw, 1.15rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #ffffff 0%, #c9d4ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ds4-meta-l {
    font-size: clamp(0.56rem, 0.78vw, 0.66rem);
    color: var(--ds4-ink-3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}
.ds4-meta-divider {
    width: 1px;
    height: 22px;
    background: var(--ds4-line-strong);
}

/* CTA */
.ds4-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: var(--ds4-ink);
    font-size: clamp(0.72rem, 0.95vw, 0.84rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #2a4a83 0%, #1d3a6e 50%, #122a52 100%);
    border: 1px solid var(--ds4-line-strong);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.18),
        inset 0 -1px 0 rgba(0,0,0,0.35),
        0 8px 22px rgba(2,6,14,0.5);
    width: max-content;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.ds4-cta svg { width: 14px; height: 14px; color: var(--ds4-accent-2); }
.ds4-cta:hover {
    transform: translateY(-2px);
    border-color: var(--ds4-accent);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.22),
        inset 0 -1px 0 rgba(0,0,0,0.35),
        0 14px 30px rgba(2,6,14,0.55);
}

/* =================================================================
   RIGHT · INTERACTIVE PANEL
   ================================================================= */
.ds4-right {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(10px, 1.2vw, 16px);
    min-width: 0;
}

/* Tabs column */
.ds4-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: clamp(8px, 1vw, 10px);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #0c1c3a 0%, #122a52 50%, #081530 100%);
    border: 1px solid var(--ds4-line);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.4);
    overflow: hidden;
}

.ds4-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.9vw, 10px);
    padding: clamp(7px, 1vw, 10px) clamp(8px, 1.1vw, 12px);
    border-radius: 11px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ds4-ink-2);
    font-family: inherit;
    font-size: clamp(0.66rem, 0.88vw, 0.8rem);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 0;
}
.ds4-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(22px, 2.4vw, 28px);
    height: clamp(22px, 2.4vw, 28px);
    flex-shrink: 0;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #1a2c4e 0%, #25406b 100%);
    border: 1px solid var(--ds4-line-strong);
    color: var(--ds4-accent-2);
    transition: all 0.3s ease;
}
.ds4-tab-icon svg { width: 60%; height: 60%; }
.ds4-tab-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.005em;
}
.ds4-tab-arrow {
    opacity: 0;
    transform: translateX(-6px);
    color: var(--ds4-accent-2);
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.ds4-tab:hover {
    color: var(--ds4-ink);
    background: rgba(255,255,255,0.03);
    border-color: var(--ds4-line);
}
.ds4-tab:hover .ds4-tab-icon { border-color: var(--ds4-rim); }

.ds4-tab.is-active {
    color: var(--ds4-ink);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #16294d 0%, #1d3868 50%, #0e1f3e 100%);
    border-color: var(--ds4-line-strong);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.14),
        inset 0 -1px 0 rgba(0,0,0,0.4),
        0 6px 18px -8px rgba(2,6,14,0.7);
}
.ds4-tab.is-active::before {
    content: "";
    position: absolute;
    left: 0; top: 18%; bottom: 18%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #b9d0ff 0%, #6ea8ff 50%, #4a86e8 100%);
    box-shadow: 0 0 10px rgba(110,168,255,0.55);
}
.ds4-tab.is-active .ds4-tab-icon {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #25406b 0%, #2a4a83 100%);
    border-color: var(--ds4-accent);
    color: #ffffff;
}
.ds4-tab.is-active .ds4-tab-arrow {
    opacity: 1;
    transform: translateX(0);
}

.ds4-tab:focus-visible {
    outline: 2px solid var(--ds4-accent);
    outline-offset: 2px;
}

/* Panel column */
.ds4-panel {
    position: relative;
    padding: clamp(12px, 1.6vw, 18px);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #16294d 0%, #1d3868 50%, #0e1f3e 100%);
    border: 1px solid var(--ds4-line-strong);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.14),
        inset 0 -1px 0 rgba(0,0,0,0.45),
        0 16px 36px -16px rgba(2,6,14,0.7);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 12px);
    min-width: 0;
    overflow: hidden;
}
.ds4-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

.ds4-panel.is-fading { opacity: 0; transform: translateY(6px); }
.ds4-panel {
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.ds4-panel-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ds4-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(110,168,255,0.18) 0%, rgba(74,134,232,0.12) 100%);
    border: 1px solid rgba(110,168,255,0.32);
    color: var(--ds4-accent-2);
    font-size: clamp(0.55rem, 0.74vw, 0.66rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    width: max-content;
}
.ds4-panel-title {
    margin: 0;
    font-size: clamp(0.9rem, 1.6vw, 1.2rem);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -0.02em;
    color: var(--ds4-ink);
}
.ds4-panel-desc {
    margin: 0;
    font-size: clamp(0.68rem, 0.95vw, 0.82rem);
    line-height: 1.55;
    color: var(--ds4-ink-2);
    font-weight: 400;
}

/* KPIs */
.ds4-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(6px, 0.8vw, 10px);
}
.ds4-kpi {
    padding: clamp(8px, 1.1vw, 12px) clamp(8px, 1vw, 11px);
    border-radius: 11px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, #0e1f3e 0%, #112a52 100%);
    border: 1px solid var(--ds4-line);
    text-align: left;
    min-width: 0;
}
.ds4-kpi-val {
    font-size: clamp(0.95rem, 1.6vw, 1.25rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, #c9d4ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}
.ds4-kpi-lbl {
    font-size: clamp(0.55rem, 0.74vw, 0.66rem);
    color: var(--ds4-ink-3);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

/* Bullets */
.ds4-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ds4-bullets li {
    position: relative;
    padding-left: 18px;
    font-size: clamp(0.64rem, 0.86vw, 0.76rem);
    color: var(--ds4-ink-2);
    font-weight: 500;
    line-height: 1.4;
}
.ds4-bullets li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.5em;
    width: 10px; height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #6ea8ff, #b9d0ff);
    box-shadow: 0 0 6px rgba(110,168,255,0.6);
}

/* ---------- 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) {
    .ds4-industry {
        max-width: 1024px;
        width: calc(100% - 40px);
        margin: 48px auto;
    }
    .ds4-container { padding: 3% 3.5%; gap: 20px; }
    .ds4-right { grid-template-columns: 0.9fr 1.1fr; }
}

/* Tablet — keep 16:9 but stack tabs horizontally inside right panel */
@media (max-width: 960px) {
    .ds4-industry {
        max-width: 100%;
        width: calc(100% - 32px);
        margin: 36px auto;
    }
    .ds4-aspect { border-radius: 22px; }
    .ds4-container {
        padding: 3% 3.2%;
        grid-template-columns: 1fr 1.25fr;
        gap: 16px;
    }
    .ds4-right { grid-template-columns: 1fr; gap: 10px; }
    .ds4-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
    }
    .ds4-tab {
        flex: 1 1 calc(33.333% - 6px);
        min-width: 0;
        padding: 7px 8px;
    }
    .ds4-tab-arrow { display: none; }
    .ds4-panel { padding: 12px; }
}

/* Mobile — release 16:9 */
@media (max-width: 720px) {
    .ds4-industry {
        width: calc(100% - 24px);
        margin: 24px auto;
    }
    .ds4-aspect {
        aspect-ratio: auto;
        border-radius: 18px;
        min-height: 0;
    }
    .ds4-container {
        position: relative;
        inset: auto;
        padding: 26px 18px;
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .ds4-left { gap: 12px; }
    .ds4-title { font-size: clamp(1.3rem, 6vw, 1.7rem); }
    .ds4-tagline { font-size: 0.82rem; max-width: 100%; }
    .ds4-meta-row { padding: 10px 12px; }
    .ds4-meta-k { font-size: 1rem; }
    .ds4-meta-l { font-size: 0.58rem; }
    .ds4-meta-divider { height: 18px; }

    .ds4-right { gap: 12px; }
    .ds4-tabs {
        flex-direction: column;
        padding: 8px;
        gap: 4px;
    }
    .ds4-tab {
        flex: 1 1 100%;
        padding: 10px 10px;
        font-size: 0.78rem;
    }
    .ds4-tab-icon { width: 26px; height: 26px; }
    .ds4-tab-arrow { display: inline-flex; }

    .ds4-panel { padding: 14px; gap: 10px; }
    .ds4-panel-title { font-size: 1rem; }
    .ds4-panel-desc { font-size: 0.78rem; line-height: 1.55; }
    .ds4-kpis { gap: 6px; }
    .ds4-kpi { padding: 10px 9px; }
    .ds4-kpi-val { font-size: 1.05rem; }
    .ds4-kpi-lbl { font-size: 0.58rem; }
    .ds4-bullets li { font-size: 0.72rem; padding-left: 16px; }
    .ds4-cta { font-size: 0.78rem; padding: 9px 16px; }
}

/* Small mobile */
@media (max-width: 420px) {
    .ds4-industry {
        width: calc(100% - 16px);
        margin: 18px auto;
    }
    .ds4-aspect { border-radius: 16px; }
    .ds4-container { padding: 22px 14px; gap: 16px; }
    .ds4-kpis { grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .ds4-kpi { padding: 8px 6px; }
    .ds4-kpi-val { font-size: 0.95rem; }
    .ds4-kpi-lbl { font-size: 0.52rem; line-height: 1.2; }
    .ds4-title { font-size: 1.35rem; }
    .ds4-tagline { font-size: 0.76rem; }
    .ds4-panel-title { font-size: 0.95rem; }
    .ds4-panel-desc { font-size: 0.74rem; }
}

/* Ultra-narrow */
@media (max-width: 340px) {
    .ds4-kpis { grid-template-columns: 1fr; }
    .ds4-meta-row { flex-wrap: wrap; gap: 8px; }
    .ds4-meta-divider { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .ds4-panel { transition: none; }
}
