:root {
    /* Colors */
    --bg-dark: #0f0f13;
    /* Slightly darker gradient for better contrast with neon borders */
    --bg-gradient: linear-gradient(135deg, #05050a 0%, #101a33 50%, #030e1f 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    /* The main neon color for the borders */
    --accent-color: #00d8ff;
    
    /* Text Colors */
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
    
    /* Spacing */
    --card-radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    z-index: -2;
}

.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* --- HEADER & ATOM --- */
header {
    text-align: center;
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.title-section .mega-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
    /* More vibrant gradient */
    background: linear-gradient(90deg, #00d8ff, #ffffff, #ff00de, #00d8ff);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Combined animations: Shine + Pulse/Glow */
    animation: shine 3s linear infinite, glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes shine {
    to { background-position: 300% center; }
}

@keyframes glow-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(0, 216, 255, 0.6));
    }
    100% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px rgba(255, 0, 222, 0.8));
    }
}

.subtitle {
    color: #ffffff; /* Changed to white for better visibility */
    font-size: 1.2rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 10px;
    
    /* Animation */
    opacity: 0;
    animation: subtitleEntry 1.5s ease-out forwards;
    animation-delay: 0.5s;
    
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(0, 216, 255, 0.3);
}

@keyframes subtitleEntry {
    0% {
        opacity: 0;
        transform: translateY(20px);
        letter-spacing: 10px;
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 6px;
        filter: blur(0);
    }
}

/* Atom Animation */
.atom-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
}

.atom {
    position: relative;
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.atom::before {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 25px var(--accent-color);
}

[class^="electron"] {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(0, 216, 255, 0.4);
    animation: spin 3s linear infinite;
}

.electron-alpha { animation: spin 4s linear infinite; transform: rotate(60deg); }
.electron-omega { animation: spin 5s linear infinite; transform: rotate(120deg); }

@keyframes spin {
    from { transform: rotate(0deg) rotateX(70deg); }
    to { transform: rotate(360deg) rotateX(70deg); }
}

/* --- SOCIAL PILLS --- */
.social-box {
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    padding: 2px; /* Border thickness */
    z-index: 1;
}

.social-box::before {
    content: '';
    position: absolute;
    z-index: -2;
    left: -50%;
    top: -50%;
    width: 200%;
    height: 200%;
    background-repeat: no-repeat;
    background-size: 50% 50%, 50% 50%;
    background-position: 0 0, 100% 0, 100% 100%, 0 100%;
    background-image: conic-gradient(transparent, var(--accent-color), transparent 30%);
    animation: border-rotate 4s linear infinite;
}

.social-box::after {
    content: '';
    position: absolute;
    z-index: -1;
    left: 2px;
    top: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    background: #13131d;
    border-radius: calc(var(--card-radius) - 2px);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

.social-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1.5rem; /* Space for hover effects inside the box */
}

.social-pill {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.social-pill:hover {
    background: white;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 216, 255, 0.3);
}

.social-pill.github:hover { color: #333; }
.social-pill.youtube:hover { color: #ff0000; }
.social-pill.facebook:hover { color: #1877f2; }
.social-pill.wifi:hover { color: #0077b5; }
.social-pill.gmail:hover { color: #ea4335; }
.social-pill.erp:hover { color: #2ecc71; }

/* --- APPS GRID & ANIMATED BORDER (MAJOR CHANGES HERE) --- */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem; /* Increased gap slightly for the glow */
    width: 100%;
    padding: 1rem; /* Padding so glow doesn't get cut off */
}

.app-card {
    position: relative;
    border-radius: var(--card-radius);
    /* Removed the old border and background */
    /* border: 1px solid var(--glass-border); */
    /* background: var(--glass-bg); */
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden; /* Important to keep the spinning border contained */
    z-index: 1; /* Needed for layering pseudo-elements */
}

/* The Spinning Neon Layer (behind the card) */
.app-card::before {
    content: '';
    position: absolute;
    z-index: -2;
    left: -50%;
    top: -50%;
    width: 200%;
    height: 200%;
    background-repeat: no-repeat;
    background-size: 50% 50%, 50% 50%;
    background-position: 0 0, 100% 0, 100% 100%, 0 100%;
    /* The colorful gradient that spins */
    background-image: conic-gradient(transparent, var(--accent-color), transparent 30%);
    animation: border-rotate 4s linear infinite;
}

/* The inner dark layer so text is readable */
.app-card::after {
    content: '';
    position: absolute;
    z-index: -1;
    /* This defines the border thickness (2px here) */
    left: 2px;
    top: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    background: #13131d; /* Dark inner background */
    border-radius: calc(var(--card-radius) - 2px);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

/* The animation for the border spin */
@keyframes border-rotate {
    100% {
        transform: rotate(1turn);
    }
}

/* Ensure content sits on top */
.app-card .icon-box,
.app-card .app-info {
    position: relative;
    z-index: 2;
}

/* Hover effects */
.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 216, 255, 0.2);
}

/* Make the neon spin faster on hover for extra effect */
.app-card:hover::before {
    animation: border-rotate 1.5s linear infinite;
}


.icon-box {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    transition: transform 0.3s ease;
    /* Add a glow to the icons too */
    filter: drop-shadow(0 0 8px currentColor);
}

.app-card:hover .icon-box {
    transform: scale(1.15) rotate(5deg);
}

.app-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-name {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.app-url {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
}

/* --- FOOTER --- */
footer {
    margin-top: 3rem;
    text-align: center;
}

footer a {
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s;
    letter-spacing: 1px;
}

footer a:hover {
    color: var(--accent-color);
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 600px) {
    .title-section .mega-title {
        font-size: 2.5rem;
    }
    
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .app-card {
        padding: 1rem 0.5rem;
    }
    
    .icon-box {
        font-size: 1.8rem;
    }
}