html {
    scroll-behavior: smooth;
    /* Prevent flash during theme initialization */
    transition: background-color 0.15s ease, color 0.15s ease;
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    overflow-x: hidden;
    /* Smooth theme transitions */
    transition: background-color 0.15s ease, color 0.15s ease;
    /* Prevent layout shift from scrollbar appearing/disappearing */
    overflow-y: scroll;
    font-size: 0.95rem;
}

/* Font loading optimization - prevent invisible text during font swap */
@font-face {
    font-family: 'Inter';
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: normal;
}

/* Fallback font system when Inter is not loaded */
html:not(.fonts-loaded) body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Apply Inter only after it's confirmed loaded */
html.fonts-loaded body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Prevent flash before theme is set */
html:not([data-bs-theme]) {
    background-color: #ffffff;
    color: #212529;
}

html:not([data-bs-theme]) body {
    background-color: #ffffff;
    color: #212529;
}

a {
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 1000;
    background: #0f172a;
    color: #fff;
    border-radius: .5rem
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: .5rem 1rem
}

.bg-surface {
    background-color: rgba(148, 163, 184, .08)
}

.bg-footer {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)
}

.btn-accent {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    border: none;
    box-shadow: 0 .75rem 1.5rem rgba(37, 99, 235, .18)
}

.btn-accent:hover,
.btn-accent:focus {
    color: #fff;
    filter: brightness(1.05)
}

.link-body {
    color: inherit
}

.link-body:hover {
    color: var(--bs-primary)
}

.text-accent {
    color: #2563eb
}

.text-gradient {
    background: linear-gradient(135deg, #1e293b, #2563eb 60%, #0ea5e9);
    background-clip: text;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent
}

.navbar {
    backdrop-filter: blur(14px);
    background-color: rgba(255, 255, 255, .86)
}

.hero {
    position: relative
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(14, 165, 233, .15), transparent 55%), radial-gradient(circle at bottom left, rgba(37, 99, 235, .18), transparent 45%);
    pointer-events: none
}

.quick-contact {
    padding: 1rem;
    border-radius: 1rem;
    background-color: #fff;
    border: 1px solid rgba(148, 163, 184, .2);
    transition: transform .3s ease, box-shadow .3s ease
}

.quick-contact:hover {
    transform: translateY(-4px);
    box-shadow: 0 .75rem 2rem rgba(15, 23, 42, .12)
}

.feature-card .icon-wrap {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(14, 165, 233, .12));
    color: #2563eb;
    font-size: 1.6rem
}

.service-card {
    transition: transform .3s ease, box-shadow .3s ease
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 1.2rem 2.5rem rgba(15, 23, 42, .14)
}

.review-card i {
    font-size: 1.1rem
}

.ratio iframe {
    border: 0;
    border-radius: 1rem
}


.form-control:focus,
.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .15)
}

.btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px
}

.shadow-sm {
    box-shadow: 0 .75rem 1.5rem rgba(15, 23, 42, .08) !important
}

[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s ease, transform .6s ease
}

[data-animate].animated {
    opacity: 1;
    transform: none
}

[data-animate][data-animate-delay] {
    transition-delay: calc(var(--a-delay, 0ms))
}

/* Exclude navbar elements from animations to prevent visual glitches */
.navbar [data-animate],
.navbar-brand [data-animate],
.navbar-nav [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Prevent navbar text layout shifts */
.navbar-brand,
.navbar-nav .nav-link {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    font-kerning: auto;
    text-rendering: optimizeLegibility;
}

/* Force consistent font loading and sizing */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.navbar-nav .nav-link {
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
}

/* Prevent layout shift with consistent fallback fonts */
body {
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

/* Disable Bootstrap navbar transitions that might cause flicker */
.navbar-collapse.collapsing {
    transition: none;
}

.navbar-toggler {
    transition: none;
}

/* Theme icon switching based on data-bs-theme */
[data-bs-theme="light"] .theme-icon-light {
    display: inline;
}

[data-bs-theme="light"] .theme-icon-dark {
    display: none;
}

[data-bs-theme="dark"] .theme-icon-light {
    display: none;
}

[data-bs-theme="dark"] .theme-icon-dark {
    display: inline;
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem
}



.modal-content {
    border-radius: 1rem
}

.btn-close:focus {
    box-shadow: none;
    outline: 2px solid #2563eb;
    outline-offset: 2px
}

.bg-surface+.bg-surface {
    border-top: 1px solid rgba(148, 163, 184, .2)
}

.hours-list {
    display: grid;
    grid-template-columns: auto auto;
    gap: .5rem 2rem;
    align-items: center;
    max-width: 320px
}

.hours-list li {
    margin: 0;
    display: contents
}

.hours-list span {
    display: block
}

.icon-list {
    margin: 0;
    padding: 0;
    list-style: none
}

.icon-list li {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .75rem;
    line-height: 1.6;
    align-items: center;
}

.icon-list li:last-child {
    margin-bottom: 0
}

.icon-list li>span {
    flex: 1;
    line-height: 1.6
}

.icon-list li>span>span {
    display: block
}

.icon-list i {
    line-height: 1.6;
    margin-top: 0;
    flex-shrink: 0;
    width: 1.2rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb
}

@media (max-width:991.98px) {
    .navbar {
        background-color: rgba(255, 255, 255, .95)
    }
}

@media (max-width:575.98px) {
    .hours-list {
        grid-template-columns: 1fr;
        gap: .35rem
    }

    .hours-list span:last-child {
        color: var(--bs-body-secondary-color)
    }
}

@media (prefers-reduced-motion:reduce) {

    *,
    *:before,
    *:after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important
    }
}

[data-bs-theme=dark] {
    color-scheme: dark;
    background-color: #0b1120
}

body.dark,
[data-bs-theme=dark] body {
    background-color: #0b1120;
    color: #e2e8f0
}

body.dark .navbar,
[data-bs-theme=dark] .navbar {
    background-color: rgba(15, 23, 42, .9);
    border-bottom: 1px solid rgba(59, 130, 246, .08)
}

body.dark .bg-surface,
[data-bs-theme=dark] .bg-surface {
    background-color: rgba(17, 25, 40, .92)
}

body.dark .bg-footer,
[data-bs-theme=dark] .bg-footer {
    background: linear-gradient(135deg, #0b1221, #162032)
}

body.dark .btn-accent,
[data-bs-theme=dark] .btn-accent {
    box-shadow: 0 .35rem .85rem rgba(8, 145, 178, .25)
}

body.dark .quick-contact,
[data-bs-theme=dark] .quick-contact {
    background-color: rgba(17, 25, 40, .92);
    border-color: rgba(59, 130, 246, .12)
}

body.dark .card,
[data-bs-theme=dark] .card {
    background-color: rgba(17, 25, 40, .94);
    border-color: rgba(100, 116, 139, .16)
}

body.dark .text-gradient,
[data-bs-theme=dark] .text-gradient {
    -webkit-text-fill-color: #e2e8f0
}

body.dark .shadow-sm,
[data-bs-theme=dark] .shadow-sm {
    box-shadow: 0 .45rem 1.25rem rgba(3, 7, 18, .45) !important
}

body.dark .quick-contact:hover,
[data-bs-theme=dark] .quick-contact:hover {
    box-shadow: 0 .45rem 1.45rem rgba(3, 7, 18, .55)
}

body.dark .btn-outline-secondary,
[data-bs-theme=dark] .btn-outline-secondary {
    color: #cbd5f5;
    border-color: rgba(148, 163, 184, .35)
}

body.dark .btn-outline-secondary:hover,
[data-bs-theme=dark] .btn-outline-secondary:hover {
    background-color: rgba(59, 130, 246, .12);
    border-color: rgba(59, 130, 246, .35)
}