/* ============================================
   HARKA DIGITAL — Full Page Build
   ============================================ */
:root {
    --lens-x: -9999px;
    --lens-y: -9999px;
    --rim-x: -9999px;
    --rim-y: -9999px;
}

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    background-color: #050510;
    margin: 0;
}

/* ===== PRELOADER ===== */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #050510;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-bar-track {
    width: 200px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.preloader-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #FB7185, #F59E0B);
    border-radius: 2px;
    animation: preloaderSlide 1.8s ease-in-out infinite;
}

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

    50% {
        transform: translateX(350%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ===== Z-INDEX 0: CANVAS ===== */
#pixi-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ===== Z-INDEX 1: GLOBAL VIGNETTE ===== */
#global-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(
        ellipse 80% 70% at 50% 45%,
        transparent 25%,
        rgba(5, 5, 16, 0.45) 65%,
        rgba(5, 5, 16, 0.85) 100%
    );
}

/* Keep old id for backwards compat if JS references it */
#vignette-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(
        ellipse 80% 70% at 50% 45%,
        transparent 25%,
        rgba(5, 5, 16, 0.45) 65%,
        rgba(5, 5, 16, 0.85) 100%
    );
}

/* ===== HERO SECTION ===== */
#hero-section {
    position: relative;
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    background: transparent;
    padding: 80px 16px 10px;
    pointer-events: none;
}

/* ===== TEXT CONTAINER ===== */
#hero-text-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 200px;
    pointer-events: auto;
    cursor: none;
}

@media (min-width: 768px) {
    #hero-text-container {
        height: 240px;
    }
}

@media (min-width: 1024px) {
    #hero-text-container {
        height: 280px;
    }
}

/* ===== HEADINGS ===== */
.hero-heading {
    font-size: clamp(2rem, 10vw, 6.5rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    text-align: center;
}

/* =========================================================
   DUAL INVERTED MASKS + GPU ACCELERATION
   ========================================================= */

/* ENGLISH (Z-10): Visible EVERYWHERE, transparent INSIDE the 120px circle */
#english-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    color: #FFFFFF;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: translateZ(0);
    will-change: mask-image, transform;
    -webkit-mask-image: radial-gradient(circle 120px at var(--lens-x) var(--lens-y), transparent 0%, transparent 95%, black 100%);
    mask-image: radial-gradient(circle 120px at var(--lens-x) var(--lens-y), transparent 0%, transparent 95%, black 100%);
}

/* ARABIC (Z-20): ONLY visible INSIDE the 120px circle */
#arabic-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    background: transparent;
    opacity: 1;
    pointer-events: none;
    transform: translateZ(0);
    will-change: mask-image, transform;
    -webkit-mask-image: radial-gradient(circle 120px at var(--lens-x) var(--lens-y), black 0%, black 95%, transparent 100%);
    mask-image: radial-gradient(circle 120px at var(--lens-x) var(--lens-y), black 0%, black 95%, transparent 100%);
}

/* Arabic text chromatic aberration */
#arabic-layer .hero-heading {
    color: #FFFFFF;
    opacity: 1;
    text-shadow:
        -2px 1px 0 rgba(59, 130, 246, 0.4),
        2px -1px 0 rgba(251, 113, 133, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.5);
    transform: scale(1.04);
    transform-origin: var(--lens-x) var(--lens-y);
}

/* =========================================================
   Z-INDEX 25: GLASS BUBBLE RIM
   ========================================================= */
#glass-bubble-rim {
    position: fixed;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    z-index: 25;
    pointer-events: none;
    left: var(--rim-x);
    top: var(--rim-y);
    transform: translate(-50%, -50%) translateZ(0);
    border: none;
    outline: none;
    box-shadow:
        inset 4px 6px 15px rgba(255, 255, 255, 0.25),
        inset -4px -6px 15px rgba(0, 0, 0, 0.5),
        0 15px 35px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.12) 0%,
            transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: left, top, opacity, transform;
}

#glass-bubble-rim::before,
#glass-bubble-rim::after {
    display: none !important;
    content: none !important;
}

/* ===== MOBILE (<= 768px) ===== */
@media (max-width: 767px) {
    #pixi-container {
        transform: scale(1.2);
    }

    #hero-text-container {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: default;
    }

    #english-layer {
        position: relative !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
        transform: none !important;
    }

    #arabic-layer {
        display: none !important;
    }

    #glass-bubble-rim {
        display: none !important;
    }
}

/* ===== NAVIGATION ===== */
#main-nav {
    opacity: 0;
}

#main-nav .nav-content {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

#main-nav.nav-glass .nav-content {
    background: rgba(20, 20, 25, 0.85);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    border-color: rgba(245, 158, 11, 0.25);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.04);
}

/* Scroll Fade Direction Logic */
#main-nav.nav-scrolling-down .nav-content {
    background: rgba(20, 20, 25, 0.5);
    border-color: rgba(245, 158, 11, 0.1);
}

#main-nav.nav-scrolling-down .nav-anchor {
    opacity: 0.4;
}

#main-nav.nav-hidden {
    transform: translateY(-110%);
}

.nav-anchor {
    position: relative;
}

.nav-anchor.is-active {
    color: #8B5CF6;
}

.nav-anchor.is-active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8B5CF6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* ===== CTA ===== */
.hero-cta-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #ffffff;
    font-weight: 700;
    border-radius: 100px;
    padding: 16px 36px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    z-index: 100;
}

.hero-cta-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 100px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1));
    -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;
    pointer-events: none;
}

.hero-cta-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
}

.hero-cta-pulse {
    animation: pulseScale 4s ease-in-out infinite alternate;
}

@keyframes pulseScale {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.02);
    }
}

/* Fade-in elements */
.hero-fade-element {
    opacity: 0;
    transform: translateY(20px);
}

/* =========================================================
   MAIN CONTENT — Semi-transparent over fixed canvas
   ========================================================= */
#main-content {
    position: relative;
    z-index: 2;
}

/* ===== SECTION: PAIN POINTS ===== */
#pain-points {
    background: transparent;
}

.pain-image {
    opacity: 0;
    transform: translateY(40px) scale(0.92);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.pain-image.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.pain-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.pain-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

.timeline-dot {
    transition: opacity 0.5s ease;
}

/* ===== SECTION: BEFORE/AFTER ===== */
#before-after {
    background: transparent;
}

.ba-badge {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.ba-before {
    transform: translateX(-30px);
}
.ba-after {
    transform: translateX(30px);
}
.ba-badge.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ===== SECTION: SERVICES ===== */
#services {
    background: transparent;
}

.svc-pillar {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.svc-pillar.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Glow border */
.svc-pillar::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from 180deg, transparent 60%, currentColor 75%, transparent 90%);
    -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.8s ease;
}
.svc-pillar.revealed::before {
    opacity: 0.2;
}

.svc-dot {
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.svc-dot.revealed {
    opacity: 1;
    transform: scale(1);
}

.svc-item h4 {
    transition: color 0.3s ease;
}
.svc-item:hover h4 {
    color: #8B5CF6;
}

/* ===== SECTION: SOCIAL PROOF MARQUEE ===== */
.marquee-track {
    animation: marqueeScroll 45s linear infinite;
    width: max-content;
}

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

.marquee-fade-start {
    background: linear-gradient(to right, #050510, transparent);
}
.marquee-fade-end {
    background: linear-gradient(to left, #050510, transparent);
}

@media (max-width: 767px) {
    .marquee-track {
        animation-duration: 70s;
    }
    .marquee-card {
        width: 320px !important;
    }
}

@media (hover: hover) {
    .marquee-track:hover {
        animation-play-state: paused;
    }
}

/* ===== SECTION: BOOKING + FAQ ===== */
#book iframe {
    color-scheme: dark;
}

.faq-item {
    background: rgba(255, 255, 255, 0.01);
    transition: border-color 0.3s ease;
}
.faq-item:hover {
    border-color: rgba(139, 92, 246, 0.15);
}

.faq-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}
.faq-trigger:focus-visible {
    outline: 2px solid #8B5CF6;
    outline-offset: -2px;
    border-radius: 10px;
}

.faq-icon {
    line-height: 1;
}

/* ===== FOOTER ===== */
#footer a {
    transition: color 0.3s ease;
}
#footer a:focus-visible {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

/* ===== SCROLL REVEAL GENERIC ===== */
/* CSS rules removed because GSAP handles the initial hide and animation via gsap.from() */
.scroll-reveal {
    will-change: transform, opacity;
}

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

/* ===== SERVICES GLOW BORDER ===== */
.svc-pillar {
    z-index: 1; /* relative positioning required for inset */
}
.svc-pillar::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from 180deg, transparent 60%, currentColor 75%, transparent 90%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: -1;
}
.svc-pillar.revealed::before {
    opacity: 0.3;
}

/* ===== FADE AWAY LOGIC ===== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, filter 0.8s ease-out;
    will-change: opacity, transform, filter;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}