/* Vanilla ports of Aceternity UI: 3d-card, dither, noise, dock, glow, background-gradient */

:root {
    --font-pixel: 'Geist Pixel', 'JetBrains Mono', monospace;
    --glow-gradient:
        radial-gradient(circle, #dd7bbb 10%, #dd7bbb00 20%),
        radial-gradient(circle at 40% 40%, #d79f1e 5%, #d79f1e00 15%),
        radial-gradient(circle at 60% 60%, #5a922c 10%, #5a922c00 20%),
        radial-gradient(circle at 40% 60%, #4c7894 10%, #4c789400 20%),
        repeating-conic-gradient(
            from 236.84deg at 50% 50%,
            #dd7bbb 0%,
            #d79f1e 5%,
            #5a922c 10%,
            #4c7894 15%,
            #dd7bbb 20%
        );
}

.page-heading,
.section-title,
.logo h1,
.connect-heading,
.project-content h3,
.cert-card h3,
.timeline-info h3,
.hero-name {
    font-family: var(--font-pixel);
    font-weight: 400;
}

.page-heading,
.section-title {
    letter-spacing: 0.02em;
}

/* ── Glowing effect ── */
.glow-host {
    position: relative;
    --active: 0;
    --start: 0;
    --spread: 20;
    --glowingeffect-border-width: 1px;
    box-shadow:
        0 0 16px rgba(221, 123, 187, calc(var(--active) * 0.28)),
        0 0 0 1px rgba(215, 159, 30, calc(var(--active) * 0.45));
}

.tag.glow-host,
.skill-tag.glow-host,
.badge.glow-host {
    display: inline-block;
}

.glow-fx {
    pointer-events: none;
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 3;
}

.glow-fx::after {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--glowingeffect-border-width));
    border: var(--glowingeffect-border-width) solid transparent;
    border-radius: inherit;
    background: var(--glow-gradient);
    background-attachment: fixed;
    opacity: var(--active);
    transition: opacity 0.3s;
    -webkit-mask-clip: padding-box, border-box;
    mask-clip: padding-box, border-box;
    -webkit-mask-composite: destination-in;
    mask-composite: intersect;
    -webkit-mask-image: linear-gradient(#0000, #0000), conic-gradient(from calc((var(--start) - var(--spread)) * 1deg), #00000000 0deg, #fff, #00000000 calc(var(--spread) * 2deg));
    mask-image: linear-gradient(#0000, #0000), conic-gradient(from calc((var(--start) - var(--spread)) * 1deg), #00000000 0deg, #fff, #00000000 calc(var(--spread) * 2deg));
}

/* ── Noise background (EMAIL ME / VIEW RESUME) ── */
.noise-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--bg-elevated);
}

.noise-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

.noise-btn.connect-btn--primary:hover {
    color: var(--bg);
    background: var(--text-primary);
    border-color: var(--text-primary);
}

.noise-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.noise-grad {
    position: absolute;
    inset: 0;
}

.noise-grad-a { opacity: 0.4; }
.noise-grad-b { opacity: 0.3; }
.noise-grad-c { opacity: 0.25; }

.noise-strip {
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 2px;
    opacity: 0.8;
    filter: blur(2px);
    background: linear-gradient(to right, rgb(255, 100, 150), rgb(100, 150, 255), rgb(255, 200, 100));
}

.noise-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.22;
    mix-blend-mode: overlay;
}

.noise-content {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: inherit;
}

.noise-btn .glow-fx::after {
    inset: 0;
}

/* ── 3D card + background gradient on project cards ── */
.project-card-wrap {
    position: relative;
    padding: 2px;
    perspective: 1000px;
    height: 100%;
}

.bg-gradient-blur,
.bg-gradient-core {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle farthest-side at 0 100%, #00ccb1, transparent),
        radial-gradient(circle farthest-side at 100% 0, #7b61ff, transparent),
        radial-gradient(circle farthest-side at 100% 100%, #ffc414, transparent),
        radial-gradient(circle farthest-side at 0 0, #1ca0fb, #141316);
    background-size: 400% 400%;
    opacity: 0;
    transition: opacity 0.5s var(--ease);
    animation: bg-gradient-shift 5s ease infinite alternate;
}

.bg-gradient-blur {
    filter: blur(18px);
    z-index: 0;
}

.bg-gradient-core {
    z-index: 1;
}

.project-card-wrap:hover .bg-gradient-blur { opacity: 0.85; }
.project-card-wrap:hover .bg-gradient-core { opacity: 1; }

.project-card-wrap .project-card {
    position: relative;
    z-index: 2;
    height: 100%;
    width: 100%;
    isolation: auto;
    transform-style: preserve-3d;
    transition: transform 0.2s linear, border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
}

.project-card-wrap .project-card::before {
    display: none;
}

.card-3d-item {
    transition: transform 0.2s linear;
}

.project-card-wrap.is-hot .project-image.card-3d-item {
    transform: translateZ(36px);
}

.project-card-wrap.is-hot .project-content h3.card-3d-item {
    transform: translateZ(48px);
}

@keyframes bg-gradient-shift {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

/* ── Dither shader (about profile) ── */
.dither-frame {
    position: relative;
    width: 144px;
    height: 144px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 0 auto 1.25rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.dither-frame canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.dither-frame .profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border: none;
}

.dither-frame.is-ready .profile-image {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 640px) {
    .dither-frame {
        width: 120px;
        height: 120px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-gradient-blur,
    .bg-gradient-core {
        animation: none;
    }

    .card-3d-item,
    .project-card-wrap .project-card {
        transition: none;
    }
}
