/* ============================================
   JOCRA PRELOADER - MOBILE FIRST RESPONSIVE
   Performance Optimized & Accessible
   ============================================ */





















   /* ============================================
   UNIVERSAL HEADER SPACING FIX - ALL PAGES
   ============================================ */

/* CSS Custom Properties for Header Heights */
:root {
    --header-height-mobile: 64px;
    --header-height-tablet: 72px;
    --header-height-desktop: 84px;
    --header-height-large: 96px;
    --topbar-height: 0px;
}

/* Body padding to account for fixed header - ALL PAGES */
body {
    padding-top: 0 !important;
}

/* Main content wrapper - ensure proper spacing */
.main-content {
    padding-top: 0;
}

/* ============================================
   TABLET (577px+)
   ============================================ */
@media (min-width: 577px) {
    body {
        padding-top: 0 !important;
    }
}

/* ============================================
   DESKTOP (1025px+) - Topbar appears
   ============================================ */
@media (min-width: 1025px) {
    :root {
        --topbar-height: 40px;
    }

    body {
        padding-top: 0 !important;
    }
}

/* ============================================
   LARGE DESKTOP (1440px+)
   ============================================ */
@media (min-width: 1440px) {
    body {
        padding-top: 0 !important;
    }
}

/* ============================================
   PAGE-SPECIFIC FIXES
   ============================================ */

/* Hero sections that were using negative margin */
.hero,
.safeguards-hero,
.about-hero,
.services-hero,
.contact-hero {
    margin-top: 0 !important;
    padding-top: 32px;
}

@media (min-width: 577px) {
    .hero,
    .safeguards-hero,
    .about-hero,
    .services-hero,
    .contact-hero {
        padding-top: 40px;
    }
}

@media (min-width: 1025px) {
    .hero,
    .safeguards-hero,
    .about-hero,
    .services-hero,
    .contact-hero {
        padding-top: 48px;
    }
}

/* Remove any old body padding classes */
body.defult-home,
body.home-page,
body.about-page,
body.services-page,
body.safeguards-page,
body.contact-page {
    padding-top: 0 !important;
}

@media (min-width: 577px) {
    body.defult-home,
    body.home-page,
    body.about-page,
    body.services-page,
    body.safeguards-page,
    body.contact-page {
        padding-top: 0 !important;
    }
}

@media (min-width: 1025px) {
    body.defult-home,
    body.home-page,
    body.about-page,
    body.services-page,
    body.safeguards-page,
    body.contact-page {
        padding-top: 0 !important;
    }
}
:root {
    --jocra-green: #2D5A3D;
    --jocra-green-light: #4A7C59;
    --jocra-red: #E63946;
    --jocra-red-dark: #C1121F;
    --jocra-dark: #0F1419;
    --jocra-charcoal: #1A1F2E;
}

/* Preloader Base - Mobile First */
.jocra-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0F1419;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Performance optimizations */
    will-change: opacity, visibility;
    contain: layout style paint;
}

/* Background Grid - GPU Optimized */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(45, 90, 61, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 90, 61, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    /* Remove animation on mobile for performance */
    animation: none;
    pointer-events: none;
}

/* Scan Line - Mobile Optimized */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(230, 57, 70, 0.5),
        rgba(230, 57, 70, 0.8),
        rgba(230, 57, 70, 0.5),
        transparent
    );
    box-shadow: 0 0 10px rgba(230, 57, 70, 0.5);
    opacity: 0.6;
    /* Slower animation on mobile for battery */
    animation: scan 4s ease-in-out infinite;
    pointer-events: none;
    will-change: top;
}

@keyframes scan {
    0%, 100% { top: 0; opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    50% { top: 100%; }
}

/* Main Container - Mobile First */
.preloader-container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 24px;
    max-width: 320px;
    width: 100%;
}

/* Radar Animation - Mobile Optimized */
.radar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
}

.radar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #E63946 0%, #C1121F 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 20px rgba(230, 57, 70, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.2);
    z-index: 10;
    /* Slower pulse on mobile */
    animation: pulseCenter 3s ease-in-out infinite;
    will-change: transform, box-shadow;
}

@keyframes pulseCenter {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px rgba(230, 57, 70, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 0 35px rgba(230, 57, 70, 0.6);
    }
}

.j-letter {
    font-size: 24px;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, #E63946, transparent);
    transform-origin: left center;
    animation: radarSweep 3s linear infinite;
    border-radius: 2px;
    filter: drop-shadow(0 0 4px rgba(230, 57, 70, 0.8));
    will-change: transform;
}

@keyframes radarSweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.radar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(45, 90, 61, 0.3);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.ring-1 {
    width: 70px;
    height: 70px;
    animation: ringPulse 3s ease-out infinite;
}

.ring-2 {
    width: 85px;
    height: 85px;
    animation: ringPulse 3s ease-out infinite 0.5s;
}

.ring-3 {
    width: 100px;
    height: 100px;
    animation: ringPulse 3s ease-out infinite 1s;
}

@keyframes ringPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
        border-color: rgba(45, 90, 61, 0.6);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
        border-color: rgba(45, 90, 61, 0);
    }
}

/* Brand Text - Mobile First */
.brand-reveal {
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.3s;
}

.brand-name {
    font-size: 32px;
    font-weight: 800;
    color: white;
    letter-spacing: 3px;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 0%, #a0aec0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    line-height: 1.1;
}

.brand-tagline {
    font-size: 11px;
    color: #4A7C59;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 6px 0;
    font-weight: 600;
    line-height: 1.3;
}

.brand-evolution {
    font-size: 10px;
    color: rgba(230, 57, 70, 0.9);
    letter-spacing: 0.8px;
    margin: 0;
    font-weight: 500;
    line-height: 1.3;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Metrics - Mobile First */
.loading-metrics {
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid rgba(45, 90, 61, 0.2);
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.6s;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

.metric-row:last-of-type {
    margin-bottom: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(45, 90, 61, 0.2);
}

.metric-label {
    color: #6B7280;
    letter-spacing: 0.8px;
}

.metric-value {
    color: #E63946;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.metric-value.secure {
    color: #4A7C59;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(45, 90, 61, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2D5A3D 0%, #E63946 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
    will-change: width;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

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

/* Corner Decorations - Hidden on Mobile */
.corner-decoration {
    display: none;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   TABLET BREAKPOINT (577px+)
   ============================================ */

@media (min-width: 577px) {
    .preloader-container {
        padding: 32px;
        max-width: 400px;
    }

    .radar-wrapper {
        width: 120px;
        height: 120px;
        margin-bottom: 32px;
    }

    .radar-center {
        width: 60px;
        height: 60px;
        border-radius: 12px;
        animation: pulseCenter 2.5s ease-in-out infinite;
    }

    .j-letter {
        font-size: 28px;
    }

    .radar-sweep {
        animation: radarSweep 2.5s linear infinite;
    }

    .ring-1 {
        width: 80px;
        height: 80px;
        animation: ringPulse 2.5s ease-out infinite;
    }

    .ring-2 {
        width: 100px;
        height: 100px;
        animation: ringPulse 2.5s ease-out infinite 0.5s;
    }

    .ring-3 {
        width: 120px;
        height: 120px;
        animation: ringPulse 2.5s ease-out infinite 1s;
    }

    .brand-name {
        font-size: 38px;
        letter-spacing: 4px;
    }

    .brand-tagline {
        font-size: 12px;
        letter-spacing: 2px;
    }

    .brand-evolution {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .loading-metrics {
        padding: 20px;
    }

    .metric-row {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .scan-line {
        animation: scan 3.5s ease-in-out infinite;
    }
}

/* ============================================
   DESKTOP BREAKPOINT (1025px+)
   ============================================ */

@media (min-width: 1025px) {
    .preloader-container {
        padding: 40px;
        max-width: 500px;
    }

    .radar-wrapper {
        width: 140px;
        height: 140px;
        margin-bottom: 40px;
    }

    .radar-center {
        width: 70px;
        height: 70px;
        animation: pulseCenter 2s ease-in-out infinite;
    }

    .j-letter {
        font-size: 32px;
    }

    .radar-sweep {
        animation: radarSweep 2s linear infinite;
    }

    .ring-1 {
        width: 90px;
        height: 90px;
        animation: ringPulse 2s ease-out infinite;
    }

    .ring-2 {
        width: 115px;
        height: 115px;
        animation: ringPulse 2s ease-out infinite 0.5s;
    }

    .ring-3 {
        width: 140px;
        height: 140px;
        animation: ringPulse 2s ease-out infinite 1s;
    }

    .brand-name {
        font-size: 42px;
        letter-spacing: 4px;
        margin-bottom: 12px;
    }

    .brand-tagline {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .brand-evolution {
        font-size: 11px;
    }

    .loading-metrics {
        padding: 24px;
    }

    .metric-row {
        font-size: 12px;
        margin-bottom: 14px;
    }

    /* Show corner decorations on desktop */
    .corner-decoration {
        display: block;
        position: absolute;
        width: 30px;
        height: 30px;
        border: 2px solid rgba(45, 90, 61, 0.3);
    }

    .corner-decoration.top-left {
        top: 20px;
        left: 20px;
        border-right: none;
        border-bottom: none;
    }

    .corner-decoration.top-right {
        top: 20px;
        right: 20px;
        border-left: none;
        border-bottom: none;
    }

    .corner-decoration.bottom-left {
        bottom: 20px;
        left: 20px;
        border-right: none;
        border-top: none;
    }

    .corner-decoration.bottom-right {
        bottom: 20px;
        right: 20px;
        border-left: none;
        border-top: none;
    }

    .grid-overlay {
        animation: gridMove 20s linear infinite;
    }

    .scan-line {
        animation: scan 3s ease-in-out infinite;
    }
}

/* ============================================
   EXIT ANIMATIONS
   ============================================ */

.jocra-preloader.fade-out {
    animation: fadeOut 0.6s ease forwards;
    pointer-events: none;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.jocra-preloader.fade-out .preloader-container {
    animation: scaleOut 0.4s ease forwards;
}

@keyframes scaleOut {
    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* ============================================
   REDUCED MOTION PREFERENCES
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .jocra-preloader {
        transition: opacity 0.3s ease;
    }

    .grid-overlay,
    .scan-line,
    .radar-sweep,
    .radar-ring,
    .radar-center,
    .progress-fill::after,
    .brand-reveal,
    .loading-metrics {
        animation: none !important;
    }

    .progress-fill {
        transition: width 0.1s linear;
    }

    .brand-reveal,
    .loading-metrics {
        opacity: 1;
        transform: none;
    }

    .radar-ring {
        opacity: 0.3;
    }
}

/* ============================================
   HIGH CONTRAST MODE SUPPORT
   ============================================ */

@media (prefers-contrast: high) {
    .radar-center {
        border: 3px solid white;
    }

    .progress-bar {
        border: 2px solid white;
    }

    .loading-metrics {
        border-width: 2px;
    }
}

/* ============================================
   FOCUS VISIBLE FOR ACCESSIBILITY
   ============================================ */

:focus-visible {
    outline: 3px solid var(--jocra-red);
    outline-offset: 2px;
}