/* Custom Styles for Plexi09 Portfolio */

/* ═══════════════════════════
   CSS CUSTOM PROPERTIES
═══════════════════════════ */
:root {
    --accent-1: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #a78bfa;
    --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --radius: 1.25rem;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.76, 0, 0.24, 1);
}

/* Hide default scrollbar for a cleaner look */
::-webkit-scrollbar {
    display: none;
}
html {
    scrollbar-width: none;
}

/* Lenis Smooth Scroll */
html.lenis {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis.lenis-stopped {
    overflow: hidden;
}
.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* Typography & Utilities */
.stroke-text {
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.6);
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Cursor */
@media (min-width: 768px) {
    body, a, button, .hover-target {
        cursor: none;
    }
}

/* Selection color */
::selection {
    background: var(--accent-2);
    color: #ffffff;
}

/* Preloader */
#preloader {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    background: #050505;
}

/* Hero entrance elements — hidden before preloader reveals them */
.hero-title,
.hero-subtitle {
    opacity: 0;
    transform: translateY(60px);
    will-change: transform, opacity;
}

/* Gallery Scroll */
.gallery-wrapper::-webkit-scrollbar {
    display: none;
}
.gallery-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ═══════════════════════════
   GRAIN / FILM OVERLAY
═══════════════════════════ */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
    mix-blend-mode: overlay;
}

/* ═══════════════════════════
   SCROLL PROGRESS BAR
═══════════════════════════ */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--gradient);
    z-index: 600;
    pointer-events: none;
    transition: width 0.05s linear;
    box-shadow: 0 0 20px var(--accent-1), 0 0 60px rgba(99, 102, 241, 0.3);
}

/* ═══════════════════════════
   ACTIVE NAV LINK
═══════════════════════════ */
.nav-link {
    position: relative;
    color: rgba(156, 163, 175, 1);
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gradient);
    transition: width 0.4s var(--ease-smooth);
}
.nav-link.active {
    color: #ffffff;
}
.nav-link.active::after {
    width: 100%;
}

/* ═══════════════════════════
   MOBILE HAMBURGER & OVERLAY
═══════════════════════════ */
#mobile-overlay.open {
    transform: translateX(0);
}

#hamburger.open .ham-line:first-child {
    transform: translateY(4px) rotate(45deg);
    width: 24px;
}
#hamburger.open .ham-line:last-child {
    transform: translateY(-4px) rotate(-45deg);
    width: 24px;
}

/* Staggered mobile link entrance */
#mobile-overlay .mobile-nav-link {
    transform: translateX(-20px);
    opacity: 0;
    transition: transform 0.6s var(--ease-smooth), opacity 0.6s ease;
}
#mobile-overlay.open .mobile-nav-link { transform: translateX(0); opacity: 1; }
#mobile-overlay.open .mobile-nav-link:nth-child(1) { transition-delay: 0.15s; }
#mobile-overlay.open .mobile-nav-link:nth-child(2) { transition-delay: 0.20s; }
#mobile-overlay.open .mobile-nav-link:nth-child(3) { transition-delay: 0.25s; }
#mobile-overlay.open .mobile-nav-link:nth-child(4) { transition-delay: 0.30s; }
#mobile-overlay.open .mobile-nav-link:nth-child(5) { transition-delay: 0.35s; }

/* ═══════════════════════════
   EDITORIAL SECTION NUMBERS
═══════════════════════════ */
.section-num {
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1.25rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══════════════════════════
   MARQUEE / TICKER
═══════════════════════════ */
.marquee {
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}
.marquee-inner {
    display: inline-flex;
    animation: marquee-scroll 30s linear infinite;
}
.marquee:hover .marquee-inner {
    animation-play-state: paused;
}
.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(1.5rem, 3vw, 3rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.08);
    transition: color 0.4s ease;
}
.marquee-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gradient);
    flex-shrink: 0;
    opacity: 0.5;
}
@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ═══════════════════════════
   GLASSMORPHISM CARDS
═══════════════════════════ */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.5s var(--ease-out-expo);
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(99, 102, 241, 0.06);
}

/* ═══════════════════════════
   PROJECT CARDS — GRADIENT BORDER
═══════════════════════════ */
.project-card {
    position: relative;
    background: #0a0a0a;
    border: 1px solid transparent;
    transition: all 0.6s var(--ease-out-expo);
}
.project-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.6s ease, background 0.6s ease;
    pointer-events: none;
}
.project-card:hover::before {
    background: var(--gradient);
    opacity: 1;
}
.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 80px rgba(99, 102, 241, 0.08);
}

/* ═══════════════════════════
   TECH BADGE STYLING
═══════════════════════════ */
.tech-badge {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.4s ease;
}
.tech-badge:hover {
    border-color: var(--accent-2);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
}

/* ═══════════════════════════
   MAGNETIC BUTTONS
═══════════════════════════ */
.magnetic-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    overflow: hidden;
    transition: all 0.5s var(--ease-out-expo);
}
.magnetic-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}
.magnetic-btn:hover {
    border-color: transparent;
    color: #fff;
    transform: scale(1.05);
}
.magnetic-btn:hover::before {
    opacity: 1;
}
.magnetic-btn span,
.magnetic-btn i {
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════
   FLOATING SHAPES (BG DECORATION)
═══════════════════════════ */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    opacity: 0.15;
}
.floating-shape-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-1);
    top: -100px;
    right: -100px;
    animation: float-1 15s ease-in-out infinite;
}
.floating-shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-2);
    bottom: -50px;
    left: -80px;
    animation: float-2 18s ease-in-out infinite;
}
.floating-shape-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-3);
    top: 50%;
    left: 50%;
    animation: float-3 20s ease-in-out infinite;
}
@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 40px) scale(1.1); }
    66% { transform: translate(20px, -20px) scale(0.9); }
}
@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.15); }
    66% { transform: translate(-25px, 25px) scale(0.95); }
}
@keyframes float-3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* ═══════════════════════════
   SKILLS GRID
═══════════════════════════ */
.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: var(--glass-bg);
    transition: all 0.5s var(--ease-out-expo);
}
.skill-item:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-6px);
}
.skill-item i {
    font-size: 2rem;
    transition: transform 0.5s var(--ease-out-expo);
}
.skill-item:hover i {
    transform: scale(1.2);
}
.skill-item span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════
   SECTION DIVIDER
═══════════════════════════ */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    border: none;
}

/* ═══════════════════════════
   CONTACT SECTION GLOW
═══════════════════════════ */
.contact-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: pulse-glow 6s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

/* ═══════════════════════════
   SOCIAL LINKS
═══════════════════════════ */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    transition: all 0.4s var(--ease-out-expo);
}
.social-link:hover {
    border-color: var(--accent-2);
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}

/* ═══════════════════════════
   CV DOWNLOAD MODAL
═══════════════════════════ */
#cv-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}
#cv-modal.is-open #cv-modal-card {
    transform: scale(1);
}
.cv-lang-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent-2) !important;
}

/* ═══════════════════════════
   GALLERY ENHANCEMENTS
═══════════════════════════ */
.gallery-item {
    transition: transform 0.6s var(--ease-out-expo);
}
.gallery-item:hover {
    transform: scale(1.02);
}

/* ═══════════════════════════
   CV GROUP CARD GLOW
═══════════════════════════ */
.cv-column .group {
    border: 1px solid transparent;
    transition: all 0.5s var(--ease-out-expo);
}
.cv-column .group:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--glass-border);
}

/* ═══════════════════════════
   FOOTER ACCENT LINE
═══════════════════════════ */
footer {
    border-image: var(--gradient) 1;
    border-top-width: 1px;
}

/* ═══════════════════════════
   HACKER SPACE
═══════════════════════════ */
.space-card {
    transition: transform 0.3s var(--ease-out-expo);
}

.copy-btn {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s var(--ease-out-expo);
}

.space-card:hover .copy-btn {
    opacity: 1;
    transform: scale(1);
}

.key-wrapper {
    /* Ensure the gradient matches the card's perceived background */
    /* Since card is white/5 on dark, we can use a gradient from transparent to that color */
}

.key-wrapper .fade-overlay {
    /* Use a gradient that fades to the background color to hide text effectively */
    background: linear-gradient(to bottom, transparent, #111 90%);
}

.key-wrapper.expanded {
    max-height: 2000px; /* Arbitrary large value for transition */
}

.key-wrapper.expanded .fade-overlay {
    opacity: 0;
}

.toggle-btn i {
    transition: transform 0.3s var(--ease-smooth);
}

.toggle-btn.active i {
    transform: rotate(180deg);
}

/* Override global scrollbar hiding for specific elements */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    display: block !important;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}
