:root {
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    
    /* Core Color Palette */
    --color-bg-primary: #f8f9fc;
    --color-bg-secondary: #e8eaf6;
    --color-bg-overlay: rgba(103, 58, 183, 0.85);
    
    --color-text-primary: #37474f;
    --color-text-light: #ffffff;
    --color-text-disabled: rgba(255, 255, 255, 0.3);
    
    /* Accent Colors */
    --color-accent-purple: #7c4dff;
    --color-accent-pink: #f48fb1;
    --color-accent-teal: #4db6ac;
    --color-accent-cyan: #4fc3f7;
    
    /* Link States */
    --color-link: var(--color-accent-cyan);
    --color-link-active: var(--color-accent-pink);
    --color-link-visited: var(--color-accent-teal);
    
    --color-border-light: #e1bee7;
    
    /* Shadow System */
    --color-shadow-light: rgba(124, 77, 255, 0.15);
    --color-shadow-medium: rgba(103, 58, 183, 0.3);
    --color-shadow-dark: rgba(49, 27, 146, 0.5);
    
    /* Glow Effects */
    --color-glow-cyan: rgba(79, 195, 247, 0.6);
}

body {
    margin: 0;
    padding: 1.4rem;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    min-height: 100vh;
}

a {
    color: var(--color-link);
    text-decoration: underline;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-text-light);
    text-shadow: 0 0 0.6rem var(--color-glow-cyan);
}

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

a:visited {
    color: var(--color-link-visited);
}

em {
    font-style: italic;
    font-weight: 100;
}

h1 {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin: 0 auto 2rem;
    max-width: 85.7rem;
    position: relative;

    span {
        z-index: 2;
    }
}

p {
    margin: 0 0 1.1rem 0;
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-size: 1.15rem;
    font-weight: 700;
}

img-wrapper {
    width: 100%;
    max-width: 21.4rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, 21.4rem);
    gap: 1.4rem;
    max-width: 85.7rem;
    margin: 0 auto;
    justify-content: center;
}

.grid-container .grid-title {
    grid-column: 1 / -1;
    margin: 2.1rem 0 1.4rem 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: center;
}

/* Glitch artifact styles */
.glitch-artifact {
    position: fixed;
    top: var(--artifact-y, 0px);
    left: var(--artifact-x, 0px);
    width: var(--artifact-width, 20px);
    height: var(--artifact-height, 20px);
    background-image: var(--artifact-bg-image);
    background-size: 300px 300px;
    background-repeat: no-repeat;
    background-position: var(--artifact-bg-x, 0px) var(--artifact-bg-y, 0px);
    opacity: var(--artifact-opacity, 0);
    z-index: 10;
    transition: none;
    mix-blend-mode: difference;
    filter: hue-rotate(var(--artifact-hue, 0deg)) saturate(5) contrast(3) invert(var(--artifact-invert, 0)) blur(var(--artifact-blur, 0px));
    transform: scale(var(--artifact-scale, 1)) rotate(var(--artifact-rotate, 0deg)) skew(var(--artifact-skewX, 0deg), var(--artifact-skewY, 0deg));
    pointer-events: none;
    animation: glitch-artifact-flicker 400ms infinite alternate;
    overflow: visible;
    box-shadow: var(--artifact-shadow, none);
}

@keyframes glitch-artifact-flicker {
    0% { opacity: var(--artifact-opacity, 0); }
    50% { opacity: calc(var(--artifact-opacity, 0) * 0.3); }
    100% { opacity: var(--artifact-opacity, 0); }
}