:root {
    /* Base palette (kept for backward compat) */
    --text-50: #f1f2f4;
    --text-100: #e2e6e9;
    --text-200: #c5ccd3;
    --text-300: #a9b3bc;
    --text-400: #8c99a6;
    --text-500: #6f7f90;
    --text-600: #596673;
    --text-700: #434c56;
    --text-800: #2c333a;
    --text-900: #16191d;
    --text-950: #0b0d0e;

    --background-50: #f0f2f5;
    --background-100: #e0e6eb;
    --background-200: #c2ccd6;
    --background-300: #a3b3c2;
    --background-400: #8599ad;
    --background-500: #667f99;
    --background-600: #52667a;
    --background-700: #3d4c5c;
    --background-800: #29333d;
    --background-900: #14191f;
    --background-950: #0a0d0f;

    --primary-50: #ebf2f9;
    --primary-100: #d8e5f3;
    --primary-200: #b0cbe8;
    --primary-300: #89b1dc;
    --primary-400: #6297d0;
    --primary-500: #3b7dc4;
    --primary-600: #2f649d;
    --primary-700: #234b76;
    --primary-800: #17324f;
    --primary-900: #0c1927;
    --primary-950: #060d14;

    --secondary-50: #edf2f7;
    --secondary-100: #dbe5f0;
    --secondary-200: #b7cbe1;
    --secondary-300: #93b1d2;
    --secondary-400: #6f98c3;
    --secondary-500: #4b7eb4;
    --secondary-600: #3c6590;
    --secondary-700: #2d4b6c;
    --secondary-800: #1e3248;
    --secondary-900: #0f1924;
    --secondary-950: #080d12;

    --accent-50: #ecf2f9;
    --accent-100: #d9e5f2;
    --accent-200: #b3cbe6;
    --accent-300: #8cb1d9;
    --accent-400: #6697cc;
    --accent-500: #407dbf;
    --accent-600: #336499;
    --accent-700: #264b73;
    --accent-800: #19324d;
    --accent-900: #0d1926;
    --accent-950: #060d13;

    /* Semantic tokens - unified theme */
    --surface: #ffffff;
    --surface-muted: var(--background-50);
    --surface-dark: var(--text-900);
    --surface-dark-soft: var(--text-800);
    --border: var(--background-100);
    --border-strong: var(--background-200);
    --text-heading: var(--text-900);
    --text-body: var(--text-700);
    --text-muted: var(--text-500);
    --text-on-dark: #ffffff;
    --text-on-dark-muted: rgba(255,255,255,0.7);

    /* Spacing & layout */
    --header-height: 76px;
    --header-offset: 90px;
    --section-py: 5rem;
    --section-py-mobile: 3rem;
    --container-max: 1140px;

    /* Typography */
    --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --leading-tight: 1.15;
    --leading-snug: 1.25;
    --leading-normal: 1.6;
    --tracking-tight: -0.02em;

    /* Radii */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-pill: 999px;

    /* Shadows - single elevation system */
    --shadow-sm: 0 4px 16px rgba(22, 25, 29, 0.06);
    --shadow-md: 0 8px 28px rgba(22, 25, 29, 0.10);
    --shadow-lg: 0 16px 40px rgba(22, 25, 29, 0.14);
    --shadow-focus: 0 0 0 3px var(--primary-100);
}

/* Smooth anchor */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-offset);
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal-on-scroll { transition: none !important; }
    body { animation: none !important; opacity: 1 !important; }
}

/* Base */
* { box-sizing: border-box; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: var(--leading-normal);
    color: var(--text-body);
    background-color: var(--surface);
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}
footer { margin-top: auto; }

/* Typography System - unified */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--text-heading);
    font-weight: 700;
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-tight);
    margin-top: 0;
    margin-bottom: 0.6em;
}
h1 { font-size: clamp(2rem, 4vw + 0.5rem, 3rem); line-height: var(--leading-tight); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw + 0.5rem, 2.25rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; font-weight: 600; }
h6 { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-600); }

p { margin-bottom: 1rem; color: var(--text-body); }
p:last-child { margin-bottom: 0; }
.lead {
    font-size: 1.18rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-600);
}
.text-muted { color: var(--text-muted) !important; }
small, .small { font-size: 0.875rem; line-height: 1.5; }
strong, b { font-weight: 700; color: var(--text-heading); }

a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}
a:hover { color: var(--primary-600); }

/* Utilities - single source of truth */
.bg-light { background-color: var(--surface-muted) !important; }
.bg-dark { background-color: var(--surface-dark) !important; }
.text-white { color: var(--text-on-dark) !important; }
.text-dark { color: var(--text-heading) !important; }
.border-secondary { border-color: rgba(255,255,255,0.18) !important; }
.bg-transparent { background-color: transparent !important; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* Header & Navbar - unified */
.header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}
.navbar {
    padding: 0.9rem 1rem;
}
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0;
    text-decoration: none;
    color: var(--text-heading) !important;
}
.brand-mark {
    width: 56px;
    height: 56px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.navbar-brand:hover .brand-mark {
    transform: translateY(-1px);
}
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 1px;
}
.brand-name {
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-900);
    line-height: 1;
}
.brand-name-accent {
    font-weight: 400;
    color: var(--text-600);
}
.brand-tagline {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-400);
}
@media (max-width: 480px) {
    .brand-mark { width: 48px; height: 48px; }
    .brand-name { font-size: 1.15rem; }
    .brand-tagline { font-size: 0.6rem; }
}
.nav-link {
    color: var(--text-700) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem !important;
    transition: color 0.2s;
}
.nav-link.active, .nav-link:hover { color: var(--primary-500) !important; }
.dropdown-menu {
    border-radius: var(--radius-md);
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}

/* Mobile Navbar */
@media (max-width: 991.98px) {
    .navbar-collapse { padding: 0.75rem 0 0.25rem; }
    .navbar-nav { width: 100%; text-align: center; }
    .navbar-nav .nav-item { width: 100%; }
    .navbar-nav .nav-link {
        display: block;
        padding: 0.75rem 1rem !important;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
        color: var(--text-800) !important;
    }
    .navbar-nav .nav-item:last-of-type .nav-link { border-bottom: none; }
    .navbar-nav .nav-link.active {
        color: var(--primary-500) !important;
        background-color: var(--primary-50);
    }
    .lang-switcher-mobile { display: flex !important; justify-content: center; padding: 0.85rem 1rem 0.25rem; width: 100%; }
    .lang-switcher-mobile .lang-switcher { width: auto; }
    .navbar-toggler { border: 1px solid var(--border-strong); padding: 0.4rem 0.65rem; font-size: 0.9rem; }
    .navbar-toggler:focus { box-shadow: var(--shadow-focus); }
}
@media (min-width: 992px) { .lang-switcher-mobile { display: none !important; } }

/* Language Switcher - single component */
.lang-switcher, .footer-lang {
    display: inline-flex;
    align-items: center;
    background-color: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.footer-lang { background-color: var(--surface-muted); }
.lang-switcher-icon { color: var(--text-400); font-size: 0.8rem; padding: 0 8px 0 10px; }
.lang-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: calc(var(--radius-sm) - 2px);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-600);
    background-color: transparent;
    transition: all 0.2s ease;
    line-height: 1.4;
}
.lang-btn:hover { color: var(--text-heading); background-color: var(--background-100); }
.lang-btn.active { color: var(--text-heading); background-color: var(--surface); box-shadow: var(--shadow-sm); }
.footer-lang .lang-btn { font-size: 0.75rem; padding: 3px 10px; }

/* Hero Section - unified */
.hero-section {
    background: linear-gradient(rgba(12, 25, 39, 0.62), rgba(12, 25, 39, 0.62)), url('/assets/images/hero-bg.png');
    background-size: cover;
    background-position: center;
    color: var(--text-on-dark);
    padding: 6.5rem 0 5.5rem;
    text-align: center;
}
.hero-section h1 {
    color: var(--text-on-dark);
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
}
.hero-section .lead {
    color: var(--text-on-dark-muted);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.22rem;
}
.page-header.hero-section { padding: 4.5rem 0 3.5rem; margin-bottom: 0 !important; }
.page-header.hero-section .lead { font-size: 1.12rem; }

/* Sections - unified spacing */
section, .section {
    padding: var(--section-py) 0;
}
@media (max-width: 768px) {
    section, .section { padding: var(--section-py-mobile) 0; }
    .hero-section { padding: 4.5rem 0 3.5rem; }
}
.section-title {
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    font-weight: 800;
    margin-bottom: 0.4em;
    color: var(--text-heading);
    letter-spacing: var(--tracking-tight);
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 620px;
    margin: 0 auto;
}

/* Cards - unified elevation & radius */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-body { padding: 1.5rem; }
@media (min-width: 768px) { .card-body { padding: 1.75rem; } }
.card-title { margin-bottom: 0.6rem; color: var(--text-heading); }
.card-text { color: var(--text-500); line-height: 1.6; }

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 0;
    display: block;
}
.service-card .card-body { padding: 1.35rem; }

/* Feature icon - previously missing */
.feature-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    color: var(--primary-500);
    border-radius: var(--radius-md);
    font-size: 1.15rem;
}

/* Buttons - unified */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.7rem 1.4rem;
    font-size: 0.96rem;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    box-shadow: none;
}
.btn:focus { box-shadow: var(--shadow-focus); }
.btn-primary {
    background-color: var(--primary-500);
    border-color: var(--primary-500);
    color: var(--text-on-dark);
    box-shadow: 0 4px 14px rgba(59, 125, 196, 0.28);
}
.btn-primary:hover {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
    color: var(--text-on-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 125, 196, 0.32);
}
.btn-outline-primary {
    color: var(--primary-500);
    border-color: var(--primary-300);
    background: transparent;
}
.btn-outline-primary:hover {
    background-color: var(--primary-500);
    border-color: var(--primary-500);
    color: var(--text-on-dark);
}
.btn-light {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-700);
}
.btn-light:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.btn-lg { padding: 0.85rem 1.9rem; font-size: 1.05rem; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }

/* Forms - themed to match */
.form-label {
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--text-700);
    margin-bottom: 0.4rem;
}
.form-control, .form-select {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.68rem 0.9rem;
    font-size: 0.95rem;
    color: var(--text-800);
    background-color: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control::placeholder { color: var(--text-400); }
.form-control:focus, .form-select:focus {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-focus);
    outline: 0;
}
textarea.form-control { resize: vertical; min-height: 120px; }

/* Service details - unified */
.service-details-card .card { border: 1px solid var(--border); }
.service-details-card .lead { font-size: 1.05rem; color: var(--text-600); }

/* Turnkey dark block - themed */
.turnkey {
    background: var(--surface-dark);
    color: var(--text-on-dark);
    border-radius: var(--radius-lg);
    padding: 3rem;
}
.turnkey h2, .turnkey h4 { color: var(--text-on-dark); }
.turnkey .lead { color: var(--text-on-dark-muted); }
.turnkey .border-secondary { border-color: rgba(255,255,255,0.14) !important; }
.turnkey .list-group-item {
    background: transparent !important;
    color: var(--text-on-dark) !important;
    border-color: rgba(255,255,255,0.14) !important;
}
@media (max-width: 768px) { .turnkey { padding: 1.75rem; } }

/* Footer */
.footer {
    background-color: var(--surface-muted);
    color: var(--text-600);
    padding: 3.5rem 0 2rem;
    border-top: 1px solid var(--border);
}
.footer h5 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-heading);
    margin-bottom: 1.1rem;
}
.footer a { color: var(--text-600); }
.footer a:hover { color: var(--primary-500); }
.footer-lang-section { display: flex; align-items: center; }
.footer hr { border-color: var(--border); opacity: 1; }
.footer .small { color: var(--text-muted); }

/* Accordion - unify */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius-md) !important; overflow: hidden; margin-bottom: 0.75rem; }
.accordion-button { font-weight: 600; color: var(--text-heading); background: var(--surface); }
.accordion-button:not(.collapsed) { background: var(--primary-50); color: var(--primary-700); box-shadow: inset 0 -1px 0 var(--border); }
.accordion-button:focus { box-shadow: var(--shadow-focus); border-color: var(--primary-200); }
.accordion-body { color: var(--text-600); line-height: 1.65; }

/* Lists */
.list-unstyled li, .list-group-item { line-height: 1.6; }

/* Images */
.img-fluid.object-fit-cover { object-fit: cover; }

/* Comparison Slider - Before/After overlay, mobile-first */
.comparison-slider {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: var(--background-100);
    user-select: none;
    touch-action: pan-y;
}
@media (min-width: 768px) { .comparison-slider { height: 220px; } }
.comparison-slider__track {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.comparison-slider__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.comparison-slider__before {
    position: absolute;
    inset: 0 auto 0 0;
    overflow: hidden;
    border-right: 2px solid var(--surface);
    box-shadow: 2px 0 8px rgba(0,0,0,0.18);
    z-index: 2;
}
.comparison-slider__before .comparison-slider__img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    max-width: none;
}
.comparison-slider__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--surface);
    transform: translateX(-1px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
}
.comparison-slider__handle-line {
    flex: 1;
    width: 2px;
    background: var(--surface);
    box-shadow: 0 0 6px rgba(0,0,0,0.25);
}
.comparison-slider__handle-knob {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--primary-200);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-500);
    font-size: 0.85rem;
    flex-shrink: 0;
}
@media (max-width: 480px) {
    .comparison-slider__handle-knob { width: 44px; height: 44px; font-size: 1rem; }
}
.comparison-slider__badge {
    position: absolute;
    top: 10px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: var(--radius-pill);
    background: rgba(22, 25, 29, 0.78);
    color: var(--text-on-dark);
    backdrop-filter: blur(4px);
    z-index: 1;
    pointer-events: none;
    line-height: 1;
}
.comparison-slider__badge--before { left: 10px; }
.comparison-slider__badge--after { right: 10px; }
.comparison-slider__range {
    display:  none;
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    width: 72%;
    max-width: 260px;
    height: 32px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    z-index: 3;
    cursor: ew-resize;
    touch-action: pan-y;
}
.comparison-slider__range::-webkit-slider-runnable-track {
    height: 6px;
    background: rgba(255,255,255,0.85);
    border-radius: var(--radius-pill);
    box-shadow: 0 1px 6px rgba(0,0,0,0.2);
}
.comparison-slider__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 32px;
    height: 32px;
    margin-top: -13px;
    border-radius: 50%;
    background: var(--primary-500);
    border: 3px solid var(--surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    cursor: ew-resize;
}
.comparison-slider__range::-moz-range-track {
    height: 6px;
    background: rgba(255,255,255,0.85);
    border-radius: var(--radius-pill);
}
.comparison-slider__range::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-500);
    border: 3px solid var(--surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    cursor: ew-resize;
}
.comparison-slider__range:focus { outline: none; }
.comparison-slider__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--primary-100), 0 2px 8px rgba(0,0,0,0.25); }

/* Mini Carousel - mobile-first, swipe friendly */
.mini-carousel {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: var(--background-100);
    touch-action: pan-y;
    user-select: none;
}
@media (min-width: 768px) { .mini-carousel { height: 220px; } }
.mini-carousel__viewport { overflow: hidden; height: 100%; }
.mini-carousel__track {
    display: flex;
    height: 100%;
    transition: transform 0.35s ease;
    will-change: transform;
}
.mini-carousel__slide {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
}
.mini-carousel__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.mini-carousel__dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
    padding: 4px 8px;
    background: rgba(22, 25, 29, 0.32);
    border-radius: var(--radius-pill);
    backdrop-filter: blur(4px);
}
.mini-carousel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.75);
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.mini-carousel__dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
}
.mini-carousel__dot.is-active {
    background: var(--primary-500);
    border-color: var(--surface);
    transform: scale(1.15);
    box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
@media (max-width: 480px) {
    .mini-carousel__dot { width: 12px; height: 12px; }
    .mini-carousel__dots { gap: 12px; bottom: 14px; }
}

/* Card link more */
.card-link-more {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-500);
}
.service-card:hover .card-link-more { color: var(--primary-600); }

/* Scroll offset helper */
[id] { scroll-margin-top: var(--header-offset); }

/* Overrides - remove !important wars, keep only where needed */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.border-0 { border: 0 !important; }
