/* 
 * Emir Can Portfolio - Premium Dark Glassmorphism 
 * Custom Styles & Animations
 */

:root {
    --brand-black: #0a0a0a;
    --brand-dark: #121212;
    --brand-muted: #a1a1aa;
    --brand-accent: #ffffff;
    --inner-glow: inset 0 0 20px rgba(255, 255, 255, 0.05);
    --border-glass: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glassmorphism Classes */
.glass {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: var(--border-glass);
    box-shadow: var(--inner-glow);
}

.glass-hover:hover {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), var(--inner-glow);
}

/* Bento Grid Styles */
.bento-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Scroll Animations — opacity managed by GSAP, CSS only sets initial state */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

/* Premium Hero Entrance */
.reveal-hero {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    filter: blur(10px);
    animation: heroReveal 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.reveal-hero-delayed {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 1.2s cubic-bezier(0.19, 1, 0.22, 1) 0.3s forwards;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Custom Gradients */
.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom Buttons */
.btn-premium {
    position: relative;
    overflow: hidden;
    background: white;
    color: black;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-premium:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--brand-black);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Typewriter Cursor */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: white;
    margin-left: 4px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Custom Cursor */
#custom-cursor {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.2s cubic-bezier(0.19, 1, 0.22, 1);
}

#custom-cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Magnetic Elements Support */
.magnetic {
    display: inline-block;
}

/* Lenis Smooth Scroll Support */
html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* Particles Background */
#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Texture/Noise Overlay refinement */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    mix-blend-mode: overlay;
}

/* --- PRO MAX ENHANCEMENTS --- */

/* 3D Bento Tilt */
.perspective-container {
    perspective: 1000px;
}

.tilt-inner {
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
}

/* Page Progress Bar */
#page-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: #ffffff;
    z-index: 100;
}

/* Cursor Blur Ring */
#custom-cursor-outline.blur-ring {
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── TYPEWRITER CURSORS ─────────────────────────────────────────── */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    transition: opacity 0.3s ease;
}

.typewriter-cursor-2 {
    display: inline-block;
    width: 2px;
    height: 0.85em;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1.2s step-end infinite;
    transition: opacity 0.3s ease;
}

/* ── MOBILE RESPONSIVE ─────────────────────────────────────────── */

/* Hide custom cursor on touch/mobile devices */
@media (hover: none) and (pointer: coarse) {
    #custom-cursor,
    #custom-cursor-outline {
        display: none !important;
    }
}

/* ── Small screens (< 768px) ─── */
@media (max-width: 767px) {

    /* Custom cursor off */
    #custom-cursor,
    #custom-cursor-outline {
        display: none !important;
    }

    /* Reduce heavy section padding */
    section.py-32 {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    section.pb-32 {
        padding-bottom: 4rem;
    }
    section.py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* ── HERO ── */
    #hero {
        min-height: 100svh;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    #hero h2 {
        font-size: 2.5rem;
        line-height: 1.1;
        margin-bottom: 1.5rem;
    }
    #hero h1 {
        font-size: 0.625rem;
        letter-spacing: 0.35em;
        margin-bottom: 1.5rem;
    }
    #hero p.text-xl,
    #hero p.text-2xl {
        font-size: 1rem;
    }
    #hero .flex-wrap.gap-8 {
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
    }
    #hero .btn-premium {
        padding-left: 2rem;
        padding-right: 2rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        width: 100%;
        text-align: center;
    }

    /* ── BENTO GRID (index.php) ── */
    .grid.md\:grid-cols-12 {
        grid-template-columns: 1fr;
    }
    .md\:col-span-8,
    .md\:col-span-4 {
        grid-column: span 1 / span 1;
    }
    .bento-card {
        padding: 1.25rem;
        border-radius: 1rem;
    }

    /* ── SECTION HEADINGS ── */
    h2.text-5xl,
    h3.text-4xl,
    h4.text-4xl {
        font-size: 2rem;
        line-height: 1.15;
    }
    h2.text-5xl.md\:text-7xl {
        font-size: 2.25rem;
    }
    h3.text-4xl.md\:text-6xl,
    h3.text-4xl.md\:text-5xl {
        font-size: 2rem;
    }

    /* ── ABOUT PAGE ── */
    .grid.md\:grid-cols-2.gap-20 {
        gap: 2.5rem;
    }
    /* image on top, text below */
    .grid.md\:grid-cols-2.gap-20 > div:first-child {
        max-width: 280px;
        margin: 0 auto;
    }
    /* About big heading */
    .grid.md\:grid-cols-2.gap-20 h2 {
        font-size: 2rem;
    }
    .grid.md\:grid-cols-2.gap-20 h2 span {
        font-size: 2rem;
    }
    /* Stats row wraps nicely */
    .mt-12.flex.gap-12 {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    /* ── ABOUT: Values cards ── */
    .grid.md\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .glass.p-10.rounded-3xl {
        padding: 1.5rem;
    }

    /* ── ABOUT: Skills grid ── */
    .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .glass.p-6.rounded-2xl {
        padding: 1rem;
    }

    /* ── SERVICES PAGE ── */
    /* Service cards: stacked, less padding */
    .glass.p-12.rounded-\[2rem\] {
        padding: 1.5rem;
        border-radius: 1.25rem;
        flex-direction: column;
        gap: 1.5rem;
    }
    .glass.p-12.rounded-\[2rem\] .md\:w-1\/3,
    .glass.p-12.rounded-\[2rem\] .md\:w-2\/3 {
        width: 100%;
    }
    /* Service icon circle smaller */
    .w-32.h-32.rounded-full {
        width: 5rem;
        height: 5rem;
        font-size: 2rem;
    }
    /* Reverse on mobile makes no sense — reset */
    .md\:flex-row-reverse {
        flex-direction: column !important;
    }
    /* Remove the connector arrows */
    .hidden.md\:block.absolute {
        display: none !important;
    }
    /* Process grid: 2 cols on mobile */
    .grid.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .glass.p-8.rounded-3xl {
        padding: 1.25rem;
    }
    /* Tech logos scroll better */
    .flex.flex-wrap.justify-center.gap-12.md\:gap-24 {
        gap: 1.5rem;
    }
    .flex.flex-wrap.justify-center.gap-12.md\:gap-24 .flex.items-center.gap-4 span {
        font-size: 0.75rem;
    }
    .flex.flex-wrap.justify-center.gap-12.md\:gap-24 i {
        font-size: 1.75rem;
    }

    /* ── CONTACT PAGE ── */
    .container.mx-auto.max-w-6xl .grid.md\:grid-cols-2.gap-20 {
        gap: 2rem;
    }
    /* Contact heading */
    .container.mx-auto.max-w-6xl h2 {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    /* Email address text overflow */
    .container.mx-auto.max-w-6xl a.text-xl {
        font-size: 0.875rem;
        word-break: break-all;
    }
    /* Form glass padding */
    .glass.p-10.md\:p-12.rounded-\[2\.5rem\] {
        padding: 1.25rem;
        border-radius: 1.25rem;
    }
    /* Form name/email: stack on mobile */
    .grid.md\:grid-cols-2.gap-8 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* ── PROJECTS PAGE ── */
    .grid.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── FOOTER ── */
    .container.mx-auto.px-6.grid.md\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .container.mx-auto.px-6.grid.md\:grid-cols-4 .col-span-2 {
        grid-column: span 1;
    }
    /* Footer bottom */
    .container.mx-auto.px-6.mt-20.pt-8.border-t.border-white\/5 {
        margin-top: 2.5rem;
        text-align: center;
    }
    .container.mx-auto.px-6.mt-20.pt-8.border-t.border-white\/5 .flex.gap-8 {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    /* ── MISC ── */
    /* CTA buttons full width */
    a.btn-premium,
    button.btn-premium {
        display: block;
        width: 100%;
        text-align: center;
    }
    /* Reduce noise overlay on mobile for perf */
    .noise { display: none; }
}

/* ── Medium tablets (768px – 1023px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
    section.py-32 {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
    .bento-card { padding: 1.5rem; }
    .glass.p-12.rounded-\[2rem\] { padding: 2rem; }
    .grid.md\:grid-cols-4 { gap: 1rem; }
}
