:root {
    --of-accent: #e04e46;
    --of-bg: #f8fafc;
    --of-surface: #ffffff;
    --of-text: #0f172a;
    --of-muted: #475569;
    --of-border: #e2e8f0;
}

body {
    background: var(--of-bg);
    color: var(--of-text);
    font-family: "Space Grotesk", sans-serif;
}

.fade-in {
    animation: fadeIn 0.8s ease-in forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-grid {
    background-image:
        linear-gradient(90deg, rgba(15, 23, 42, 0.055) 1px, transparent 0),
        linear-gradient(180deg, rgba(15, 23, 42, 0.055) 1px, transparent 0);
    background-position: 0 0;
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, transparent 4%, #000 30%, #000 72%, transparent 96%);
    overflow: hidden;
    animation: gridDrift 48s ease-in-out infinite;
}

.portfolio-grid::before,
.portfolio-grid::after {
    background-image: inherit;
    background-size: inherit;
    content: "";
    inset: -12%;
    pointer-events: none;
    position: absolute;
}

.portfolio-grid::before {
    animation: gridWaveUp 44s ease-in-out infinite;
}

.portfolio-grid::after {
    animation: gridWaveDown 54s ease-in-out infinite;
    mask-image:
        radial-gradient(circle at 48% 22%, #000 0 11%, transparent 24%),
        radial-gradient(circle at 86% 78%, #000 0 14%, transparent 30%);
    opacity: 0.32;
}

.hero-grid {
    background-image:
        linear-gradient(90deg, rgba(224, 78, 70, 0.14) 1px, transparent 0),
        linear-gradient(180deg, rgba(15, 23, 42, 0.08) 1px, transparent 0);
    background-position: 0 0;
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, #000 0 54%, transparent 76%);
    animation: gridWaveUp 24s ease-in-out infinite;
}

@keyframes gridDrift {
    0%,
    100% {
        background-position: 0 0;
    }
    45% {
        background-position: 10px -8px;
    }
    70% {
        background-position: -6px 8px;
    }
}

@keyframes gridWaveUp {
    0%,
    100% {
        background-position: 0 0;
        transform: translateZ(0) skewY(0deg);
    }
    45% {
        background-position: 12px -18px;
        transform: translate3d(10px, -18px, 0) skewY(-0.7deg);
    }
    72% {
        background-position: -8px 12px;
        transform: translate3d(-8px, 12px, 0) skewY(0.45deg);
    }
}

@keyframes gridWaveDown {
    0%,
    100% {
        background-position: 0 0;
        transform: translateZ(0) skewY(0deg);
    }
    38% {
        background-position: -10px 16px;
        transform: translate3d(-12px, 16px, 0) skewY(0.6deg);
    }
    76% {
        background-position: 8px -10px;
        transform: translate3d(8px, -10px, 0) skewY(-0.4deg);
    }
}

.glow-text {
    text-shadow: 0 0 40px rgba(15, 23, 42, 0.1);
}

.gradient-flow {
    animation: gradientFlow 7s ease-in-out infinite;
    background-clip: text;
    background-image: linear-gradient(100deg, #0f172a, #0f172a 20%, #e04e46 45%, #e04e46 60%, #0f172a 85%);
    background-position: 0 50%;
    background-size: 250% 100%;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes gradientFlow {
    0% {
        background-position: 0 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

.rich-content p {
    margin-bottom: 1rem;
}

.rich-content strong {
    color: #0f172a;
    font-weight: 700;
}

.rich-content a {
    color: var(--of-accent);
    text-decoration: underline;
}

.rich-content ul,
.rich-content ol {
    margin: 1rem 0 1rem 1.25rem;
}

.rich-content ul {
    list-style: disc;
}

.rich-content ol {
    list-style: decimal;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
