/* ==========================================================================
   SECTION 3 · DEMAND SENSING — Marketing Content (3-Pillar Cards)
   • Light palette to complement Section 2 (dark navy) and Hero (light)
   • Strict 16:9 desktop frame · responsive frame relaxes < 900px
   • Text colour rules:  blue (--ds3-blue) + black (--ds3-ink) ONLY
   • Fully mobile responsive (360px → 1920px+)
   ========================================================================== */

/* ---------- Scoped tokens (matched to SydAI hero palette) ---------- */
.ds3-section {
    /* Blues */
    --ds3-blue-deep:  #0b1f33;
    --ds3-blue:       #1d3a66;
    --ds3-blue-2:     #0a2e5d;
    --ds3-blue-mid:   #2e5aa6;
    --ds3-blue-soft:  #4a86b8;
    --ds3-blue-tint:  #eaf1fb;
    --ds3-blue-line:  rgba(29, 58, 102, 0.14);

    /* Blacks / ink */
    --ds3-ink:        #0b1220;
    --ds3-ink-2:      #10263d;

    /* Surfaces */
    --ds3-bg:         #f7f9fc;
    --ds3-bg-2:       #eef3fa;
    --ds3-card:       #ffffff;
    --ds3-card-line:  rgba(11, 31, 51, 0.08);

    /* Effects */
    --ds3-shadow-sm:  0 8px 20px rgba(15, 23, 42, 0.06);
    --ds3-shadow:     0 22px 60px rgba(2, 12, 24, 0.10);
    --ds3-shadow-lg:  0 30px 80px rgba(2, 12, 24, 0.16);

    /* Radii */
    --ds3-radius-sm:  14px;
    --ds3-radius:     20px;
    --ds3-radius-lg:  28px;
    --ds3-radius-pill:999px;

    max-width: 1280px;
    width: calc(100% - 48px);
    margin: 64px auto;
    color: var(--ds3-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.ds3-section *,
.ds3-section *::before,
.ds3-section *::after { box-sizing: border-box; }

/* ---------- 16:9 Frame ---------- */
.ds3-aspect {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--ds3-radius-lg);
    background:
        radial-gradient(900px 500px at 90% -10%, rgba(74,134,184,0.10), transparent 60%),
        radial-gradient(800px 460px at -10% 110%, rgba(29,58,102,0.08), transparent 55%),
        linear-gradient(180deg, #f7f9fc 0%, #eaf1fb 100%);
    border: 1px solid var(--ds3-blue-line);
    box-shadow: var(--ds3-shadow);
    overflow: hidden;
    isolation: isolate;
}

/* Subtle top rim */
.ds3-aspect::after {
    content: "";
    position: absolute;
    top: 0; left: 8%; right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(29,58,102,0.30), transparent);
    z-index: 1;
    pointer-events: none;
}

/* Decorative glints */
.ds3-glint {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
    opacity: 0.55;
}
.ds3-glint--a {
    top: -120px; right: -60px;
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(74,134,184,0.35), transparent 65%);
}
.ds3-glint--b {
    bottom: -140px; left: -80px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(29,58,102,0.28), transparent 65%);
}

/* Dot grid */
.ds3-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(29,58,102,0.10) 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.5;
}

/* ---------- Inner container ---------- */
.ds3-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 3.2% 4%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(14px, 1.6vw, 28px);
}

/* ---------- Heading ---------- */
.ds3-heading {
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
    flex: 0 0 auto;
}

.ds3-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--ds3-radius-pill);
    background: linear-gradient(180deg, #ffffff 0%, var(--ds3-blue-tint) 100%);
    border: 1px solid var(--ds3-blue-line);
    box-shadow: var(--ds3-shadow-sm);
    color: var(--ds3-blue);
    font-size: clamp(0.6rem, 0.85vw, 0.72rem);
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.ds3-eyebrow-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #6b9dc6, #1d3a66);
    box-shadow: 0 0 8px rgba(29,58,102,0.45);
}

.ds3-title {
    font-size: clamp(1.15rem, 2.4vw, 2rem);
    line-height: 1.14;
    letter-spacing: -0.03em;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--ds3-ink);
}
.ds3-accent {
    color: var(--ds3-blue);
    background: linear-gradient(135deg, #2e5aa6 0%, #1d3a66 60%, #0a2e5d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
    font-weight: 800;
}

.ds3-tagline {
    margin: 0 auto;
    max-width: 720px;
    font-size: clamp(0.78rem, 1.0vw, 0.95rem);
    line-height: 1.55;
    color: var(--ds3-ink);
    font-weight: 400;
}

/* ---------- 3-Card grid ---------- */
.ds3-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 1.6vw, 22px);
    flex: 1 1 auto;
    min-height: 0;
}

.ds3-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--ds3-card);
    border: 1px solid var(--ds3-card-line);
    border-radius: var(--ds3-radius);
    box-shadow: var(--ds3-shadow-sm);
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.ds3-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ds3-shadow-lg);
    border-color: var(--ds3-blue-line);
}

/* Media */
.ds3-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--ds3-blue-tint);
}
.ds3-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}
.ds3-card:hover .ds3-card-media img {
    transform: scale(1.04);
}
.ds3-card-media::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(11,31,51,0.18) 100%);
    pointer-events: none;
}
.ds3-card-tag {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: var(--ds3-radius-pill);
    background: rgba(255,255,255,0.92);
    color: var(--ds3-blue);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--ds3-blue-line);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Body */
.ds3-card-body {
    padding: clamp(12px, 1.4vw, 20px) clamp(14px, 1.6vw, 22px) clamp(14px, 1.6vw, 22px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
}

.ds3-card-title {
    margin: 0;
    font-size: clamp(0.95rem, 1.25vw, 1.15rem);
    line-height: 1.22;
    font-weight: 800;
    letter-spacing: -0.018em;
    color: var(--ds3-ink);
}
.ds3-card-blue {
    color: var(--ds3-blue);
}

.ds3-card-text {
    margin: 0;
    font-size: clamp(0.72rem, 0.92vw, 0.86rem);
    line-height: 1.5;
    color: var(--ds3-ink);
    font-weight: 400;
}
.ds3-card-text strong {
    color: var(--ds3-blue);
    font-weight: 700;
}
.ds3-card-text em {
    color: var(--ds3-blue);
    font-style: italic;
    font-weight: 500;
}

/* ============================================
   Reveal animation
   ============================================ */
.ds3-section.reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: ds3-fade-in 0.7s ease 0.05s forwards;
}
.ds3-card {
    opacity: 0;
    transform: translateY(10px);
    animation: ds3-fade-in 0.55s ease forwards;
}
.ds3-cards .ds3-card:nth-child(1) { animation-delay: 0.18s; }
.ds3-cards .ds3-card:nth-child(2) { animation-delay: 0.30s; }
.ds3-cards .ds3-card:nth-child(3) { animation-delay: 0.42s; }

@keyframes ds3-fade-in {
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ds3-section.reveal,
    .ds3-card { animation: none; opacity: 1; transform: none; }
    .ds3-card-media img { transition: none; }
}

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

/* Large tablets: keep 16:9 but ease padding */
@media (max-width: 1100px) {
    .ds3-container { padding: 3% 3.4%; }
    .ds3-card-title { font-size: clamp(0.9rem, 1.5vw, 1.05rem); }
    .ds3-card-text { font-size: clamp(0.72rem, 1.1vw, 0.82rem); }
}

/* Tablets: drop aspect-ratio so cards stay legible */
@media (max-width: 900px) {
    .ds3-section {
        margin: 40px auto;
        width: calc(100% - 32px);
    }
    .ds3-aspect {
        aspect-ratio: auto;
        padding: 32px 22px;
        border-radius: 22px;
    }
    .ds3-container {
        position: static;
        padding: 0;
        gap: 28px;
    }
    .ds3-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    .ds3-cards .ds3-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }
    .ds3-card-body { gap: 8px; }
    .ds3-card-title { font-size: 1.05rem; }
    .ds3-card-text { font-size: 0.85rem; line-height: 1.55; }
    .ds3-title { font-size: clamp(1.35rem, 4vw, 1.75rem); }
    .ds3-tagline { font-size: 0.92rem; }
}

/* Mobile: single column stack */
@media (max-width: 600px) {
    .ds3-section {
        margin: 28px auto;
        width: calc(100% - 20px);
    }
    .ds3-aspect {
        padding: 26px 16px;
        border-radius: 20px;
    }
    .ds3-heading { padding: 0 4px; }
    .ds3-eyebrow {
        font-size: 0.62rem;
        padding: 5px 11px;
        margin-bottom: 10px;
    }
    .ds3-title {
        font-size: clamp(1.2rem, 6.4vw, 1.55rem);
        line-height: 1.2;
    }
    .ds3-tagline {
        font-size: 0.88rem;
        line-height: 1.55;
    }
    .ds3-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .ds3-cards .ds3-card:nth-child(3) {
        max-width: 100%;
    }
    .ds3-card { border-radius: 18px; }
    .ds3-card-media { aspect-ratio: 16 / 10; }
    .ds3-card-body {
        padding: 16px 18px 18px;
        gap: 8px;
    }
    .ds3-card-title { font-size: 1.05rem; }
    .ds3-card-text { font-size: 0.88rem; line-height: 1.6; }
    .ds3-card-tag {
        font-size: 0.6rem;
        padding: 4px 9px;
    }
    /* Decorative glints reduce on mobile for perf */
    .ds3-glint { opacity: 0.35; filter: blur(40px); }
}

/* Extra-small phones (< 380px) */
@media (max-width: 380px) {
    .ds3-aspect { padding: 22px 14px; }
    .ds3-title { font-size: 1.25rem; }
    .ds3-card-body { padding: 14px 16px 16px; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .ds3-aspect {
        aspect-ratio: auto;
        box-shadow: none;
        background: #ffffff;
    }
    .ds3-glint, .ds3-grid { display: none; }
    .ds3-card { break-inside: avoid; box-shadow: none; }
}
