/* ==========================================================================
   CSS Custom Properties & Theming
   Note: Dynamic vars (--c-gold, --c-navy, --f-heading, etc) are loaded 
   from PHP in views/layouts/main.php. These are fallbacks.
   ========================================================================== */
:root {
    /* Fallback values (normally overridden by PHP in main.php) */
    --c-gold: var(--color-secondary, #d4a843);
    --c-navy: var(--color-primary, #1e3a8a);
    --f-heading: var(--font-heading, 'Inter', sans-serif);
    --f-body: var(--font-body, 'Roboto', sans-serif);
    --f-size-base: var(--font-size-base, 16px);

    /* Light Theme Core Colors */
    --c-bg: #ffffff;
    --c-bg2: #f8f5ef;
    --c-surface: #f0ede8;
    --c-text: #1a1a2e;
    --c-text2: #555566;

    /* Layout Variables */
    --site-width: 1280px;
    --nav-height: 80px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Transitions */
    --trans-fast: 0.15s ease;
    --trans-base: 0.3s ease;
    --trans-slow: 0.5s ease;
}

[data-theme="dark"] {
    /* Dark Theme Core Colors */
    --c-bg: #06090F;
    --c-bg2: #0C1220;
    --c-surface: #151e2e;
    --c-text: #E8EAF0;
    --c-text2: #8A93A8;
}

/* ==========================================================================
   Reset + Base Typography
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--f-size-base);
    scroll-behavior: smooth;
}

body {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: var(--f-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--trans-base), color var(--trans-base);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--f-heading);
    color: var(--c-text);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

p {
    margin-bottom: 1.5rem;
    color: var(--c-text2);
}

a {
    color: var(--c-navy);
    text-decoration: none;
    transition: color var(--trans-base);
}

a:hover {
    color: var(--c-gold);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.container {
    width: 100%;
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--c-gold);
    color: #fff;
    padding: 8px;
    z-index: 9999;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible styles */
:focus-visible {
    outline: 3px solid var(--c-gold);
    outline-offset: 3px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.75rem;
    background-color: var(--c-navy);
    color: #fff !important;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--f-heading);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform var(--trans-fast), box-shadow var(--trans-fast), background-color var(--trans-fast);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: var(--c-gold);
}

.btn-outline {
    background: transparent;
    color: var(--c-text) !important;
    border: 2px solid var(--c-navy);
}

.btn-outline:hover {
    background: var(--c-navy);
    color: #fff !important;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    background: transparent;
    transition: background var(--trans-base), backdrop-filter var(--trans-base), box-shadow var(--trans-base);
}

.site-header.scrolled {
    background: rgba(var(--c-bg-rgb, 255, 255, 255), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .site-header.scrolled {
    background: rgba(6, 9, 15, 0.85);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand-logo img {
    max-height: 80px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu>li>a {
    color: var(--c-text);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu>li>a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--c-gold);
    transition: width var(--trans-base);
}

.nav-menu>li>a:hover::after {
    width: 100%;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--c-bg);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--trans-base);
    padding: 1rem 0;
    border: 1px solid var(--c-surface);
}

.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--c-text2);
    font-weight: 500;
    transition: background var(--trans-fast), color var(--trans-fast);
}

.dropdown-content a:hover {
    background: var(--c-bg2);
    color: var(--c-navy);
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-height) + 2rem) 0 4rem;
    background-color: var(--c-bg2);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(var(--c-surface) 1px, transparent 1px),
        linear-gradient(90deg, var(--c-surface) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-tagline {
    display: inline-block;
    color: var(--c-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    border-top: 1px solid var(--c-surface);
    padding-top: 2rem;
}

.stat-item .counter {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--f-heading);
    color: var(--c-navy);
    line-height: 1;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-item .label {
    font-size: 0.9rem;
    color: var(--c-text2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ==========================================================================
   Marquee Ticker Strip
   ========================================================================== */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: var(--c-navy);
    color: #fff;
    padding: 1rem 0;
    display: flex;
    white-space: nowrap;
}

.ticker {
    display: flex;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    font-family: var(--f-heading);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0 2rem;
}

.ticker-item::after {
    content: '•';
    margin-left: 4rem;
    color: var(--c-gold);
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-section {
    padding: 8rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-badge {
    position: absolute;
    bottom: 2rem;
    right: -2rem;
    background: var(--c-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Services Grid
   ========================================================================== */
.services-section {
    padding: 4rem 0;
    background: var(--c-bg2);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.service-card {
    background: var(--c-bg);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-md);
    transition: transform var(--trans-base), box-shadow var(--trans-base);
    border: 1px solid var(--c-surface);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border-color: var(--c-gold);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--c-navy);
    display: inline-block;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.service-link {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   Why Us (Sticky Layout)
   ========================================================================== */
.why-us-section {
    padding: 8rem 0;
}

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: flex-start;
}

.why-sticky {
    position: sticky;
    top: 120px;
}

.why-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.why-card {
    background: var(--c-bg2);
    padding: 3rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--c-gold);
}

/* ==========================================================================
   Technology Stack
   ========================================================================== */
.tech-section {
    padding: 6rem 0;
    background: var(--c-surface);
    text-align: center;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.tech-item {
    font-size: 3rem;
    color: var(--c-text2);
    transition: color var(--trans-fast), transform var(--trans-fast);
}

.tech-item:hover {
    color: var(--c-navy);
    transform: scale(1.1);
}

/* ==========================================================================
   Process Steps
   ========================================================================== */
.process-section {
    padding: 8rem 0;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    position: relative;
    margin-top: 4rem;
}

.process-grid::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: var(--c-surface);
    z-index: 1;
}

.process-step {
    position: relative;
    z-index: 2;
    text-align: center;
}

.process-num {
    width: 60px;
    height: 60px;
    background: var(--c-navy);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-heading);
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 0 10px var(--c-bg);
}

/* ==========================================================================
   Testimonials
   ========================================================================== */
.testimonials-section {
    padding: 4rem 0;
    background: var(--c-bg2);
    overflow: hidden;
}

.testi-slider {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 2rem;
}

.testi-slider::-webkit-scrollbar {
    display: none;
}

.testi-card {
    min-width: 400px;
    background: var(--c-bg);
    padding: 3rem;
    border-radius: var(--radius-lg);
    scroll-snap-align: start;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.testi-stars {
    color: var(--c-gold);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.testi-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 2rem;
}

.testi-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testi-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.testi-author-info h4 {
    margin: 0;
    font-size: 1rem;
}

.testi-author-info span {
    font-size: 0.85rem;
    color: var(--c-text2);
}

/* ==========================================================================
   Client Logo Strip
   ========================================================================== */
.clients-section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--c-surface);
}

.clients-marquee {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.clients-marquee::before,
.clients-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.clients-marquee::before {
    left: 0;
    background: linear-gradient(to right, var(--c-bg), transparent);
}

.clients-marquee::after {
    right: 0;
    background: linear-gradient(to left, var(--c-bg), transparent);
}

.clients-track {
    display: inline-flex;
    gap: 4rem;
    align-items: center;
    animation: marquee 40s linear infinite;
    padding: 0 2rem;
}

.clients-track > * {
    flex-shrink: 0;
}

.client-logo {
    height: 80px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    filter: grayscale(1) opacity(0.6);
    transition: filter var(--trans-base);
}

.client-logo:hover {
    filter: grayscale(0) opacity(1);
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-section {
    padding: 8rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    background: var(--c-navy);
    color: #fff;
    padding: 4rem;
    border-radius: var(--radius-lg);
}

.contact-info h2 {
    color: #fff;
}

.contact-info a {
    color: var(--c-gold);
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--c-surface);
    border-radius: var(--radius-md);
    background: var(--c-bg2);
    color: var(--c-text);
    transition: border-color var(--trans-fast);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--c-navy);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.contact-map {
    height: 400px;
    border-radius: var(--radius-lg);
    margin-top: 4rem;
    overflow: hidden;
    background: var(--c-surface);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #06090F;
    color: #8A93A8;
    padding: 6rem 0 2rem;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand h2 {
    color: #fff;
    font-family: var(--f-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer-heading {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #8A93A8;
}

.footer-links a:hover {
    color: var(--c-gold);
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icons a:hover {
    background: var(--c-gold);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

    .process-grid::before {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .about-grid,
    .why-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .why-sticky {
        position: static;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 2rem;
    }

    .testi-card {
        min-width: 300px;
        padding: 2rem;
    }

    .contact-info {
        padding: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    /* Mobile Navigation */
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--c-bg);
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        clip-path: inset(0 0 100% 0);
        transition: clip-path 0.4s ease;
    }

    .nav-menu.active {
        clip-path: inset(0 0 0 0);
    }

    .nav-menu>li>a {
        font-size: 1.25rem;
        display: block;
        text-align: center;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        transform: none;
        visibility: visible;
        opacity: 1;
        display: none;
        padding-top: 0.5rem;
    }

    .nav-dropdown.active .dropdown-content {
        display: block;
    }

    .nav-actions {
        display: none;
    }

    .mobile-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--c-text);
        cursor: pointer;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: calc(var(--nav-height) + 1rem);
    }
}

@media (min-width: 769px) {
    .mobile-toggle {
        display: none;
    }
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .site-header,
    .site-footer,
    .btn,
    .theme-toggle,
    .ticker-wrap,
    .contact-form,
    .contact-map {
        display: none !important;
    }

    a {
        text-decoration: underline;
        color: #000;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
    }

    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    img {
        page-break-inside: avoid;
        max-width: 100% !important;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }

    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* ==========================================================================
   Lazy Loading
   ========================================================================== */
img.lazy {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

img.lazy.loaded {
    opacity: 1;
}