/* =========================================
   Origin Alley — Custom Styles
   Colors: Primary #1a3050 | Secondary #2e86c1
   ========================================= */

/* ---- CSS Variables ---- */
:root {
    --primary: #1a3050;
    --secondary: #2e86c1;
}

/* ---- Global ---- */
::selection {
    background: rgba(46, 134, 193, 0.2);
    color: #1a3050;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Primary Button ---- */
.btn-primary {
    background: #2e86c1;
    color: #ffffff;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
    background: #256fa3;
    box-shadow: 0 8px 24px rgba(46, 134, 193, 0.25);
}

/* ---- Navigation ---- */
#navbar {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.85);
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

.nav-link {
    color: #4b5563;
}

.nav-link:hover {
    color: #1a3050;
    background: rgba(46, 134, 193, 0.05);
}

.mobile-nav-link {
    color: #4b5563;
}

.mobile-nav-link:hover {
    color: #1a3050;
    background: rgba(46, 134, 193, 0.05);
}

/* ---- Hero Grid Background ---- */
.hero-grid {
    background-image:
        linear-gradient(rgba(46, 134, 193, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 134, 193, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ---- Global Section Grid (hero-style on every section & footer) ---- */
section,
footer {
    position: relative;
    isolation: isolate;
}

section::before,
footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(46, 134, 193, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 134, 193, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   Alternating Primary-Dark Sections
   Even sections get the dark primary background;
   odd sections stay light (body bg-slate-50).
   ============================================ */
section:nth-of-type(even) {
    background-color: #1a3050 !important;
}

/* Grid → white lines on dark sections */
section:nth-of-type(even)::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) !important;
}

/* --- Dark section text --- */
section:nth-of-type(even) {
    color: #94a3b8;
}

section:nth-of-type(even) h1,
section:nth-of-type(even) h2,
section:nth-of-type(even) h3,
section:nth-of-type(even) h4,
section:nth-of-type(even) h5,
section:nth-of-type(even) strong {
    color: #f1f5f9 !important;
}

section:nth-of-type(even) .text-primary {
    color: #ffffff !important;
}

section:nth-of-type(even) .text-gray-400,
section:nth-of-type(even) .text-gray-500,
section:nth-of-type(even) .text-gray-600,
section:nth-of-type(even) .text-gray-700,
section:nth-of-type(even) .text-gray-800,
section:nth-of-type(even) .text-gray-900 {
    color: #94a3b8 !important;
}

section:nth-of-type(even) .text-secondary {
    color: #5ba3d9 !important;
}

section:nth-of-type(even) .text-yellow-400,
section:nth-of-type(even) .text-yellow-500 {
    color: #facc15 !important;
}

section:nth-of-type(even) .text-white,
section:nth-of-type(even) .btn-primary {
    color: #ffffff !important;
}

/* --- Borders on dark sections --- */
section:nth-of-type(even) [class*="border-gray"] {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

section:nth-of-type(even) [class*="divide-gray"] > * + * {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* --- Inner gray bg → semi-transparent on dark --- */
section:nth-of-type(even) [class*="bg-gray-5"],
section:nth-of-type(even) [class*="bg-gray-1"] {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* --- Restore text inside white cards --- */
section:nth-of-type(even) .bg-white h3,
section:nth-of-type(even) .bg-white h4,
section:nth-of-type(even) .bg-white h5 {
    color: #1a3050 !important;
}

section:nth-of-type(even) .bg-white p,
section:nth-of-type(even) .bg-white li,
section:nth-of-type(even) .bg-white small {
    color: #4b5563 !important;
}

section:nth-of-type(even) .bg-white .text-primary {
    color: #1a3050 !important;
}

section:nth-of-type(even) .bg-white .text-secondary {
    color: #2e86c1 !important;
}

section:nth-of-type(even) .bg-white .text-gray-400 {
    color: #9ca3af !important;
}

section:nth-of-type(even) .bg-white .text-gray-500 {
    color: #6b7280 !important;
}

section:nth-of-type(even) .bg-white .text-gray-600 {
    color: #4b5563 !important;
}

section:nth-of-type(even) .bg-white [class*="border-gray"] {
    border-color: #f3f4f6 !important;
}

section:nth-of-type(even) .bg-white [class*="bg-gray-5"],
section:nth-of-type(even) .bg-white [class*="bg-gray-1"] {
    background-color: #f9fafb !important;
}

/* ---- Mosaic Pattern ---- */
.mosaic-pattern {
    background-image:
        linear-gradient(45deg, #2e86c1 25%, transparent 25%),
        linear-gradient(-45deg, #2e86c1 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2e86c1 75%),
        linear-gradient(-45deg, transparent 75%, #2e86c1 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
}

/* ---- Floating Particles (Geometric Squares) ---- */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    background: var(--secondary);
    opacity: 0.18;
    border-radius: 4px;
    animation: particleFloat var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.12;
    }
    25% {
        transform: translate(30px, -50px) rotate(45deg) scale(1.1);
        opacity: 0.22;
    }
    50% {
        transform: translate(-20px, -80px) rotate(90deg) scale(0.9);
        opacity: 0.18;
    }
    75% {
        transform: translate(40px, -30px) rotate(135deg) scale(1.05);
        opacity: 0.15;
    }
}

/* ---- Scroll Reveal Animation ---- */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Scroll Dot in Hero ---- */
@keyframes scroll-dot {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(6px); opacity: 0.3; }
    100% { transform: translateY(0); opacity: 1; }
}

.animate-scroll-dot {
    animation: scroll-dot 2s ease-in-out infinite;
}

/* ---- Floating Animation ---- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* ---- Slow Pulse ---- */
.animate-pulse-slow {
    animation: pulse-slow 6s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* ---- Service Card Hover ---- */
.service-card {
    transform: translateY(0);
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ---- Counter Animation ---- */
[data-counter] {
    display: inline-block;
}

/* ---- Responsive Polish ---- */
@media (max-width: 640px) {
    .hero-particles .particle:nth-child(n+6) {
        display: none;
    }
}

/* ---- Smooth anchor scrolling offset for sticky nav ---- */
[id] {
    scroll-margin-top: 80px;
}

/* ---- Focus Styles for Accessibility ---- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2e86c1;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2e86c1;
}

/* ---- Print Styles ---- */
@media print {
    nav, .hero-particles, .animate-float, .animate-pulse-slow {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
}
