/* ============================================
   MAPPIN LANDING — BASE FOUNDATION
   ============================================ */

/* ---------- CSS RESET & BASE ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    background: #050510;
    color: #cbd5e1;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ---------- CSS CUSTOM PROPERTIES ---------- */
:root {
    /* Base colors */
    --ink-950: #050510;
    --ink-900: #0a0a1a;
    --ink-800: #12122a;
    --ink-700: #1a1a35;
    --ink-600: #232345;

    /* Brand palette */
    --brand-primary: #7c5cff;
    --brand-secondary: #6d3fff;
    --brand-glow: rgba(124, 92, 255, 0.5);

    /* Accent colors */
    --violet: #a855f7;
    --cyan: #06b6d4;
    --emerald: #10b981;
    --amber: #f59e0b;
    --rose: #f43f5e;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-dim: #475569;

    /* Borders */
    --border-subtle: rgba(148, 163, 184, 0.08);
    --border-default: rgba(148, 163, 184, 0.12);
    --border-strong: rgba(148, 163, 184, 0.2);

    /* Glass */
    --glass-bg: rgba(15, 15, 35, 0.5);
    --glass-border: rgba(148, 163, 184, 0.1);

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #7c5cff 0%, #a855f7 50%, #06b6d4 100%);
    --gradient-text: linear-gradient(135deg, #a5a8ff 0%, #c084fc 50%, #67e8f9 100%);
    --gradient-glow: radial-gradient(circle, rgba(124, 92, 255, 0.4) 0%, transparent 70%);

    /* Shadows */
    --shadow-glow-brand: 0 0 40px rgba(124, 92, 255, 0.3);
    --shadow-elevation-1: 0 4px 20px -4px rgba(0, 0, 0, 0.5);
    --shadow-elevation-2: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
    --shadow-elevation-3: 0 40px 100px -30px rgba(124, 92, 255, 0.3);
}

/* ---------- TYPOGRAPHY ---------- */
.font-display {
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.03em;
    font-weight: 800;
}

.font-serif-elegant {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.text-gradient-brand {
    background: linear-gradient(135deg, #7c5cff 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ---------- NOISE TEXTURE OVERLAY ---------- */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    will-change: opacity;
    transform: translateZ(0);
}

/* ---------- GRADIENT MESH BACKGROUND ---------- */
.gradient-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(at 20% 20%, rgba(124, 92, 255, 0.12) 0px, transparent 50%),
        radial-gradient(at 80% 10%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
        radial-gradient(at 10% 90%, rgba(124, 92, 255, 0.08) 0px, transparent 50%);
    transform: translateZ(0);
    will-change: transform;
}

/* ---------- PARTICLES CANVAS ---------- */
.particles-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    transform: translateZ(0);
    will-change: transform;
}

/* ---------- CURSOR GLOW (Desktop) ---------- */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(124, 92, 255, 0.07) 0%,
        rgba(168, 85, 247, 0.03) 30%,
        transparent 70%);
    pointer-events: none;
    z-index: 3;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
    opacity: 0;
    mix-blend-mode: screen;
    will-change: transform;
    transform: translate3d(-50%, -50%, 0);
}

@media (max-width: 1024px) {
    .cursor-glow { display: none; }
}

/* DISABLE HEAVY EFFECTS ON SCROLL (added by JS) */
body.is-scrolling .cursor-glow {
    opacity: 0 !important;
}

body.is-scrolling .particles-canvas {
    opacity: 0.15;
    transition: opacity 0.2s ease;
}

/* ---------- SCROLL PROGRESS BAR ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, #7c5cff, #a855f7, #06b6d4);
    z-index: 100;
    transform: scaleX(0);
    transform-origin: left;
    box-shadow: 0 0 10px rgba(124, 92, 255, 0.5);
    will-change: transform;
}

/* ---------- REUSABLE GLASS CARD ---------- */
.glass {
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.1);
}


.glass-strong {
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.glass-subtle {
    background: rgba(15, 15, 35, 0.4);
    /* Removed backdrop-filter — too expensive for many elements */
    border: 1px solid rgba(148, 163, 184, 0.06);
}

/* ---------- GLOW EFFECTS ---------- */
.glow-brand {
    box-shadow: 0 0 40px rgba(124, 92, 255, 0.3), 0 0 80px rgba(124, 92, 255, 0.15);
}

.glow-violet {
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.3);
}

.glow-cyan {
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
}

/* ---------- GRADIENT BORDERS (Premium Look) ---------- */
.gradient-border {
    position: relative;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg,
        rgba(124, 92, 255, 0.4) 0%,
        rgba(148, 163, 184, 0.1) 30%,
        rgba(148, 163, 184, 0.1) 70%,
        rgba(6, 182, 212, 0.3) 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
}

/* ---------- BUTTONS (Reusable) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.875rem 1.75rem;
    border-radius: 0.875rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #7c5cff 0%, #6d3fff 100%);
    color: white;
    box-shadow: 0 8px 24px -8px rgba(124, 92, 255, 0.5),
                0 0 0 1px rgba(124, 92, 255, 0.2) inset;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -8px rgba(124, 92, 255, 0.6),
                0 0 0 1px rgba(124, 92, 255, 0.3) inset;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover::before { opacity: 1; }

.btn-secondary {
    background: rgba(148, 163, 184, 0.05);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(20px);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.3);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.05);
    border-color: rgba(148, 163, 184, 0.3);
    color: white;
}

/* ---------- BADGES ---------- */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
    backdrop-filter: blur(12px);
}

.badge-brand {
    background: rgba(124, 92, 255, 0.1);
    color: #a5a8ff;
    border-color: rgba(124, 92, 255, 0.25);
}

.badge-emerald {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.25);
}

.badge-cyan {
    background: rgba(6, 182, 212, 0.1);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.25);
}

.badge-violet {
    background: rgba(168, 85, 247, 0.1);
    color: #d8b4fe;
    border-color: rgba(168, 85, 247, 0.25);
}

.badge-amber {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.25);
}

/* ---------- LIVE DOT (Pulsing) ---------- */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    position: relative;
}

.live-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: #10b981;
    opacity: 0.4;
    animation: pulse-ring 2s ease-out infinite;
}

/* ---------- SECTION SPACING ---------- */
.section-padding {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

@media (max-width: 768px) {
    .section-padding {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* ---------- SCROLLBAR STYLING ---------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background-color: #6d3fff;
    border-radius: 10px;
    border: 2px solid #050510; /* creates a "gap" around thumb without gradient */
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #7c5cff;
}

::-webkit-scrollbar-thumb:active {
    background-color: #a855f7;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #6d3fff transparent;
}

/* Hide scrollbar in Safari for cleaner look on iOS */
@supports (-webkit-touch-callout: none) {
    ::-webkit-scrollbar {
        width: 0;
        display: none;
    }
}

/* ---------- ACCESSIBILITY ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- FOCUS STATES ---------- */
:focus-visible {
    outline: 2px solid #7c5cff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- MOBILE OPTIMIZATIONS ---------- */
@media (max-width: 768px) {
    .cursor-glow,
    .particles-canvas {
        display: none;
    }
    
    .gradient-mesh {
        opacity: 0.5;
    }
}