/* Scroll Reveal Logic */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhancing the vertical line */
.border-start {
    transition: height 1.5s ease-in-out;
}


/* The initial state: hidden, slightly scaled, and clipped */
.reveal-item {
    opacity: 0;
    transform: scale(0.95) translateY(30px);
    clip-path: inset(100% 0 0 0);
    /* Hidden from the bottom up */
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    /* Ultra-smooth 'Out-Quart' curve */
    will-change: transform, opacity, clip-path;
}

/* The active state: fully visible, original size, and unclipped */
.reveal-item.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    clip-path: inset(0 0 0 0);
    /* The 'curtain' opens */
}

/* Staggered Delay Logic for the Grid */
.reveal-item:nth-child(2) {
    transition-delay: 0.1s;
}

.reveal-item:nth-child(3) {
    transition-delay: 0.2s;
}

.reveal-item:nth-child(4) {
    transition-delay: 0.3s;
}

.reveal-item:nth-child(5) {
    transition-delay: 0.4s;
}

.alpha-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 3rem;
    height: 100%;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.alpha-card:hover {
    border-color: #000;
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.phase-tag {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 5px 12px;
    background: #000;
    color: #fff;
}

.card-number {
    position: absolute;
    bottom: -20px;
    right: -10px;
    font-size: 8rem;
    font-weight: 900;
    opacity: 0.03;
}

/* ===== The Scaling Legacy — Redesigned Section ===== */
.scaling-legacy {
    background: linear-gradient(165deg, #0a0a0a 0%, #111 40%, #0d0d0d 100%);
    color: #fff;
    padding: 5rem 0 6rem;
    position: relative;
    overflow: hidden;
}

.scaling-legacy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.scaling-legacy .legacy-head {
    margin-bottom: 3.5rem;
}

.scaling-legacy .legacy-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 0 0 1rem 0;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scaling-legacy .legacy-title .line2 {
    display: block;
    position: relative;
}

.scaling-legacy .legacy-title .line2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #ffffff, #ffffff);
    border-radius: 2px;
}

.scaling-legacy .legacy-desc {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.65);
    max-width: 32ch;
    line-height: 1.6;
    margin: 0;
}

.legacy-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 991px) {
    .legacy-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .legacy-steps {
        grid-template-columns: 1fr;
    }
}

.legacy-step-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 2rem 1.75rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.legacy-step-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.legacy-step-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #fff;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.legacy-step-card:hover::before {
    opacity: 1;
}

.legacy-step-num {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
}

.legacy-step-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #fff;
    margin: 0 0 0.65rem 0;
    line-height: 1.3;
}

.legacy-step-card p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.55;
    margin: 0;
}

.legacy-step-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 42px;
    height: 42px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
}

.legacy-step-card:hover .legacy-step-badge {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.reveal-legacy {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-legacy.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.reveal-legacy:nth-child(1) {
    transition-delay: 0.05s;
}

.reveal-legacy:nth-child(2) {
    transition-delay: 0.12s;
}

.reveal-legacy:nth-child(3) {
    transition-delay: 0.19s;
}

.reveal-legacy:nth-child(4) {
    transition-delay: 0.26s;
}

.reveal-legacy:nth-child(5) {
    transition-delay: 0.33s;
}

.reveal-legacy:nth-child(6) {
    transition-delay: 0.4s;
}

/* Initial State: The container is clipped (hidden) */
.diagnostic-reveal {
    clip-path: inset(0 100% 0 0);
    /* Clipped from right to left */
    opacity: 0;
    transform: translateX(-20px);
    transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1),
        opacity 0.8s ease,
        transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: clip-path, opacity, transform;
}

/* Active State: The clip-path opens up */
.diagnostic-reveal.active {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: translateX(0);
}

/* Staggered delays specifically for this section */
.diagnostic-reveal:nth-child(1) {
    transition-delay: 0.1s;
}

.diagnostic-reveal:nth-child(2) {
    transition-delay: 0.3s;
}

.diagnostic-reveal:nth-child(3) {
    transition-delay: 0.5s;
}

/* The "Scanning Line" Effect */
.diagnostic-reveal::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.diagnostic-reveal.active::after {
    opacity: 0.5;
    animation: diagScanMove 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes diagScanMove {
    0% {
        right: 100%;
    }

    100% {
        right: 0%;
        opacity: 0;
    }
}

/* Footer Legal Links Hover */
.hover-opacity-100:hover {
    opacity: 1 !important;
    transition: opacity 0.3s ease;
}