/* Premium Design Improvements */
body {
    background-color: #020617; /* Very dark background */
}

/* Subtle Grid Pattern Background */
.bg-grid-pattern {
    position: relative;
}
.bg-grid-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    z-index: 0;
    pointer-events: none;
}

/* Glass Card / Premium Cards */
.premium-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.premium-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(59, 130, 246, 0.1) inset;
}

/* Hero Section */
.about-hero-bg {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top left, rgba(30, 58, 138, 0.15) 0%, transparent 50%),
                radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
}

.cert-stack-container {
    position: relative;
    height: 400px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.cert-stack-item {
    position: absolute;
    width: 280px;
    height: 380px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.5s ease;
    border: 4px solid #f1f5f9;
}

.cert-stack-item:nth-child(1) { transform: translateZ(-100px) translateX(-30px) translateY(-20px) rotate(-8deg); z-index: 1; }
.cert-stack-item:nth-child(2) { transform: translateZ(-50px) translateX(0) translateY(-10px) rotate(0deg); z-index: 2; }
.cert-stack-item:nth-child(3) { transform: translateZ(0) translateX(30px) translateY(0) rotate(8deg); z-index: 3; }

.cert-stack-container:hover .cert-stack-item:nth-child(1) { transform: translateZ(0) translateX(-140px) translateY(-20px) rotate(-15deg); z-index: 4; }
.cert-stack-container:hover .cert-stack-item:nth-child(2) { transform: translateZ(50px) translateX(0) translateY(-40px) rotate(0deg); z-index: 5; }
.cert-stack-container:hover .cert-stack-item:nth-child(3) { transform: translateZ(0) translateX(140px) translateY(-20px) rotate(15deg); z-index: 4; }

.cert-stack-container:hover .cert-stack-item:nth-child(1):hover { transform: translateZ(100px) translateX(-140px) translateY(-30px) rotate(-10deg) scale(1.05); z-index: 10; cursor: pointer; box-shadow: 0 15px 40px rgba(0,0,0,0.8); }
.cert-stack-container:hover .cert-stack-item:nth-child(2):hover { transform: translateZ(100px) translateX(0) translateY(-50px) rotate(0deg) scale(1.05); z-index: 10; cursor: pointer; box-shadow: 0 15px 40px rgba(0,0,0,0.8); }
.cert-stack-container:hover .cert-stack-item:nth-child(3):hover { transform: translateZ(100px) translateX(140px) translateY(-30px) rotate(10deg) scale(1.05); z-index: 10; cursor: pointer; box-shadow: 0 15px 40px rgba(0,0,0,0.8); }

/* Founder Section */
.founder-img-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    display: inline-block;
}
.founder-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* Enhanced Interactive Timeline (How We Work) */
.how-we-work-timeline {
    position: relative;
    padding-left: 4rem;
}
.how-we-work-timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8), transparent);
}
.hww-step {
    position: relative;
    margin-bottom: 2rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.hww-step:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateX(8px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
.hww-icon-wrapper {
    position: absolute;
    left: -4rem;
    top: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}
.hww-step:hover .hww-icon-wrapper {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
}
.hww-step-number {
    font-size: 1.2rem;
    font-weight: 800;
    color: #3b82f6;
    transition: all 0.3s ease;
}
.hww-step:hover .hww-step-number {
    color: white;
}
.hww-step-title {
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Why Businesses Trust Us (Counters) */
.trust-counter-box {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(15,23,42,0.8), rgba(30,41,59,0.4));
    border: 1px solid rgba(255,255,255,0.05);
}
.trust-counter-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    line-height: 1.2;
}

/* Case Study Showcase */
.case-study-card {
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    transition: transform 0.3s ease;
}
.case-study-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59,130,246,0.2);
}
.case-study-header {
    background: rgba(255,255,255,0.02);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.case-study-body {
    padding: 1.5rem;
    flex-grow: 1;
}

/* Hover Cards (Industries We Help) */
.industry-hover-card {
    background: rgba(15,23,42,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.industry-hover-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #3b82f6;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.industry-hover-card:hover {
    background: rgba(30,41,59,0.8);
    transform: translateY(-4px);
}
.industry-hover-card:hover::after {
    transform: scaleX(1);
}

/* Checklist (Why Companies Choose) */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
    transition: background 0.3s ease;
}
.checklist-item:hover {
    background: rgba(255,255,255,0.05);
}

/* Impact Bars */
.impact-bar-wrap {
    margin-bottom: 1.5rem;
}
.impact-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #cbd5e1;
}
.impact-bar-bg {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}
.impact-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #3b82f6, #60a5fa);
    border-radius: 4px;
    width: 0; /* Animated via JS or inline style */
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Journey Timeline */
.journey-container {
    display: flex;
    flex-wrap: wrap;
    position: relative;
}
.journey-container::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.1);
    z-index: 0;
}
.journey-node {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 120px;
    padding: 0 10px;
}
.journey-dot {
    width: 16px;
    height: 16px;
    background: #0f172a;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    margin: 17px auto 1rem;
    transition: all 0.3s ease;
}
.journey-node:hover .journey-dot {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59,130,246,0.5);
}
.journey-year {
    font-weight: 700;
    color: #60a5fa;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
    /* Base Section */
    .section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Hero Section */
    .about-hero-bg {
        padding-top: 7rem !important; /* Push below navbar */
        padding-bottom: 2rem !important;
    }
    .about-hero-bg .display-5 {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    .about-hero-bg p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        margin-bottom: 2rem !important;
    }
    .about-hero-bg .display-6 {
        font-size: 1.5rem !important;
    }
    .cert-stack-container {
        height: 200px !important;
        transform: scale(0.55);
        transform-origin: top center;
        margin-top: 2.5rem !important;
    }

    /* Uniform Section Titles for Mobile */
    h2, h2.fw-bold, .section h2, .section h2.fw-bold, .section .text-center h2.fw-bold, h2[style], .section h2[style] {
        font-size: clamp(1rem, 5vw, 1.25rem) !important;
        white-space: nowrap !important;
        letter-spacing: -0.5px !important;
        margin-bottom: 1rem !important;
    }
    .section .text-center p.text-slate-400 {
        font-size: 0.85rem !important;
    }

    /* Premium Cards (Why RunEthics Exists, etc) */
    .premium-card {
        padding: 1.25rem 1rem !important;
    }
    .premium-card .d-flex.align-items-center.gap-3.mb-4 {
        margin-bottom: 1rem !important;
        gap: 0.75rem !important;
    }
    .premium-card .d-flex.align-items-center.gap-3.mb-4 div {
        padding: 0.6rem !important; /* Shrunk icon background circle */
    }
    .premium-card .d-flex.align-items-center.gap-3.mb-4 svg {
        width: 18px !important;
        height: 18px !important;
    }
    .premium-card h3 {
        font-size: 1.15rem !important;
    }
    .premium-card p, .premium-card p[style] {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }
    .premium-card ul {
        gap: 0.5rem !important;
        margin-top: 0.5rem !important;
    }
    .premium-card ul li {
        font-size: 0.85rem !important;
        gap: 0.5rem !important;
        line-height: 1.3 !important;
    }
    .premium-card ul li svg {
        width: 14px !important;
        height: 14px !important;
        margin-top: 1px !important;
    }

    /* The Story Behind RunEthics Section */
    .story-section-row .col-lg-7 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .story-section-row h2[style] {
        /* Handled by Uniform Section Titles */
        margin-bottom: 1.5rem !important;
    }
    .story-section-row p[style] {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }
    .story-founders .premium-card {
        padding: 1.5rem !important;
    }
    .story-founders .d-flex.align-items-center.gap-4 {
        gap: 1rem !important;
    }
    .story-founders h4[style] {
        font-size: 1.25rem !important;
    }
    .story-founders p[style] {
        font-size: 0.7rem !important;
    }
    .story-founders div[style*="padding:1.2rem"] {
        padding: 0.8rem !important;
    }
    .story-founders svg {
        width: 20px !important;
        height: 20px !important;
    }

    /* How We Work Timeline */
    .how-we-work-timeline {
        padding-left: 2.5rem !important;
    }
    .how-we-work-timeline::before {
        left: 12px !important;
    }
    .hww-step {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    .hww-icon-wrapper {
        left: -2.5rem !important;
        top: 1rem !important;
        width: 30px !important;
        height: 30px !important;
    }
    .hww-step-number {
        font-size: 0.9rem !important;
    }
    .hww-icon-wrapper svg {
        width: 14px !important;
        height: 14px !important;
    }
    .hww-step-title, .hww-step-title[style] {
        font-size: 0.95rem !important;
        margin-bottom: 0.25rem !important;
    }
    .hww-step p {
        font-size: 0.75rem !important;
        margin-bottom: 0 !important;
        line-height: 1.4 !important;
    }
    /* Adjust timeline line to match new icon wrapper left position */
    .how-we-work-timeline {
        padding-left: 2rem !important;
    }
    .how-we-work-timeline::before {
        left: 8px !important;
    }

    /* Trust Counters */
    .trust-counter-box {
        padding: 1rem !important;
    }
    .trust-counter-number {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
    .trust-counter-box div {
        font-size: 0.8rem !important;
    }

    /* Case Study Showcase */
    .case-study-header {
        padding: 1rem !important;
    }
    .case-study-header svg {
        width: 20px !important;
        height: 20px !important;
    }
    .case-study-header span.fw-bold {
        font-size: 0.95rem !important;
    }
    .case-study-body {
        padding: 1rem !important;
    }
    .case-study-body span.text-sm {
        font-size: 0.75rem !important;
    }
    .case-study-body h5 {
        font-size: 1.1rem !important;
        margin-bottom: 0.25rem !important;
    }
    .case-study-body p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
    .case-study-body .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    /* Industry Hover Cards */
    .industry-hover-card {
        padding: 1rem 0.5rem !important;
    }
    .industry-hover-card svg {
        width: 20px !important;
        height: 20px !important;
        margin-bottom: 0.5rem !important;
    }
    .industry-hover-card h6 {
        font-size: 0.85rem !important;
    }
    .industry-hover-card p {
        font-size: 0.75rem !important;
    }

    /* Checklist Items */
    .checklist-item {
        padding: 0.75rem !important;
        gap: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    .checklist-item svg {
        min-width: 18px !important;
        width: 18px !important;
        height: 18px !important;
        margin-top: 2px !important;
    }
    .checklist-item h6 {
        font-size: 0.95rem !important;
        margin-bottom: 0.25rem !important;
    }
    .checklist-item p {
        font-size: 0.75rem !important;
        margin-bottom: 0 !important;
        line-height: 1.4 !important;
    }

    /* Journey Timeline */
    .journey-container {
        flex-direction: column;
    }
    .journey-container::before {
        top: 0;
        bottom: 0;
        left: 24px;
        width: 2px;
        height: auto;
    }
    .journey-node {
        text-align: left;
        padding-left: 50px;
        margin-bottom: 2rem;
    }
    .journey-dot {
        position: absolute;
        left: 17px;
        top: -10px;
        margin: 0;
    }
    .journey-year {
        font-size: 1.15rem !important;
    }
    .journey-node p {
        font-size: 0.85rem !important;
    }
    .mobile-single-line {
        font-size: clamp(1rem, 5vw, 1.25rem) !important;
        white-space: nowrap !important;
        letter-spacing: -0.5px !important;
    }

    /* The Impact We Create */
    .col-lg-6.fade-in-up > p.text-slate-400.mb-4 {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.5rem !important;
    }
    .impact-bar-wrap {
        margin-bottom: 1rem !important;
    }
    .impact-bar-label {
        font-size: 0.8rem !important;
        margin-bottom: 0.25rem !important;
    }
    .impact-bar-bg {
        height: 6px !important;
    }
}
