/* Southpoint Digital - Main Stylesheet (Performance Optimized) */

/* ========================================
   0. CURTAIN REVEAL LOADER
   ======================================== */

.curtain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: all;
}

.curtain-panel {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background-color: #0F0F0F;
    transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
    overflow: hidden;
}

.curtain-left {
    left: 0;
    transform-origin: left center;
}

.curtain-right {
    right: 0;
    transform-origin: right center;
}

.curtain-texture {
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.02) 2px,
            rgba(255,255,255,0.02) 4px
        ),
        linear-gradient(
            180deg,
            rgba(255,255,255,0.05) 0%,
            transparent 20%,
            transparent 80%,
            rgba(255,255,255,0.03) 100%
        );
}

.curtain-left .curtain-texture {
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.02) 2px,
            rgba(255,255,255,0.02) 4px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,0.08) 0%,
            transparent 30%
        );
}

.curtain-right .curtain-texture {
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.02) 2px,
            rgba(255,255,255,0.02) 4px
        ),
        linear-gradient(
            -90deg,
            rgba(255,255,255,0.08) 0%,
            transparent 30%
        );
}

.curtain-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    display: flex;
    align-items: baseline;
    opacity: 1;
    transition: opacity 0.4s ease 0.8s;
}

.curtain-logo-text {
    font-family: 'Fraunces', serif;
    font-size: 4rem;
    font-weight: 700;
    color: #F2F0EB;
    letter-spacing: -0.05em;
    animation: curtainLogoReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.curtain-logo-dot {
    font-family: 'Fraunces', serif;
    font-size: 5rem;
    font-weight: 700;
    color: #FF4D00;
    line-height: 0.8;
    animation: curtainDotPulse 1.5s ease-in-out infinite;
}

.curtain-loading-line {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 1px;
    overflow: hidden;
    z-index: 101;
}

.curtain-loading-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #CCFF00, #FF4D00);
    animation: curtainLoadingProgress 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes curtainLogoReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes curtainDotPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes curtainLoadingProgress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Curtain Open State */
.curtain-container.curtain-open .curtain-left {
    transform: translateX(-100%);
}

.curtain-container.curtain-open .curtain-right {
    transform: translateX(100%);
}

.curtain-container.curtain-open .curtain-logo {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.curtain-container.curtain-open .curtain-loading-line {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.curtain-container.curtain-hidden {
    pointer-events: none;
    visibility: hidden;
}

/* ========================================
   1. BASE STYLES
   ======================================== */

body {
    background-color: #F2F0EB;
    color: #0F0F0F;
    overflow-x: hidden;
}

::selection {
    background-color: #CCFF00;
    color: #0F0F0F;
}

body.custom-cursor-active,
body.custom-cursor-active a, 
body.custom-cursor-active button, 
body.custom-cursor-active input, 
body.custom-cursor-active textarea {
    cursor: none;
}

/* ========================================
   2. PRELOADER
   ======================================== */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0F0F0F;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

#preloader.loaded {
    transform: translateY(-100%);
}

.loader-text {
    overflow: hidden;
    color: #F2F0EB;
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    display: flex;
    gap: 10px;
}

.loader-char {
    transform: translateY(100%);
    animation: revealChar 0.4s cubic-bezier(0.5, 0, 0.5, 1) forwards;
}

@keyframes revealChar {
    to { transform: translateY(0); }
}

/* ========================================
   3. MARQUEE
   ======================================== */

.marquee-container {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

/* ========================================
   4. LIGHTWEIGHT TEXTURES & ATMOSPHERE
   ======================================== */

.global-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6;
    background: radial-gradient(circle at center, transparent 50%, rgba(10,10,10,0.1) 100%);
}

.hero-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: repeating-conic-gradient(
        rgba(0,0,0,0.02) 0%,
        transparent 0.5%
    );
    background-size: 4px 4px;
    opacity: 0.8;
}

.dot-texture {
    position: relative;
}

.dot-texture::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        circle,
        rgba(0,0,0,0.03) 1px,
        transparent 1px
    );
    background-size: 20px 20px;
    pointer-events: none;
}

.subtle-grain {
    position: relative;
}

.subtle-grain::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-conic-gradient(
        rgba(255,255,255,0.015) 0%,
        transparent 0.5%
    );
    background-size: 3px 3px;
    pointer-events: none;
}

/* ========================================
   5. ANIMATIONS
   ======================================== */

@keyframes lineGrow {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ========================================
   6. REVEAL ANIMATIONS
   ======================================== */

.reveal-text {
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.reveal-wrap {
    overflow: hidden;
    display: block;
}

.in-view .reveal-text {
    transform: translateY(0);
    opacity: 1;
}

.services-grid .service-card:nth-child(1) { transition-delay: 0s; }
.services-grid .service-card:nth-child(2) { transition-delay: 0.03s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.06s; }
.services-grid .service-card:nth-child(4) { transition-delay: 0.09s; }
.services-grid .service-card:nth-child(5) { transition-delay: 0.12s; }
.services-grid .service-card:nth-child(6) { transition-delay: 0.15s; }

/* ========================================
   7. CUSTOM CURSOR
   ======================================== */

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #FF4D00;
    will-change: transform;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid #0F0F0F;
    will-change: transform;
}

/* ========================================
   8. GRID FOCUS EFFECT
   ======================================== */

.services-grid:has(.service-card:hover) .service-card:not(:hover) {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* ========================================
   9. TYPOGRAPHY EFFECTS
   ======================================== */

.text-ink {
    text-shadow: 0 1px 0 rgba(15,15,15,0.05);
}

.scramble-text {
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

.scramble-text:hover {
    color: #bd00ff;
    text-shadow: 0 0 12px rgba(189, 0, 255, 0.3);
}

/* ========================================
   10. CARD EFFECTS WITH GLOW
   ======================================== */

.card-stock {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-stock:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.12),
        0 0 0 1px rgba(204, 255, 0, 0.1);
}

.service-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.15s ease;
    background-image: url('crumpled-paper.png');
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
}

.service-card:hover {
    box-shadow: 
        0 12px 24px rgba(0,0,0,0.1),
        inset 0 0 60px rgba(204, 255, 0, 0.03);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    color: #FF4D00;
    filter: drop-shadow(0 0 6px rgba(255, 77, 0, 0.4));
    transition: transform 0.15s ease, color 0.15s ease, filter 0.15s ease;
}

/* ========================================
   11. GLOW ACCENTS
   ======================================== */

.glow-lime {
    box-shadow: 0 0 20px rgba(204, 255, 0, 0.15);
}

.glow-orange {
    box-shadow: 0 0 20px rgba(255, 77, 0, 0.15);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(189, 0, 255, 0.15);
}

.hover-glow-lime {
    transition: box-shadow 0.2s ease;
}

.hover-glow-lime:hover {
    box-shadow: 0 0 24px rgba(204, 255, 0, 0.25);
}

.hover-glow-orange {
    transition: box-shadow 0.2s ease;
}

.hover-glow-orange:hover {
    box-shadow: 0 0 24px rgba(255, 77, 0, 0.25);
}

/* Floating sticker glow animation */
.sticker-glow {
    animation: pulse-glow 3s ease-in-out infinite;
    box-shadow: 0 8px 24px rgba(255, 77, 0, 0.3);
}

/* ========================================
   12. LOGO EXPAND ANIMATION
   ======================================== */

.logo-letters {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.logo-expand:hover .logo-letters {
    max-width: 50px;
    opacity: 1;
}

/* ========================================
   13. MAGNETIC BUTTON
   ======================================== */

.magnetic-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.magnetic-btn:hover {
    box-shadow: 0 4px 12px rgba(204, 255, 0, 0.3);
}

/* ========================================
   13. FORM INPUT ANIMATION
   ======================================== */

.input-underline {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background-color: #CCFF00;
    transition: width 0.3s ease;
}

.group:focus-within .input-underline {
    width: 100%;
}

/* Input glow on focus */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 2px rgba(204, 255, 0, 0.2);
}

/* ========================================
   14. ACCESSIBILITY - REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .marquee-content {
        animation: none !important;
    }
    
    .reveal-text {
        transform: none;
        opacity: 1;
    }
}
