:root {
    /* Color Palette Inspired by Project Hail Mary & Deep Space */
    --space-dark: #02040a;
    /* Deepest black space */
    --space-light: #0d1323;
    /* Dark blue space */
    --astrophage-base: #ef4444;
    /* Warm amber/gold for astrophage */
    --astrophage-glow: #f87171;
    /* Bright glowing astrophage */
    --infrared-red: #ef4444;
    /* Subtle red for Petrova line/infrared */
    --text-main: #f8fafc;
    /* Crisp white */
    --text-muted: #94a3b8;
    /* Subtle slate for secondary text */

    /* Glassmorphism Tokens */
    --glass-bg: rgba(13, 19, 35, 0.4);
    --glass-border: rgba(239, 68, 68, 0.15);
    --glass-hover: rgba(239, 68, 68, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--space-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
.brand,
.btn {
    font-family: 'Space Grotesk', sans-serif;
}

/* ----- Background Layers ----- */
/* Animated ambient gradient (like a distant nebula or astrophage cloud) */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.03) 0%, transparent 30%);
    z-index: -2;
    pointer-events: none;
    animation: rotateBg 120s linear infinite;
}

@keyframes rotateBg {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Canvas for Astrophage Particles */
#astrophage-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* ----- Layout & Navigation ----- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(2, 4, 10, 0.9) 0%, rgba(2, 4, 10, 0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

/* Eridian Hexagon Icon */
.brand svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--astrophage-base);
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--astrophage-glow);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ----- Hero Section ----- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, rgba(0, 0, 0, 0) 60%);
    top: 50%;
    left: -10%;
    transform: translateY(-50%);
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tag-pill {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 50px;
    color: var(--astrophage-glow);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 30px;
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.05);
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -2px;
    margin-bottom: 24px;
    color: var(--text-main);
}

.hero h1 span {
    color: transparent;
    background: linear-gradient(135deg, var(--astrophage-glow) 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 650px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.hero .quote {
    font-style: italic;
    color: var(--text-main);
    border-left: 2px solid var(--astrophage-base);
    padding-left: 20px;
    margin-bottom: 50px;
    font-size: 1.1rem;
    opacity: 0.9;
}

.btn-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    z-index: -1;
    transition: opacity 0.4s;
    opacity: 0;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ----- Sections General ----- */
section {
    padding: 120px 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 70px;
    display: flex;
    align-items: center;
    gap: 20px;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    height: 1px;
    flex-grow: 1;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.3), transparent);
}

.section-title span {
    color: var(--astrophage-base);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 2px;
}

/* ----- About Section ----- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-text p {
    margin-bottom: 24px;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--astrophage-base);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: rgba(13, 19, 35, 0.7);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--astrophage-glow);
    margin-bottom: 12px;
    font-weight: 300;
    letter-spacing: 2px;
}

.stat-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

/* ----- Stack Section ----- */
.stack-container {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 60px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.stack-container::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.5), transparent);
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 50px;
}

.stack-category h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stack-category h3 svg {
    width: 18px;
    height: 18px;
    stroke: var(--astrophage-base);
    fill: none;
    stroke-width: 2;
}

.stack-list {
    list-style: none;
}

.stack-list li {
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.stack-list li:hover {
    color: var(--text-main);
}

.stack-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--astrophage-base);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--astrophage-glow);
}

/* ----- Projects Section ----- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.project-card {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--astrophage-base), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.project-card:hover {
    transform: translateY(-12px);
    border-color: var(--glass-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(239, 68, 68, 0.05);
    background: rgba(13, 19, 35, 0.6);
}

.project-card:hover::before {
    transform: translateX(100%);
}

.project-card:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--astrophage-glow);
    pointer-events: none;
    animation: glitchOverlay 1.5s infinite;
}

@keyframes glitchOverlay {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 2%, 0 2%);
    }

    50% {
        clip-path: polygon(0 98%, 100% 98%, 100% 100%, 0 100%);
    }

    100% {
        clip-path: polygon(0 0, 100% 0, 100% 2%, 0 2%);
    }
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.project-title {
    font-size: 1.4rem;
    color: var(--text-main);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.project-stars {
    color: var(--astrophage-glow);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Space Grotesk', sans-serif;
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
    line-height: 1.7;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.project-tag {
    font-size: 0.75rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.project-card:hover .project-tag {
    border-color: rgba(255, 255, 255, 0.15);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--astrophage-base);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s;
    font-family: 'Space Grotesk', sans-serif;
}

.project-link:hover {
    gap: 16px;
    color: var(--astrophage-glow);
}

/* Loading Spinner */
.loading-container {
    text-align: center;
    padding: 80px 0;
    grid-column: 1 / -1;
}

.astrophage-spinner {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(239, 68, 68, 0.1);
    border-top-color: var(--astrophage-base);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 24px;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ----- Certificates Section ----- */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 24px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cert-card:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateX(10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.cert-icon {
    width: 48px;
    height: 48px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--astrophage-base);
    border: 1px solid rgba(239, 68, 68, 0.2);
    flex-shrink: 0;
    transition: all 0.3s;
}

.cert-card:hover .cert-icon {
    background: var(--astrophage-base);
    color: var(--space-dark);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.cert-info h4 {
    font-size: 1.05rem;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.cert-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ----- Footer ----- */
footer {
    padding: 60px 0 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    background: linear-gradient(to top, rgba(2, 4, 10, 0.8) 0%, transparent 100%);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.social-links {
    display: flex;
    gap: 24px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    transition: all 0.3s;
}

.social-links a:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--astrophage-base);
    color: var(--astrophage-glow);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.2);
}

.copyright {
    letter-spacing: 1px;
    opacity: 0.7;
}

/* ----- Responsive Design ----- */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .hero h1 {
        font-size: 4rem;
    }

    section {
        padding: 120px 0;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Add hamburger menu if needed */
    }

    .hero {
        padding-top: 120px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .stack-container {
        padding: 40px 24px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}


/* --- HUD & ANIMATIONS --- */

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 999;
    opacity: 0.3;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(12px);
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.section-title.reveal::after {
    transform: scaleX(0);
}

.section-title.reveal.active::after {
    transform: scaleX(1);
}

.hud-corners {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.stat-card:hover .hud-corners,
.stack-container:hover .hud-corners,
.project-card:hover .hud-corners,
.cert-card:hover .hud-corners {
    background:
        linear-gradient(to right, var(--astrophage-glow) 2px, transparent 2px) 0 0,
        linear-gradient(to right, var(--astrophage-glow) 2px, transparent 2px) 0 100%,
        linear-gradient(to left, var(--astrophage-glow) 2px, transparent 2px) 100% 0,
        linear-gradient(to left, var(--astrophage-glow) 2px, transparent 2px) 100% 100%,
        linear-gradient(to bottom, var(--astrophage-glow) 2px, transparent 2px) 0 0,
        linear-gradient(to bottom, var(--astrophage-glow) 2px, transparent 2px) 100% 0,
        linear-gradient(to top, var(--astrophage-glow) 2px, transparent 2px) 0 100%,
        linear-gradient(to top, var(--astrophage-glow) 2px, transparent 2px) 100% 100%;
    background-repeat: no-repeat;
    background-size: 15px 15px;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
}

@keyframes glitch {

    2%,
    64% {
        transform: translate(2px, 0) skew(0deg);
    }

    4%,
    60% {
        transform: translate(-2px, 0) skew(0deg);
    }

    62% {
        transform: translate(0, 0) skew(5deg);
    }
}

.glitch-hover:hover {
    animation: glitch 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--astrophage-glow);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

@keyframes flicker {
    0% {
        opacity: 0.95;
    }

    5% {
        opacity: 0.85;
    }

    10% {
        opacity: 0.95;
    }

    15% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}

body {
    animation: none;
}

/* --- SPIDER-VERSE GLITCH --- */
.spider-glitch {
    position: relative;
    display: inline-block;
}

.spider-glitch::before,
.spider-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

.spider-glitch.is-glitching {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.spider-glitch.is-glitching::before {
    animation: glitch-anim-cyan 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    color: #0ff;
    z-index: -1;
    text-shadow: -2px 0 #0ff;
}

.spider-glitch.is-glitching::after {
    animation: glitch-anim-red 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    color: #ef4444;
    z-index: -2;
    text-shadow: 2px 0 #ef4444;
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-10deg);
    }

    40% {
        transform: skew(10deg);
    }

    60% {
        transform: skew(-5deg);
    }

    80% {
        transform: skew(5deg);
    }

    100% {
        transform: skew(0deg);
    }
}

@keyframes glitch-anim-cyan {
    0% {
        opacity: 1;
        transform: translate(0, 0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    20% {
        opacity: 1;
        transform: translate(-5px, 2px);
        clip-path: polygon(0 10%, 100% 10%, 100% 30%, 0 30%);
    }

    40% {
        opacity: 1;
        transform: translate(5px, -2px);
        clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
    }

    60% {
        opacity: 1;
        transform: translate(-2px, 5px);
        clip-path: polygon(0 70%, 100% 70%, 100% 90%, 0 90%);
    }

    80% {
        opacity: 1;
        transform: translate(2px, -5px);
        clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%);
    }

    100% {
        opacity: 0;
        transform: translate(0, 0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@keyframes glitch-anim-red {
    0% {
        opacity: 1;
        transform: translate(0, 0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    20% {
        opacity: 1;
        transform: translate(5px, -2px);
        clip-path: polygon(0 60%, 100% 60%, 100% 90%, 0 90%);
    }

    40% {
        opacity: 1;
        transform: translate(-5px, 2px);
        clip-path: polygon(0 10%, 100% 10%, 100% 40%, 0 40%);
    }

    60% {
        opacity: 1;
        transform: translate(2px, -5px);
        clip-path: polygon(0 30%, 100% 30%, 100% 70%, 0 70%);
    }

    80% {
        opacity: 1;
        transform: translate(-2px, 5px);
        clip-path: polygon(0 50%, 100% 50%, 100% 80%, 0 80%);
    }

    100% {
        opacity: 0;
        transform: translate(0, 0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* --- Force-disable animations on titles to keep them static --- */
h1,
h1 span,
.section-title,
.section-title span,
.brand span,
.nav .brand span,
.spider-glitch,
.spider-glitch::before,
.spider-glitch::after,
.spider-glitch.is-glitching,
.spider-glitch.is-glitching::before,
.spider-glitch.is-glitching::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    clip-path: none !important;
    text-shadow: none !important;
}