/* Layout and Grid Background */

/* Body with grid background */
body {
    position: relative;
    overflow-x: hidden;
}

/* Grid background effect */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: var(--grid-height);
    background-image:
        linear-gradient(to bottom, rgba(52, 189, 255, 0) 0%, var(--grid-color) 100%),
        linear-gradient(to right, var(--grid-line-color) 2px, transparent 2px),
        linear-gradient(to bottom, var(--grid-line-color) 3px, transparent 3px);
    background-size:
        100% 100%,
        var(--grid-size) 100%,
        100% var(--grid-size);
    transform: perspective(var(--grid-perspective)) rotateX(var(--grid-rotation));
    transform-origin: bottom;
    z-index: 0;
    pointer-events: none;
    animation: gridMove var(--grid-animation-duration) linear infinite;
    opacity: 0.8;
}

/* Grid animation */
@keyframes gridMove {
    0% {
        background-position:
            0 0,
            0 0,
            0 0;
    }
    100% {
        background-position:
            0 0,
            0 100%,
            0 100%;
    }
}

/* Ensure sections are above the grid */
section {
    position: relative;
    z-index: 1;
}

p {
    margin-bottom: 24px;
}

/* Link Styles */
a {
    color: var(--color-blue);
    text-decoration: none;
    position: relative;
    font-weight: 500;
    transition: all var(--transition-base);
    cursor: pointer;
}

/* Gradient underline effect */
a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width var(--transition-base);
}

a:hover {
    color: var(--color-purple);
    text-shadow: 0 0 8px rgba(172, 113, 255, 0.5);
}

a:hover::after {
    width: 100%;
}

a:active {
    color: var(--color-gold);
}

/* External link indicator */
a[target='_blank']::before {
    content: '↗';
    display: inline-block;
    margin-right: 4px;
    font-size: 0.85em;
    opacity: 0.7;
    transition: all var(--transition-base);
}

a[target='_blank']:hover::before {
    opacity: 1;
    transform: translateX(2px) translateY(-2px);
}

/* Visited links with subtle color change */
a:visited {
    color: rgba(52, 189, 255, 0.8);
}

a:visited:hover {
    color: var(--color-purple);
}

/* Focus styles for accessibility */
a:focus {
    outline: 2px solid var(--color-blue);
    outline-offset: 4px;
    border-radius: 2px;
}

a:focus:not(:focus-visible) {
    outline: none;
}

/* Optional: Link with background highlight effect */
a.link-highlight {
    padding: 2px 6px;
    background: rgba(52, 189, 255, 0.1);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

a.link-highlight:hover {
    background: rgba(52, 189, 255, 0.2);
    transform: translateY(-1px);
}

/* Container utility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Responsive container padding */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
}
