/* REVIBEX.COM - Main Design System (Vanilla CSS) */

/* 1. RESET & NORMALIZE */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--light-2);
    color: var(--dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* 2. CSS VARIABLES (DESIGN TOKENS) */
:root {
    /* Brand Colors */
    --primary: #CF1B1F;
    --primary-rgb: 207, 27, 31;
    --dark: #575251;
    --dark-rgb: 87, 82, 81;
    --light-1: #F4F2F1;
    --light-2: #FAF9F8;
    --accent-soft: #F9F5E4;
    --white: #FFFFFF;
    --black: #000000;
    --primary-dark: #A51518;

    /* Functional Colors */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;

    /* Spacing (8px Grid System) */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 1rem;
    /* 16px */
    --space-4: 1.5rem;
    /* 24px */
    --space-5: 2rem;
    /* 32px */
    --space-6: 3rem;
    /* 48px */
    --space-7: 4rem;
    /* 64px */
    --space-8: 6rem;
    /* 96px */
    --space-9: 8rem;
    /* 128px */
    --space-10: 10rem;
    /* 160px */

    /* Typography */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
    --fs-3xl: 1.875rem;
    --fs-4xl: 2.25rem;
    --fs-5xl: 3rem;
    --fs-6xl: 3.75rem;

    --fs-subtitle: clamp(1rem, 2.5vw, 1.25rem);

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --container-max: 1200px;
    --header-height: 80px;
}

[data-theme="dark"] {
    --light-1: #1f1d1c;
    --light-2: #141211;
    --dark: #f0edec;
    --white: #1f1d1c;
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* 2.1. Extra Animations */
@keyframes techScan {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

@keyframes techGrid {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 60px 60px;
    }
}

.tech-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

canvas#network-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

/* 3. TYPOGRAPHY */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dark);
    font-weight: var(--fw-bold);
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--fs-5xl);
}

h2 {
    font-size: var(--fs-4xl);
}

h3 {
    font-size: var(--fs-3xl);
}

h4 {
    font-size: var(--fs-2xl);
}

@media (max-width: 768px) {
    h1 {
        font-size: var(--fs-4xl);
    }

    h2 {
        font-size: var(--fs-3xl);
    }

    h3 {
        font-size: var(--fs-2xl);
    }
}

p {
    margin-bottom: var(--space-4);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

ul,
ol {
    list-style: none;
}

/* 4. LAYOUT UTILITIES */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section {
    padding: var(--space-8) 0;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.text-center {
    text-align: center;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-5 {
    gap: var(--space-5);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-7 {
    gap: var(--space-7);
}

/* 5. COMPONENTS (BEM) */

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: 50px;
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: var(--transition-base);
    border: 2px solid transparent;
    font-size: var(--fs-md);
    white-space: nowrap;
}

.btn--primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(207, 27, 31, 0.3);
}

.btn--primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    box-shadow: 0 8px 25px rgba(207, 27, 31, 0.4);
    transform: translateY(-2px);
    border-color: var(--primary-dark);
}

.btn--outline {
    border-color: var(--primary);
    color: var(--primary);
}

.btn--outline:hover {
    background-color: var(--primary);
    color: var(--white) !important;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: transparent;
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: var(--transition-base);
}

.header--scrolled {
    background-color: var(--white);
    height: 70px;
    box-shadow: var(--shadow-md);
}

.header--scrolled .nav__link {
    color: var(--dark) !important;
}

.header--scrolled .nav__link--active {
    color: var(--primary) !important;
}

.header--scrolled .header__logo img {
    height: 38px;
}

.header--scrolled .theme-toggle {
    background: var(--light-1);
    color: var(--dark);
}

.header--scrolled .btn--outline {
    border-color: var(--primary);
    color: var(--primary);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.header__logo {
    display: flex;
    align-items: center;
    transition: var(--transition-base);
}

.header__logo img {
    height: 44px;
    width: auto;
    transition: var(--transition-base);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    color: var(--white);
}

.nav__list {
    display: flex;
    gap: var(--space-5);
    align-items: center;
}

.nav__link {
    font-weight: var(--fw-semibold);
    font-size: var(--fs-md);
    padding: var(--space-2) 0;
    position: relative;
    color: var(--white);
    opacity: 0.9;
    letter-spacing: 0.5px;
}

.nav__link:hover,
.nav__link--active {
    opacity: 1;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition-base);
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: var(--primary);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px var(--primary);
}

.nav__link:hover::after,
.nav__link--active::after {
    width: 100%;
}

.nav__link--active {
    color: var(--primary);
}

.header__cta {
    padding: var(--space-2) var(--space-6);
    background-color: var(--primary);
    color: var(--white);
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header__cta:hover {
    background-color: #fff;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 992px) {
    .header__cta {
        display: none;
    }
}

/* Card */
.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-7);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    border: 1px solid rgba(var(--dark-rgb), 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grid.gap-7 {
    gap: var(--space-7) !important;
}

.card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(var(--primary-rgb), 0.1);
}

.card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-1);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    color: var(--primary);
    transition: var(--transition-base);
}

.card:hover .card__icon {
    background-color: var(--primary);
    color: var(--white);
}

.card__icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1A1817 0%, #11100F 100%);
    color: var(--light-1);
    padding: var(--space-8) 0 var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-7);
    margin-bottom: var(--space-7);
    position: relative;
    z-index: 10;
}

.footer__title {
    color: var(--white);
    margin-bottom: var(--space-5);
    font-size: var(--fs-xl);
}

.footer__link {
    display: block;
    margin-bottom: var(--space-2);
    opacity: 0.8;
}

.footer__link:hover {
    opacity: 1;
    color: var(--primary);
    padding-left: var(--space-1);
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-5);
    margin-top: var(--space-7);
    font-size: var(--fs-sm);
    opacity: 0.7;
}

.footer__bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.footer__legal {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.footer__legal-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--fs-sm);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer__legal-link:hover {
    color: var(--primary);
}

.footer__legal-sep {
    color: rgba(255, 255, 255, 0.3);
}

/* Social Media Icons */
.footer__social {
    display: flex;
    gap: 10px;
    margin-top: var(--space-5);
}

.footer__social-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.footer__social-link svg {
    width: 17px;
    height: 17px;
}

.footer__social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(207, 27, 31, 0.4);
}

@media (max-width: 768px) {
    .footer__bottom-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer__legal {
        justify-content: center;
    }
}

/* --- Hero & Slider --- */
.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    background-color: var(--dark);
    overflow: hidden;
    color: var(--white);
}

.hero__slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.08);
    transition: opacity 1.2s ease-in-out, transform 1.2s ease-in-out, visibility 1.2s;
}

.hero__slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.hero__container {
    position: relative;
    z-index: 10;
}

.hero__content {
    max-width: 750px;
}

.hero__actions a:hover {
    color: var(--white) !important;
    border-color: var(--primary) !important;
    background-color: var(--primary) !important;
}

.hero__title {
    font-size: var(--fs-5xl);
    line-height: 1.1;
    margin-bottom: var(--space-5);
    font-weight: var(--fw-bold);
    color: #fff;
}

.hero__subtitle {
    font-size: var(--fs-lg);
    margin-bottom: var(--space-7);
    opacity: 0.9;
    color: #fff;
    line-height: 1.6;
    max-width: 600px;
}

.hero__controls {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-3);
    z-index: 20;
}

.hero__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition-base);
}

.hero__dot.active {
    background-color: var(--primary);
    transform: scale(1.3);
}

.hero__dot:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 992px) {
    .hero__title {
        font-size: var(--fs-4xl);
        line-height: 1.2;
    }

    .hero {
        height: 80vh;
        /* Maintain visible height */
        min-height: 450px;
    }

    .hero__dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 576px) {
    .hero__title {
        font-size: var(--fs-3xl);
    }

    .hero {
        height: 70vh;
    }

    .hero__actions {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .hero__actions .btn {
        width: 100%;
        text-align: center;
    }

    .hero__subtitle {
        font-size: var(--fs-md);
        margin-bottom: var(--space-5);
    }
}

/* Animations */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--transition-base), transform 0.8s var(--transition-base);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    display: flex;
    align-items: center;

    .back-to-top {
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        background: #fff;
        color: var(--dark);
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1000;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        opacity: 0;
        visibility: hidden;
        transform: translateY(30px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

    .back-to-top.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .back-to-top:hover {
        background-color: var(--primary);
        color: var(--white);
        transform: translateY(-8px) scale(1.1);
        box-shadow: 0 15px 35px rgba(207, 27, 31, 0.3);
    }

    .back-to-top svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.5;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* Theme Toggle */
    .theme-toggle {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
        width: 40px;
        height: 40px;
        border-radius: 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--white);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .header--scrolled .theme-toggle {
        background: #f0f0f0;
        border-color: rgba(0, 0, 0, 0.05);
        color: var(--dark);
    }

    .theme-toggle:hover {
        background-color: var(--primary) !important;
        color: var(--white) !important;
        border-color: var(--primary) !important;
        transform: rotate(20deg) scale(1.1);
    }
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 5px 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    height: 40px;
}

.header--scrolled .lang-switcher {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.lang-switcher:hover {
    background: rgba(255, 255, 255, 0.18);
}

.header--scrolled .lang-switcher:hover {
    background: rgba(0, 0, 0, 0.08);
}

.lang-switcher__flag-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 6px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s ease;
    z-index: 9999;
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--dark);
    font-size: 13px;
    font-weight: 600;
}

.lang-option:hover {
    background: rgba(207, 27, 31, 0.08);
    color: var(--primary);
}

.lang-option.active-lang {
    color: var(--primary);
    background: rgba(207, 27, 31, 0.06);
}

.lang-option__flag-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Caret icon in lang switcher */
.lang-switcher__caret {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.25s ease;
}

.lang-switcher.open .lang-switcher__caret {
    transform: rotate(180deg);
}

/* Mobile: only show flag, no text */
@media (max-width: 992px) {
    .lang-switcher {
        padding: 5px 6px;
    }
}

/* Theme Toggle */
.theme-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.header--scrolled .theme-toggle {
    background: #f0f0f0;
    border-color: rgba(0, 0, 0, 0.05);
    color: var(--dark);
}

.theme-toggle:hover {
    background-color: var(--primary) !important;
    color: var(--white) !important;
    border-color: var(--primary) !important;
    transform: rotate(20deg) scale(1.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* Mobile Menu Toggle Styling */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 3000;
    position: relative;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--white);
    transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    border-radius: 3px;
    display: block;
}

.header--scrolled .menu-toggle span {
    background-color: var(--dark);
}

/* Active State for Hamburger */
.toggle--active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background-color: var(--white) !important;
}

.toggle--active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.toggle--active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background-color: var(--white) !important;
}

@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 90%;
        height: 100vh;
        background-color: #1A1817;
        color: var(--white);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        transition: all 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        box-shadow: -20px 0 50px rgba(0, 0, 0, 0.4);
        z-index: 2000;
        display: flex;
        align-items: center;
        /* Center horizontally for better mobile looks */
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav--open {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        width: 100%;
        align-items: center;
        /* Center links */
        gap: 1.5rem;
        text-align: center;
    }

    .nav__link {
        color: var(--white) !important;
        /* Ensure visibility against dark mobile bg */
        font-size: 1.25rem;
        width: 100%;
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav__link::after {
        display: none;
    }

    .nav__link {
        font-size: var(--fs-xl);
        width: 100%;
        padding: var(--space-3) 0;
    }

    .header__logo img {
        height: 32.5px;
    }

    /* Hide theme toggle on mobile - system preference handles it */
    .theme-toggle {
        display: none !important;
    }

    /* Keep language switcher small on mobile */
    .lang-switcher__code {
        display: none;
    }

    .lang-switcher {
        padding: 4px 6px;
    }
}


/* Form Styles */
.form-group {
    margin-bottom: var(--space-4);
}

.label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--fw-medium);
}

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--light-1);
    background-color: var(--light-2);
    border-radius: var(--radius-md);
    font-family: inherit;
    transition: var(--transition-base);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

textarea.input {
    min-height: 150px;
    resize: vertical;
}

/* --- Portfolio Unified Design --- */
/* --- Portfolio Elite Section --- */
.portfolio-header {
    margin-bottom: var(--space-8);
}

.portfolio-header__title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: var(--space-6);
    line-height: 1.1;
}

.portfolio-filters-bar {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    padding: 20px 0;
    position: sticky;
    top: 72px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}

.filter-btn {
    padding: 8px 24px;
    border-radius: 50px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--dark);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.portfolio-grid--agency {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 80px 40px;
}

@media (max-width: 992px) {
    .portfolio-grid--agency {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}

.portfolio-item {
    display: flex;
    flex-direction: column;
}

.portfolio-item__img-box {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    margin-bottom: var(--space-5);
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Background Pattern like reference */
.portfolio-item__img-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.02) 50%, rgba(0, 0, 0, 0.02) 75%, transparent 75%, transparent);
    background-size: 40px 40px;
    opacity: 0.5;
}

.portfolio-item__mockups {
    position: relative;
    width: 85%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.portfolio-laptop {
    width: 85%;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.2));
    transition: transform 0.5s ease;
}

.portfolio-phone {
    width: 25%;
    position: absolute;
    right: 5%;
    bottom: 5%;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: transform 0.5s ease 0.1s;
}

.portfolio-item:hover .portfolio-laptop {
    transform: scale(1.03) rotate(-1deg);
}

.portfolio-item:hover .portfolio-phone {
    transform: scale(1.1) translate(5px, 5px);
}

.portfolio-item__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--space-4);
}

.portfolio-tag {
    padding: 6px 18px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.portfolio-item__title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.portfolio-item__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    transition: color 0.3s ease;
}

.portfolio-item:hover .portfolio-item__title {
    color: var(--primary);
}

.portfolio-item__arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.portfolio-item:hover .portfolio-item__arrow {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: rotate(-45deg);
}

.portfolio-item__desc {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

/* Footer & Contact Icons */
.footer__contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.footer__contact-item svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
    flex-shrink: 0;
}

.footer__contact-text {
    font-size: var(--fs-md);
    opacity: 0.9;
}

/* --- Project Detail Page --- */
.project-hero {
    height: 70vh;
    min-height: 500px;
    background-color: var(--dark);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: var(--white);
    background: url('../images/protfolio-bg.jpg') center/cover no-repeat;
}

.contact-hero,
.contact-hero::before {
    background-image: url('../images/contact-bg.jpg') !important;
}

.about-hero,
.about-hero::before {
    background-image: url('../images/about_bg.jpg') !important;
}

.portfolio-hero,
.portfolio-hero::before {
    background-image: url('../images/protfolio-bg.jpg') !important;
}

.services-hero,
.services-hero::before {
    background-image: url('../images/slider02.png') !important;
    /* Nice techy backdrop for services */
}

/* Elite background with blur and overlay */
.project-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/protfolio-bg.jpg') center/cover no-repeat;
    filter: blur(8px) brightness(0.4) contrast(1.1);
    /* Subtle blur and darkness like user asked */
    transform: scale(1.1);
    /* Prevent blurred edges */
    z-index: 0;
}

/* Light black overlay for extra readability */
.project-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

.project-hero__content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.project-hero__tag {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
    display: block;
    margin-bottom: 20px;
}

.project-hero__title {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 30px;
}

.project-hero__desc {
    font-size: 18px;
    opacity: 0.85;
    line-height: 1.7;
    max-width: 650px;
}

.project-meta {
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.12);
    padding: 50px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
    margin-top: -100px;
    position: relative;
    z-index: 50;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-meta__item h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.project-meta__item p {
    font-weight: 700;
    font-size: 20px;
    color: var(--dark);
}

.project-detail__grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 100px;
    margin-top: 100px;
    padding-bottom: 100px;
}

@media (max-width: 992px) {
    .project-detail__grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .project-meta {
        padding: 30px;
        margin-top: -60px;
        gap: 30px;
    }
}

.project-detail__sidebar {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 24px;
    height: fit-content;
    position: sticky;
    top: 120px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar__section {
    margin-bottom: 40px;
}

.sidebar__title {
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.tech-tag {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* --- Products Page: ERP Elite --- */
.product-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 30px;
    border-radius: 50px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--dark);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
}

.tab-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.2);
}

.product-showcase {
    background: #fff;
    border-radius: 30px;
    padding: 60px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 80px;
}

.showcase__img-box {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    position: relative;
    background: #eee;
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase__img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.showcase__content h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 25px;
}

.showcase__content p {
    font-size: 18px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
}

.showcase__list {
    list-style: none;
    padding: 0;
    margin-bottom: 35px;
}

.showcase__list li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #555;
}

.showcase__list li svg {
    flex-shrink: 0;
    color: var(--primary);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.feature-card__icon {
    width: 60px;
    height: 60px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.feature-card__icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.feature-card p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

.demo-credentials {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 20px;
    margin-top: 50px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.demo-credentials h4 {
    margin-bottom: 15px;
    color: var(--primary);
}

.cred-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cred-item b {
    color: var(--dark);
    display: block;
    margin-bottom: 5px;
}

@media (max-width: 992px) {
    .product-showcase {
        grid-template-columns: 1fr;
        padding: 30px;
        gap: 40px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .showcase__content h2 {
        font-size: 28px;
    }

    .cred-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Contact Page: Elite Redesign --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    margin-top: 50px;
}

.contact-info__card {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    height: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    transition: transform 0.3s ease;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item:hover {
    transform: translateX(10px);
}

.contact-item__icon {
    width: 60px;
    height: 60px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item__icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.contact-item__text h4 {
    font-size: 14px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.contact-item__text p {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0;
}

/* Captcha Style */
.captcha-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #eee;
    margin-bottom: 25px;
    user-select: none;
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.captcha-code {
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: 5px;
    font-style: italic;
    text-decoration: line-through;
    position: relative;
    overflow: hidden;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

.captcha-code::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(10deg);
}

.captcha-input {
    flex: 1;
    height: 50px;
}

/* --- About Page: Modern Why Us Cards --- */
.why-us-section {
    background: linear-gradient(135deg, #fafafa 0%, #f5f3f0 100%);
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-5);
}

.why-us-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.why-us-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #ff6b6b);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.why-us-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.why-us-card:hover::before {
    transform: scaleX(1);
}

.why-us-card__icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(207, 27, 31, 0.08), rgba(207, 27, 31, 0.15));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    transition: background 0.3s ease;
}

.why-us-card:hover .why-us-card__icon {
    background: var(--primary);
}

.why-us-card__icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--primary);
    transition: stroke 0.3s ease;
}

.why-us-card:hover .why-us-card__icon svg {
    stroke: #fff;
}

.why-us-card h4 {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--dark);
}

.why-us-card p {
    font-size: var(--fs-md);
    color: var(--text-muted);
    line-height: 1.65;
}

/* --- About Page: Modern Stats --- */
.stats-section {
    background: var(--dark);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(207, 27, 31, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(207, 27, 31, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.stats-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
    padding: 20px 50px;
    flex: 1;
    min-width: 180px;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    letter-spacing: -2px;
    margin-bottom: 6px;
}

.stat-number span {
    color: var(--primary);
    font-size: 2.5rem;
}

.stat-label {
    font-size: var(--fs-md);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
}

.stat-desc {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .stat-divider {
        display: none;
    }

    .stat-item {
        min-width: 140px;
        padding: 20px 24px;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .why-us-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .why-us-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Portfolio: Fix overflow / image containment --- */
.portfolio-item__img-box {
    overflow: hidden !important;
    position: relative;
}

.portfolio-item__mockups {
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

.portfolio-laptop {
    max-width: 82%;
    width: 82%;
    object-fit: contain;
}

.portfolio-phone {
    max-width: 22%;
    width: 22%;
    object-fit: contain;
}

/* --- Global Responsive Resilience --- */
@media (max-width: 1200px) {
    .container {
        padding: 0 30px;
    }
}

@media (max-width: 992px) {
    .header__actions {
        gap: var(--space-2);
    }

    .header__cta {
        display: none !important;
        /* Hide CTA button on small screens to save space */
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .section {
        padding: 60px 0;
    }

    .footer__grid {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: var(--space-7);
    }

    .footer__col {
        align-items: center !important;
    }

    .footer__contact-item {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 20px;
    }

    .hero__title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .hero__subtitle {
        font-size: var(--fs-md);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: var(--space-6);
        max-width: 100%;
    }

    .project-hero {
        height: 50vh;
        min-height: 350px;
    }

    .flex.gap-4 {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Elite Mobile Responsive Orchestration --- */
@media (max-width: 992px) {
    .header__actions {
        order: 2;
        gap: var(--space-3);
    }

    .header__logo {
        order: 1;
    }

    .header__cta {
        display: none !important;
    }

    .menu-toggle {
        display: flex !important;
        margin-left: 10px;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -105%;
        /* Hide completely with extra margin */
        width: 300px;
        height: 100vh;
        background: rgba(18, 17, 16, 0.98);
        backdrop-filter: blur(25px);
        padding: 6rem 2rem;
        z-index: 5000;
        /* Extremely high z-index */
        transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        display: flex !important;
        flex-direction: column;
        box-shadow: -15px 0 45px rgba(0, 0, 0, 0.5);
    }

    .nav--open {
        right: 0 !important;
    }

    /* Standardized Footer Mobile Authority */
    .footer__grid {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: var(--space-8);
    }

    .footer__col {
        align-items: center !important;
        display: flex;
        flex-direction: column;
    }

    .footer__contact-item {
        justify-content: center !important;
        width: 100%;
    }

    .footer__contact-text {
        text-align: center;
    }

    .footer__title::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 600px) {
    .hero {
        height: 75vh !important;
        min-height: 420px !important;
    }

    .hero__title {
        font-size: clamp(1.8rem, 9vw, 2.4rem) !important;
        line-height: 1.25 !important;
        letter-spacing: -0.5px;
    }

    .hero__subtitle {
        font-size: var(--fs-md);
        margin-bottom: var(--space-6);
        max-width: 100%;
    }

    .hero__actions {
        flex-direction: column !important;
        width: 100%;
        gap: 12px;
    }

    .hero__actions .btn {
        width: 100% !important;
        padding: 14px 20px;
        justify-content: center;
    }

    .section {
        padding: 50px 0;
    }

    .container {
        padding: 0 20px;
    }
}

/* Fix for Scroll Locking */
body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
}