/* ============================================
   JUAN JONCK PORTFOLIO - STYLES
   Plain HTML/CSS/JS for GitHub Pages
   ============================================ */

/* Font Families */
.font-heading {
    font-family: 'Montserrat', sans-serif;
}

.font-mono {
    font-family: 'Space Mono', monospace;
}

body {
    font-family: 'Inter', sans-serif;
}

/* ============================================
   NOISE OVERLAY
   ============================================ */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: overlay;
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============================================
   GLASSMORPHIC COMPONENTS
   ============================================ */
.glass-card {
    background: rgba(11, 16, 34, 0.7);
    border: 1px solid rgba(242, 245, 255, 0.08);
    border-radius: 22px;
}

.glass-panel {
    background: rgba(11, 16, 34, 0.55);
    border: 1px solid rgba(242, 245, 255, 0.12);
}

/* ============================================
   BACKGROUND UTILITIES
   ============================================ */
.bg-cover-center {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.gradient-overlay-left {
    background: linear-gradient(90deg, rgba(7, 10, 18, 0.85) 0%, rgba(7, 10, 18, 0.4) 50%, transparent 100%);
}

.gradient-overlay-dark {
    background: linear-gradient(180deg, rgba(7, 10, 18, 0.6) 0%, rgba(7, 10, 18, 0.85) 100%);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    font-weight: 500;
    background: #4F6DFF;
    color: #F2F5FF;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    background: #3d5ce6;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    font-weight: 500;
    background: rgba(242, 245, 255, 0.08);
    border: 1px solid rgba(242, 245, 255, 0.12);
    color: #F2F5FF;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    transform: translateY(-2px) scale(1.02);
    background: rgba(242, 245, 255, 0.12);
}

/* ============================================
   TEXT LINKS
   ============================================ */
.text-link {
    position: relative;
    display: inline-flex;
    text-decoration: none;
}

.text-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #4F6DFF;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.text-link:hover::after {
    transform: scaleX(1);
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-bar {
    height: 4px;
    background: rgba(242, 245, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #4F6DFF;
    border-radius: 2px;
    transition: width 1s ease-out;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #070A12;
}

::-webkit-scrollbar-thumb {
    background: rgba(79, 109, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 109, 255, 0.5);
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
    background: rgba(79, 109, 255, 0.3);
    color: #F2F5FF;
}

/* ============================================
   NAVIGATION
   ============================================ */
#navbar.scrolled {
    background: rgba(7, 10, 18, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(242, 245, 255, 0.08);
}

/* ============================================
   HERO SECTION RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    #hero {
        flex-direction: column;
        padding-top: 100px;
        padding-bottom: 60px;
        min-height: auto !important;
    }
    
    .hero-portrait {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 80% !important;
        max-width: 400px !important;
        height: 50vh !important;
        margin: 0 auto 40px;
    }
    
    .hero-text {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 90% !important;
        max-width: 600px !important;
        margin: 0 auto;
        text-align: center;
    }
    
    .hero-text p.max-w-lg {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-text .flex-wrap {
        justify-content: center;
    }
    
    .hero-bg {
        display: none;
    }
}

/* ============================================
   PROJECT SECTIONS RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .project-section {
        flex-direction: column;
        padding-top: 100px;
        padding-bottom: 60px;
        min-height: auto !important;
    }
    
    .project-image {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 90% !important;
        max-width: 500px !important;
        height: 40vh !important;
        margin: 0 auto 40px;
    }
    
    .project-text {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 90% !important;
        max-width: 500px !important;
        margin: 0 auto;
        text-align: center;
    }
    
    .project-index {
        top: 80px !important;
        right: 20px !important;
        font-size: 60px !important;
    }
}

/* ============================================
   PROJECT OVERVIEW RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    #work {
        flex-direction: column;
        padding-top: 100px;
        padding-bottom: 60px;
        min-height: auto !important;
    }
    
    .project-label {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        margin-bottom: 20px;
        padding-left: 5%;
    }
    
    .project-headline {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 90% !important;
        margin: 0 auto 40px;
        font-size: clamp(32px, 8vw, 60px) !important;
    }
    
    .project-card {
        position: relative !important;
        right: auto !important;
        bottom: auto !important;
        width: 90% !important;
        margin: 0 auto;
    }
    
    .project-overview-bg {
        display: none;
    }
}

/* ============================================
   PERSONAL LAB RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    #lab {
        flex-direction: column;
        padding-top: 100px;
        padding-bottom: 60px;
        min-height: auto !important;
    }
    
    .lab-label {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        margin-bottom: 20px;
        padding-left: 5%;
    }
    
    .lab-headline {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 90% !important;
        margin: 0 auto 40px;
        font-size: clamp(32px, 8vw, 60px) !important;
    }
    
    .lab-card {
        position: relative !important;
        right: auto !important;
        bottom: auto !important;
        width: 90% !important;
        margin: 0 auto;
    }
    
    .lab-bg {
        display: none;
    }
}

/* ============================================
   ABOUT SECTION RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .about-stats {
        grid-template-columns: 1fr !important;
    }
    
    .about-content {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   CONTACT SECTION RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .contact-details .grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   PROJECT IFRAME EMBEDS
   ============================================ */
.project-image {
    position: relative;
}

.project-image iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-image iframe.loaded {
    opacity: 1;
}

/* Skeleton loader */
.project-iframe-skeleton {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0B1022;
    z-index: 1;
    transition: opacity 0.4s ease;
}

.project-iframe-skeleton.hidden {
    opacity: 0;
    pointer-events: none;
}

.skeleton-pulse {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 30%,
        rgba(79, 109, 255, 0.04) 50%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.8s ease-in-out infinite;
}

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

.skeleton-text {
    position: relative;
    z-index: 2;
    color: rgba(242, 245, 255, 0.3);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
}

/* Live site hover overlay */
.project-live-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(7, 10, 18, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.project-image:hover .project-live-overlay {
    opacity: 1;
}

.project-live-overlay .overlay-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #4F6DFF;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.project-live-overlay:hover .overlay-icon {
    transform: scale(1.1);
}

.project-live-overlay .overlay-label {
    color: #F2F5FF;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    opacity: 0.7;
}

/* Live badge (always visible) */
.project-live-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(7, 10, 18, 0.75);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(242, 245, 255, 0.08);
    color: rgba(242, 245, 255, 0.6);
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-image iframe.loaded ~ .project-live-overlay ~ .project-live-badge {
    opacity: 1;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4F6DFF;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
}

/* ============================================
   SCROLL REVEAL INITIAL STATES
   ============================================ */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
}

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

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

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

/* ============================================
   SMOOTH SCROLL
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================
   FOCUS STATES
   ============================================ */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #4F6DFF;
    outline-offset: 2px;
}
