/* Import Components */
@import '../components/cards/portal-card.css';
@import '../components/buttons/portal-btn.css';

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 13px;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(to bottom, 
        #F5EDE4 0%, 
        #F5EDE4 50%, 
        #E8DDD0 50%, 
        #E8DDD0 100%);
    color: #333;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Banner Background Image - Top half only */
body {
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    inset: 0 0 50% 0; /* shorthand alternative if desired */
    height: 50%;
    background: url('../images/banner_image.svg') no-repeat right center;
    background-size: auto 200%;
    opacity: 1;

    /* Gradient mask */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 30%, black 80%);
    mask-image: linear-gradient(to right, transparent 0%, transparent 30%, black 80%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;

    z-index: 0;
    pointer-events: none;
}

/* Ensure content stays above background */
body > * {
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    padding: 1.5rem 2rem;
}

.logo {
    height: 2.5rem;
    width: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    padding: 2rem;
    padding-bottom: 10vh;
}

/* Hero Section */
.hero {
    text-align: left;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 62.5rem;
    padding: 0 1rem;
}

.hero-title {
    font-family: 'STIX Two Math', serif;
    font-size: clamp(2.4rem, 5.6vw, 4.5rem);
    font-weight: 400;
    color: #2D2D2D;
    letter-spacing: -0.0625rem;
    line-height: 1.1;
}

.hero-title em {
    font-style: italic;
    font-weight: 400;
}

/* Portal Cards Container */
.portals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 2rem;
    max-width: 62.5rem;
    width: 100%;
    padding: 0 1rem;
}

/* Button styles moved to components/buttons/portal-btn.css */

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 0.85rem;
}

/* Responsive Scaling System */

/* Large screens (e.g. 4K) - Scale up */
@media (min-width: 2000px) {
    html {
        font-size: 20px;
    }
}

/* Standard Laptops / Short Screens - Scale down */
@media (max-width: 1366px), (max-height: 800px) {
    html {
        font-size: 12px; 
    }
}

/* Landscape Tablets / Small Laptops */
@media (max-width: 1024px) {
    .main-content {
        padding-bottom: 6vh;
    }

    body::before {
        background-position: 85% 45%;
        background-size: auto 180%;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 20%, black 75%);
        mask-image: linear-gradient(to right, transparent 0%, transparent 20%, black 75%);
    }
}

/* Tablets */
@media (max-width: 768px) {
    html {
        font-size: 14px; /* Bump up for readability on touch */
    }

    .header {
        padding: 1.25rem 1.5rem;
    }

    .hero {
        text-align: center;
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }

    .portals {
        grid-template-columns: 1fr;
        max-width: 32rem;
        gap: 1.5rem;
    }

    body::before {
        background-position: 80% 25%;
        background-size: auto 150%;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 10%, black 65%);
        mask-image: linear-gradient(to right, transparent 0%, transparent 10%, black 65%);
    }
}

/* Mobile */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .header {
        padding: 1rem 1.25rem;
        display: flex;
        justify-content: center;
    }

    .logo {
        height: 2.1rem;
    }
    
    .main-content {
        padding: 1rem 1.25rem;
        padding-bottom: 3rem;
    }

    .hero {
        margin-bottom: 1.5rem;
    }

    .portals {
        max-width: 20rem;
        padding: 0;
        gap: 1.25rem;
    }

    .footer {
        padding: 1.5rem 1rem 2rem;
    }

    body::before {
        height: 52vh;
        background-position: 70% 35%;
        background-size: auto 170%;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 0%, black 60%);
        mask-image: linear-gradient(to right, transparent 0%, transparent 0%, black 60%);
    }
}

/* Vertical / Portrait Screens */
@media (orientation: portrait) {
    .main-content {
        justify-content: center;
        padding-bottom: 2rem;
    }

    body::before {
        inset: 0 0 auto 0;
        height: 52vh;
        background-position: 70% 35%;
        background-size: auto 170%;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 0%, black 60%);
        mask-image: linear-gradient(to right, transparent 0%, transparent 0%, black 60%);
    }
}
