/* ================================
   EkNaam Studios - Global Styles
   Foundation & Reset
   ================================ */

/* Modern CSS Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Selection Colors */
::selection {
    background-color: var(--accent-red);
    color: var(--bg-primary);
}

::-moz-selection {
    background-color: var(--accent-red);
    color: var(--bg-primary);
}

/* Focus States for Accessibility */
:focus-visible {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-base) var(--ease-smooth);
}

a:hover {
    color: var(--accent-red);
}

/* Image defaults */
img,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Button reset */
button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

/* List reset */
ul,
ol {
    list-style: none;
}

/* Typography Base Styles */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-6xl);
    font-weight: var(--weight-black);
}

h2 {
    font-size: var(--text-5xl);
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

p {
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
}

/* Container Utility */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Section Spacing */
section {
    padding: var(--space-20) 0;
}

@media (max-width: 767px) {
    section {
        padding: var(--space-12) 0;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center {
    text-align: center;
}

/* Visually Hidden Utility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === BACK TO TOP BUTTON === */
.back-to-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 9990;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.back-to-top:hover {
    background: rgba(230, 57, 70, 0.15);
    border-color: rgba(230, 57, 70, 0.4);
    box-shadow: 0 0 30px rgba(230, 57, 70, 0.3);
    color: var(--accent-red);
}

.back-to-top:hover svg {
    transform: translateY(-3px);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    transition: background var(--duration-base) var(--ease-smooth);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), #ff4d5a);
    z-index: 10000;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.1s ease-out;
}

/* Text Scrub Reveal Animation Base */
.text-reveal {
    background: linear-gradient(to right, var(--text-primary) 50%, var(--text-muted) 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.1s ease-out;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ================================
   Custom Cursor System
   ================================ */
@media (pointer: fine) {

    /* Hide default cursor on desktop devices */
    body {
        cursor: none;
    }

    /* Links and interactive elements also hide cursor */
    a,
    button,
    input,
    select,
    textarea,
    .glass-card,
    .service-card,
    .package-card,
    .faq-question {
        cursor: none;
    }
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-red);
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 50%;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease;
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(230, 57, 70, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 50%;
    z-index: 999998;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out, width 0.2s ease, height 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

/* Active Hover State Custom Cursor */
.cursor-dot.active {
    width: 10px;
    height: 10px;
}

.cursor-outline.active {
    width: 45px;
    height: 45px;
    border-color: rgba(230, 57, 70, 0.8);
    background-color: rgba(230, 57, 70, 0.05);
}

/* Custom Cursor Text State */
.cursor-dot.has-text {
    width: 60px;
    height: 60px;
    background-color: var(--text-primary);
    mix-blend-mode: difference;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cursor-dot.has-text::after {
    content: attr(data-cursor-text);
    font-size: 10px;
    font-weight: 800;
    color: var(--bg-primary);
    letter-spacing: 1px;
}

.cursor-outline.has-text {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
}


/* ================================
   Cinematic Noise Overlay
   ================================ */
.noise-overlay {
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200vw;
    height: 200vh;
    /* Create a grain texture using SVG data URI for best performance/look without external images */
    background: transparent url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E') repeat;
    opacity: 0.04;
    /* Very subtle, 4% opacity */
    pointer-events: none;
    z-index: 9997;
    /* Just below custom cursor */
    animation: grainAnimation 8s steps(10) infinite;
}

@keyframes grainAnimation {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -10%);
    }

    20% {
        transform: translate(-15%, 5%);
    }

    30% {
        transform: translate(7%, -25%);
    }

    40% {
        transform: translate(-5%, 25%);
    }

    50% {
        transform: translate(-15%, 10%);
    }

    60% {
        transform: translate(15%, 0%);
    }

    70% {
        transform: translate(0%, 15%);
    }

    80% {
        transform: translate(3%, 35%);
    }

    90% {
        transform: translate(-10%, 10%);
    }
}