html {
    scroll-behavior: smooth;
}
/* Move Explore button to right for first card only */
#MMET .portal-footer {
    display: flex;
    justify-content: flex-end;
}

/* ============================================================
   PREMIUM INSTITUTIONS SECTION - MIDNIGHT AURORA THEME
   ============================================================ */

:root {
    --sapphire-dark: #060912;
    --sapphire-medium: #0f172a;
    --aurora-cyan: #00f2ff;
    --aurora-purple: #7000ff;
    --aurora-silver: #e2e8f0;
    --glass-border: rgba(255, 255, 255, 0.1);
}



.premium-inst-wrapper {
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, var(--sapphire-dark) 70%);
    padding: 40px 0 120px;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    position: relative;
}

/* Floating background ambient light */
.premium-inst-wrapper::before {
    content: '';
    position: absolute;
    top: 20%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: var(--aurora-purple);
    filter: blur(150px);
    opacity: 0.15;
    pointer-events: none;
}
/* --- Support for Mouse-Following Glow --- */
.premium-inst-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* This creates a light that follows your mouse */
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                rgba(0, 242, 255, 0.07), 
                transparent 40%);
    pointer-events: none;
    z-index: 1;
}


.inst-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 25px;
}

/* --- HERO HEADER --- */
.inst-hero-header {
    text-align: center;
    margin-bottom: 72px;
}

.header-glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 60px 40px;
    border-radius: 40px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}

.prestige-tag {
    color: var(--aurora-cyan);
    font-weight: 700;
    letter-spacing: 5px;
    font-size: 16px;
    display: block;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(0, 242, 255, 0.5);
}

.premium-title {
    font-size: calc(clamp(40px, 6vw, 75px) + 2px);
    color:#00f2ff;
    font-weight: 900;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -2px;
}

.premium-divider {
    height: 4px;
    width: 100px;
    background: linear-gradient(90deg, transparent, var(--aurora-cyan), transparent);
    margin: 30px auto;
}

.intro-narrative .lead-text {
    font-size: 28px;
    color: var(--aurora-silver);
    max-width: 800px;
    margin: 0 auto 25px;
    line-height: 1.6;
    font-weight: 600;
}

.text-highlight {
    color: #f3d979;
    font-weight: 700;
    border-bottom: 2px solid rgba(243, 217, 121, 0.9);
}

.sub-text {
    color: rgba(255, 255, 255, 0.7) !important; /* Soft white/gray */
    font-size: calc(1.2rem + 2px);
    line-height: 1.6;
    margin-top: 20px;
    display: block;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
}

/* Adding a gold glow to sub-text if it's meant to be premium */
.premium-sub-text {
    color: #fcf6ba !important; /* Pearl Gold */
    opacity: 0.9;
    font-style: italic;
}

/* --- SCROLL REVEAL --- */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

.portal-item.reveal:nth-child(2) {
    transition-delay: 0.15s;
}

/* --- PORTAL STACK (The Cards) --- */
.portal-stack {
    display: flex;
    flex-direction: column;
    gap: 52px;
}

.portal-item {
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
}

.portal-item:nth-child(even) {
    flex-direction: row-reverse;
}

.portal-item:nth-child(even) .portal-glass-box {
    flex-direction: row-reverse;
}

.portal-media {
    flex: 0 0 350px;
    width: 350px;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

.portal-school-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 18px;
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    background: transparent;
}

.portal-glass-box:hover .portal-school-image {
    transform: scale(1.035);
}

.portal-glass-box {
    flex: 1;
    background: linear-gradient(135deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.04) 100%);
    backdrop-filter: blur(22px) saturate(120%);
    border: 1.5px solid rgba(0,242,255,0.13);
    padding: 54px 54px 54px 54px;
    border-radius: 38px;
    box-shadow: 0 10px 36px 0 rgba(0,0,0,0.38), 0 2px 32px 0 rgba(0,242,255,0.08), 0 1.5px 0 rgba(255,255,255,0.09) inset;
    transition: 
        transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.5s,
        background 0.5s;
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 34px;
    align-items: stretch;
}

.portal-glass-box:hover {
    transform: translateY(-14px) scale(1.025);
    border-color: var(--aurora-cyan);
    box-shadow: 0 24px 64px 0 rgba(0,242,255,0.13), 0 2px 48px 0 rgba(0,242,255,0.18), 0 0 0 2.5px var(--aurora-cyan), 0 1.5px 0 rgba(255,255,255,0.13) inset;
    background: linear-gradient(135deg, rgba(255,255,255,0.16) 0%, rgba(0,242,255,0.04) 100%);
    outline: none;
}

.portal-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    will-change: opacity, transform;
    /* For scroll reveal smoothness */
}

/* Accent for the second card */
.portal-glass-box.accent-gold {
    border-left: 5px solid var(--aurora-purple);
}

.portal-location {
    font-weight: 800;
    font-size: 16px;
    color: var(--aurora-cyan);
    letter-spacing: 3px;
    margin-bottom: 15px;
    display: block;
}

.portal-header {
    margin-bottom: 15px;
}

.inst-name {
    font-size: 38px;
    color: #00f2ff;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1.3;
}

.portal-content p {
    color: #ffffff;
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 500;
}

.portal-footer {
    margin-top: auto;
}

/* --- PREMIUM CTA --- */
.premium-cta {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    color: #000000;
    padding: 16px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 10px 25px rgba(255,255,255,0.1);
}

.premium-cta:hover {
    background: var(--aurora-cyan);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.4);
}

.cta-icon {
    font-size: 22px;
    transition: transform 0.3s ease;
}

.premium-cta:hover .cta-icon {
    transform: translateX(8px);
}

/* RESPONSIVE DESIGN */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .inst-container {
        padding: 0 20px;
    }

    .portal-media {
        flex: 0 0 280px;
        width: 280px;
    }

    .portal-glass-box {
        padding: 40px;
        gap: 25px;
    }

    .inst-name {
        font-size: 34px;
    }

    .portal-content p {
        font-size: 18px;
    }
}

/* --- MOBILE RESPONSIVE LOGIC (992px and below) --- */
@media (max-width: 992px) {
    .inst-hero-header {
        margin-bottom: 36px;
    }

    .portal-stack {
        gap: 24px;
    }

    /* 1. Stack the main containers vertically */
    .portal-item, 
    .portal-item:nth-child(even) {
        flex-direction: column !important;
        padding: 8px 10px;
        gap: 0;
    }

    /* 2. Remove padding from the box so the image can go full-width */
    .portal-glass-box,
    .portal-item:nth-child(even) .portal-glass-box {
        display: flex;
        flex-direction: column;
        padding: 0 !important; 
        overflow: hidden;
        border-radius: 24px;
        width: 100%;
    }

    /* 3. MAGIC: Flatten this div so we can put the Image in the middle of its children */
    .portal-text-content {
        display: contents; 
    }

    /* 4. SET THE ORDER: Title -> Image -> Description -> Button */
    
    .portal-header {
        order: 1; /* Title First */
        padding: 30px 25px 15px;
    }

    .portal-media {
        order: 2; /* Image Second */
        width: 100%;
        height: 250px; /* Adjust height for mobile */
        flex: none;
        border-radius: 0; 
    }

    .portal-school-image {
        object-fit: cover; /* Ensures image fills the width perfectly */
        height: 100%;
        width: 100%;
    }

    .portal-content {
        order: 3; /* Description Third */
        padding: 20px 25px 10px;
    }

    .portal-footer {
        order: 4; /* CTA Last */
        padding: 0 25px 35px;
    }

    /* 5. Adjust Typography for small screens */
    .inst-name {
        font-size: 26px !important;
        line-height: 1.2;
        margin-bottom: 5px;
        color: #ffffff;
    }

    .portal-location {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .portal-content p {
        font-size: 17px;
        line-height: 1.68;
        margin-bottom: 15px;
    }

    .premium-cta {
        width: 100%; /* Make button full width on mobile for better UX */
        justify-content: center;
    }
}

/* --- EXTRA SMALL PHONES (480px and below) --- */
@media (max-width: 480px) {
    .inst-hero-header {
        margin-bottom: 24px;
    }

    .portal-stack {
        gap: 18px;
    }

    .portal-media {
        height: 200px; /* Slightly shorter image for tiny screens */
    }

    .inst-name {
        font-size: 22px !important;
    }
}