:root {
    --bg: #24273a;
    --fg: #cad3f5;
    --link: #8aadf4;
    --link-hover: #b7bdf8;
    --accent: #c6a0f6;
}
[data-theme="light"] {
    --bg: #eff1f5;
    --fg: #4c4f69;
    --link: #1e66f5;
    --link-hover: #7287fd;
    --accent: #8839ef;
}

/* Grain texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.07;
    pointer-events: none;
    z-index: 9999;
}

/* Selection color */
::selection {
    background: var(--accent);
    color: var(--bg);
}

/* Custom cursor */
html, *, *::before, *::after {
    cursor: url('/img/cursor.png?v=7') 10 10, auto !important;
}

html {
    min-height: 100%;
    background: var(--bg);
    transition: background 0.2s;
}

body {
    font-family: 'Iosevka Term Web', monospace;
    color: var(--fg);
    padding: 20px;
    line-height: 1.6;
    transition: color 0.2s;
    max-width: 600px;
    margin: 0;
}

/* Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideInMuted {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 0.6;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Links */
a {
    color: var(--link);
    text-decoration: none;
    display: inline-block;
    padding: 2px 0;
    transition: color 0.2s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    transform: translateY(-2px);
}

a:active {
    transform: scale(0.98);
}

h1 {
    font-size: 1em;
    font-weight: normal;
    font-style: italic;
    margin: 0 0 20px 0;
    opacity: 0;
    animation: fadeSlideIn 0.5s ease-out forwards;
}

h1 a {
    font-family: 'Iosevka Term Web', monospace;
    font-style: italic;
    color: var(--fg);
}

h1 a:hover {
    color: var(--fg);
}

/* Footer */
.footer {
    margin-top: 30px;
    opacity: 0;
    font-size: 0.9em;
    animation: fadeSlideIn 0.5s ease-out 0.25s forwards;
}

.footer a {
    cursor: pointer;
    opacity: 0.6;
}

.footer a:hover {
    opacity: 1;
}

/* Cursor trail */
.cursor-trail {
    position: fixed;
    width: 56px;
    height: 56px;
    background: url('/img/cursortrail.png') center/contain no-repeat;
    pointer-events: none;
    z-index: 9998;
}

/* Mobile */
@media (max-width: 640px) {
    body {
        font-size: 14px;
        padding: 15px;
    }
    a {
        padding: 4px 0;
    }
}
