/* portal.css */
body,
html {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    background: var(--surface-container-low);
    font-family: 'Lexend', 'Google Sans', sans-serif;
    overflow: hidden;
    /* Prevent scrolling on the body */
}

/* Premium Animated Background */
.portal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--surface-container-low);
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.bg-circle-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -10%;
    right: -10%;
}

.bg-circle-2 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    bottom: -5%;
    left: -5%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-50px, 50px) scale(1.1);
    }
}

.portal-main {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center content vertically */
    padding: clamp(24px, 5vh, 60px);
    /* Restored from old code */
    box-sizing: border-box;
}

.portal-header {
    text-align: center;
    margin-bottom: clamp(12px, 4vh, 20px);
    /* Reduced from old code */
    animation: slideUpFade 0.8s cubic-bezier(0.2, 0, 0, 1);
}

.portal-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.portal-header .brand-logo-tint {
    width: 240px !important;
    /* Reduced from 280px */
    height: 80px !important;
    /* Reduced from 90px */
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

.portal-header p {
    font-size: 1.125rem;
    /* Reduced from 1.25rem */
    color: var(--on-surface-variant);
    margin-top: 16px;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: -0.2px;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    /* Reduced from 24px */
    max-width: 1100px;
    /* Reduced from 1200px */
    width: 100%;
    animation: slideUpFade 0.8s cubic-bezier(0.2, 0, 0, 1) 0.2s both;
}

.role-card {
    background: rgba(var(--surface-rgb), 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-variant);
    border-radius: 32px;
    /* Reduced from 36px */
    padding: clamp(20px, 4vh, 32px);
    /* Reduced from clamp(24px, 4vh, 40px) 32px */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--on-surface);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02);
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.role-card:hover {
    transform: translateY(-8px) scale(1.02);
    /* Adjusted translation */
    border-color: var(--primary);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.08);
}

.role-card:hover::before {
    opacity: 0.03;
}

.role-icon {
    width: 64px;
    /* Reduced from 80px */
    height: 64px;
    /* Reduced from 80px */
    border-radius: 20px;
    /* Reduced from 24px */
    background: var(--surface-container-high);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
    border: 1px solid var(--surface-variant);
}

.role-icon i {
    width: 28px;
    /* Reduced from 32px */
    height: 28px;
    /* Reduced from 32px */
}

.role-card:hover .role-icon {
    transform: scale(1.1) rotate(-8deg);
    /* Restored old rotation */
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 12px 32px rgba(var(--primary-rgb), 0.3);
    border-color: var(--primary);
}

.role-info {
    position: relative;
    z-index: 1;
}

.role-name {
    font-size: 1.2rem;
    /* Reduced from 1.35rem */
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--on-surface);
}

.role-desc {
    font-size: 0.875rem;
    /* Reduced from 0.95rem */
    color: var(--on-surface-variant);
    line-height: 1.6;
    opacity: 0.8;
    max-width: 240px;
}

.portal-credits {
    margin-top: clamp(40px, 5vh, 80px);
    /* Adjusted margin */
    text-align: center;
    color: var(--on-surface-variant);
    font-size: 14px;
    opacity: 0.6;
    animation: fadeIn 1s ease 0.5s both;
}

@media (max-width: 1024px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 680px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 8px;
    }

    .portal-main {
        padding: 40px 16px 60px;
        justify-content: flex-start;
        /* Switch to start for better small screen fit */
        overflow-y: auto;
        /* Allow internal scrolling on mobile if content too long */
    }

    .role-card {
        padding: 24px 16px;
        border-radius: 28px;
        min-height: 160px;
        justify-content: center;
    }

    .role-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
        border-radius: 18px;
    }

    .role-icon i {
        width: 26px;
        height: 26px;
    }

    .role-name {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .role-desc {
        display: none;
    }

    .portal-logo-container {
        margin-bottom: 16px;
    }

    .portal-header .brand-logo-tint {
        width: 220px !important;
        height: 70px !important;
    }

    .portal-header p {
        font-size: 1rem;
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.6;
    }
}

/* Color customizer support */
[data-theme="dark"] .role-card {
    background: rgba(25, 28, 30, 0.6);
}