/* GLOBAL CSS VARIABLES */
:root {
    --primary-color: #82b704;
    --secondary-color: #35abe5;
    --bg-dark-grey: #2a2a2a;
    --bg-darker-grey: #1f1f1f;
    --text-light: #f8f9fa;
    --text-muted: #adb5bd;
}

/* SMOOTH SCROLLING & SCROLLBAR */
html {
    scroll-behavior: smooth;
}

/* Custom Webkit Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark-grey);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6a9603; /* slightly darker primary */
}
/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-dark-grey);
}

/* BASE STYLES */
body {
    background-color: var(--bg-dark-grey);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden; /* Prevents horizontal scroll from overflowing elements */
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CUSTOM TEXT & BG UTILITIES */
.text-primary-custom { color: var(--primary-color) !important; }
.text-secondary-custom { color: var(--secondary-color) !important; }
.bg-dark-custom { background-color: var(--bg-darker-grey) !important; }

/* HEADER */
.custom-header {
    background-color: var(--bg-darker-grey);
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: fadeIn 0.8s ease-out;
}

/* MAIN BODY LAYOUT */
.main-content {
    flex: 1; /* Pushes footer to bottom */
    display: flex;
    flex-direction: column; /* Ensures flex child stretches fully */
}

.main-content > .row {
    flex: 1; /* Forces row to extend to the very bottom of the main-content wrapper */
}

/* LEFT COLUMN: MOUNTAIN BACKGROUND */
.mountain-col {
    position: relative;
    min-height: 40vh; /* Dynamic height for mobile view */
    animation: fadeIn 1.2s ease-out forwards;
    z-index: 5; /* Elevate so the photo can gracefully overlap the middle gap */
}
.mountain-bg {
    background-image: url('https://cerebro.momus.tech/assets/image/momus-pointing-down.png');
    background-size: contain;
    background-position: center; /* Centered for mobile */
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through if it overlaps the portal cards */
    margin-left: 0; /* Reset margin for mobile to keep it perfectly centered */
}

/* MIDDLE COLUMN: PORTAL LINKS */
.portal-grid-container {
    background-color: var(--bg-dark-grey);
    animation: fadeIn 1s ease-out forwards;
    padding-left: 10% !important;
    padding-right: 10% !important;
}
.portal-card {
    background-color: var(--bg-darker-grey);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease-in-out;
    height: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    
    /* Load Animation setup */
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
    
    /* Hover Fill Animation setup */
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Fill background animation pseudo-element */
.portal-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-color: var(--primary-color);
    opacity: 0;
    z-index: -1;
    transform: rotate(45deg) translateY(100%);
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

.portal-card:hover::before {
    transform: rotate(45deg) translateY(0);
    opacity: 0.15; /* Provides a tinted primary color fill while keeping text readable */
}

/* Staggered load animation for portal cards */
.col-6:nth-child(1) .portal-card { animation-delay: 0.1s; }
.col-6:nth-child(2) .portal-card { animation-delay: 0.2s; }
.col-6:nth-child(3) .portal-card { animation-delay: 0.3s; }
.col-6:nth-child(4) .portal-card { animation-delay: 0.4s; }
.col-6:nth-child(5) .portal-card { animation-delay: 0.5s; }
.col-6:nth-child(6) .portal-card { animation-delay: 0.6s; }

.portal-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 15px rgba(130, 183, 4, 0.15);
}

.portal-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
    /* Added cubic-bezier for a slight bounce effect on the icon */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.portal-card:hover .portal-icon {
    color: var(--primary-color);
    transform: scale(1.25) translateY(-5px); /* Icon scale and float animation */
}

.portal-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease;
}

.portal-card:hover .portal-title {
    color: var(--primary-color);
}

/* RIGHT COLUMN: ABOUT US */
.about-container {
    background-color: var(--bg-darker-grey);
    border-left: 1px solid #3a3a3a;
    
    /* Load Animation */
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}
.about-text {
    color: var(--text-muted);
    line-height: 1.7;
}
.feature-list {
    list-style: none;
    padding: 0;
}
.feature-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}
.feature-list i {
    color: var(--secondary-color);
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Make contact text white based on annotation */
.about-container .border-top .text-muted {
    color: #ffffff !important;
}

/* FOOTER */
.custom-footer {
    background-color: var(--bg-darker-grey);
    border-top: 3px solid var(--secondary-color);
    animation: fadeIn 1s ease-out 0.8s forwards;
}

/* RESPONSIVE ADJUSTMENTS */
@media (min-width: 768px) {
    .mountain-col {
        min-height: 50vh;
    }
}

@media (min-width: 992px) {
    /* Widen center column by another 10% (from 53.333% to 63.333%) 
       and narrow side columns by 5% each (from 23.333% to 18.333%) */
    .mountain-col {
        width: 18.333% !important;
        flex: 0 0 18.333% !important;
    }
    
    .portal-grid-container {
        width: 63.333% !important;
        flex: 0 0 63.333% !important;
    }
    
    .about-container {
        width: 18.333% !important;
        flex: 0 0 18.333% !important;
    }

    /* On Desktop, make the mountain image absolutely fill its column for a true "full height" effect */
    .mountain-bg {
        background-image: url('https://cerebro.momus.tech/assets/image/momus-point-right.png');
        position: absolute;
        top: 0;
        left: 0;
        /* Increase container width dramatically so 'contain' allows it to scale tall and overflow right */
        width: 220%; 
        bottom: 0;
        background-position: left center;
        margin-left: 15%; /* Re-apply left margin on desktop to push the photo right */
    }
}

@media (max-width: 991.98px) {
    .about-container {
        border-left: none;
        border-top: 1px solid #3a3a3a;
    }
}

@media (max-width: 576px) {
    .portal-grid-container {
        /* Restore standard padding on mobile devices for better space utilization */
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    .portal-card {
        padding: 1rem 0.5rem;
    }
    .portal-icon {
        font-size: 2rem;
    }
    .portal-title {
        font-size: 0.9rem;
    }
}