/* Custom CSS for Retro-Futuristic Developer Portfolio */

:root {
    --primary: #ecb2ff;
    --primary-glow: rgba(236, 178, 255, 0.4);
    --secondary: #d3fbff;
    --secondary-glow: rgba(211, 251, 255, 0.5);
    --tertiary: #c7bfff;
    --background: #111126;
    --surface: #111126;
    --surface-container-low: #19192f;
    --surface-container: #1d1d33;
    --surface-container-high: #28283e;
    --surface-container-highest: #333349;
    --outline-variant: #514255;
    --outline: #9d8ba0;
}

/* Scroll Snap System (Desktop only to prevent breaking mobile flow) */
@media (min-width: 768px) {
    html {
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth;
    }
    section.snap-section {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    /* Work section needs dynamic height for pagination */
    section.snap-section#work {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        scroll-snap-align: start;
    }
}

/* Mobile: Ensure sections don't get clipped by fixed navbar when scrolling */
@media (max-width: 767px) {
    section.snap-section {
        scroll-margin-top: 80px;
    }
    /* Skills section header spacing fix */
    section.snap-section#skills .mb-16 {
        margin-bottom: 2rem;
    }
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding: 16px 0;
}

.pagination-controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--outline-variant);
    background: var(--surface-container-low);
    color: var(--primary);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.25s ease;
}

.pagination-controls button:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(236, 178, 255, 0.08);
    box-shadow: 0 0 12px rgba(236, 178, 255, 0.15);
}

.pagination-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-controls .page-indicator {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: var(--secondary);
    padding: 10px 16px;
    border: 1px solid var(--outline-variant);
    background: var(--surface-container);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-width: 120px;
    text-align: center;
}

.pagination-controls .page-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 0 8px;
}

.pagination-controls .page-dot {
    width: 8px;
    height: 8px;
    border: 1px solid var(--outline-variant);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    min-width: auto;
}

.pagination-controls .page-dot:hover {
    border-color: var(--primary);
}

.pagination-controls .page-dot.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Project grid fade transition */
#project-grid {
    transition: opacity 0.2s ease;
}

#project-grid.fading {
    opacity: 0;
}

/* Base Grid */
.bg-grid {
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(153, 0, 207, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(153, 0, 207, 0.04) 1px, transparent 1px);
}

/* CRT Scanline Effect */
.scanline {
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.15) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 99;
}

/* CRT Screen Flickering/Breathing Glow */
.crt-breathing {
    animation: crt-glow 8s infinite alternate;
}

@keyframes crt-glow {
    0% { opacity: 0.96; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* Chamfered Polygonal Clipped Corners */
.chamfer-clip {
    clip-path: polygon(15px 0%, 100% 0%, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0% 100%, 0% 15px);
}

.chamfer-clip-sm {
    clip-path: polygon(8px 0%, 100% 0%, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0% 100%, 0% 8px);
}

/* Text Glow (CRT Feel) */
.glow-text-primary {
    text-shadow: 0 0 8px var(--primary-glow);
}

.glow-text-secondary {
    text-shadow: 0 0 8px var(--secondary-glow);
}

/* Custom Scrollbar (Terminal Style) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-container-low);
    border-left: 1px solid var(--outline-variant);
}

::-webkit-scrollbar-thumb {
    background: var(--outline-variant);
    border: 1px solid var(--surface-container-low);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Skill Progress Block Grid */
.skill-bar-container {
    display: flex;
    gap: 3px;
    margin-top: 8px;
}

.skill-bar-block {
    width: 14px;
    height: 20px;
    background-color: var(--surface-container-high);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.skill-bar-block.active {
    background-color: var(--secondary);
    border-color: var(--secondary);
    box-shadow: 0 0 6px var(--secondary-glow);
}

.skill-bar-block.active-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 6px var(--primary-glow);
}

/* Interactive Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 1px solid var(--secondary);
    border-radius: 0px; /* Sharp corners */
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    display: none;
}

.custom-cursor-dot {
    width: 4px;
    height: 4px;
    background-color: var(--primary);
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    display: none;
}

@media (min-width: 1024px) {
    .custom-cursor, .custom-cursor-dot {
        display: block;
    }
}

/* Hover Glitch Effect */
.hover-glitch {
    position: relative;
}

.hover-glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    color: var(--primary);
    overflow: hidden;
    clip: rect(0, 900px, 0, 0); 
    display: none;
}

.hover-glitch:hover::after {
    display: block;
    animation: glitch-animation 0.4s linear infinite alternate-reverse;
}

@keyframes glitch-animation {
    0% {
        clip: rect(10px, 9999px, 20px, 0);
        transform: translate(-2px, -1px);
    }
    50% {
        clip: rect(30px, 9999px, 15px, 0);
        transform: translate(1px, 2px);
    }
    100% {
        clip: rect(5px, 9999px, 40px, 0);
        transform: translate(-1px, -2px);
    }
}

/* L-Brackets corner ornaments */
.corner-bracket {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--secondary);
    pointer-events: none;
}

.bracket-tl { top: -2px; left: -2px; border-top: 2px solid; border-l: 2px solid; border-left: 2px solid; }
.bracket-tr { top: -2px; right: -2px; border-top: 2px solid; border-right: 2px solid; }
.bracket-bl { bottom: -2px; left: -2px; border-bottom: 2px solid; border-left: 2px solid; }
.bracket-br { bottom: -2px; right: -2px; border-bottom: 2px solid; border-right: 2px solid; }

/* Custom Terminal System Bar style */
.terminal-header {
    height: 40px;
    background-color: var(--surface-container-highest);
    border-bottom: 1px solid rgba(236, 178, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

/* Fade Overlay for Project Cards */
.card-overlay {
    background: linear-gradient(180deg, rgba(29, 29, 51, 0.4) 0%, rgba(12, 12, 33, 0.9) 100%);
}

/* Animations base states for AnimeJS target */
.reveal-item {
    opacity: 0;
    transform: translateY(20px);
}

.reveal-heading {
    opacity: 0;
    transform: translateX(-30px);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
}

/* Scanline animation */
@keyframes scanline-roll {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 100%;
    }
}

.scanline-animated {
    animation: scanline-roll 20s linear infinite;
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-container-high) 50%, var(--surface-container) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
