:root {
    --bs-body-bg: #0f1115;
    --bs-body-color: #d7e0ea;
    --brand-bg: #0b0f14;
    --brand-surface: #121923;
    --brand-surface-2: #1a2431;
    --brand-text: #d7e0ea;
    --brand-muted: #9eb0c4;
    --brand-accent: #3ec0d3;
    --brand-accent-rgb: 62, 192, 211;
    --brand-border: #2b3a4c;
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
    --bs-border-radius-xl: 0;
    --bs-border-radius-2xl: 0;
}

@font-face {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/webfonts/fa-solid-900.woff2") format("woff2");
}

@font-face {
    font-family: "Font Awesome 6 Brands";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/webfonts/fa-brands-400.woff2") format("woff2");
}

html,
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #0f1115 !important;
    color: var(--brand-text) !important;
}

.hero-section {
    background:
        radial-gradient(circle at 80% 20%, rgba(var(--brand-accent-rgb), 0.2), transparent 45%),
        linear-gradient(120deg, #111926 0%, #0d1521 100%);
    border-bottom: 1px solid var(--brand-border);
}

.site-layout main > section {
    padding-top: 5.5rem !important;
    padding-bottom: 5.5rem !important;
}

.hero-panel {
    backdrop-filter: blur(2px);
    background: rgba(18, 25, 35, 0.95) !important;
    border-color: var(--brand-border) !important;
}

.service-card {
    background: linear-gradient(160deg, #131d2a 0%, #111a25 100%) !important;
    border: 1px solid var(--brand-border) !important;
}

.service-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    background: #223246;
    border: 1px solid var(--brand-border);
}

.contact-panel {
    border: 1px solid var(--brand-border) !important;
    background: linear-gradient(120deg, #111a26 0%, #152436 100%) !important;
}

.contact-section {
    background:
        radial-gradient(circle at 75% 15%, rgba(var(--brand-accent-rgb), 0.12), transparent 40%),
        linear-gradient(140deg, #111926 0%, #0d1521 100%);
    border-top: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
}

.homepage-project-hero {
    background: linear-gradient(160deg, #131d2a 0%, #111a25 100%) !important;
    border: 1px solid var(--brand-border) !important;
}

.homepage-hero-section {
    background:
        radial-gradient(circle at 20% 20%, rgba(var(--brand-accent-rgb), 0.14), transparent 38%),
        linear-gradient(140deg, #111926 0%, #0d1521 100%);
    border-top: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
}

.homepage-project-hero-image-wrap {
    width: 100%;
    max-width: 880px;
    height: 420px;
    margin: 0 auto;
    overflow: hidden;
}

.homepage-project-hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.homepage-hero-anim-fade-up .container {
    animation: heroFadeUp 0.7s ease-out both;
}

.homepage-hero-anim-fade-in .container {
    animation: heroFadeIn 0.65s ease-out both;
}

.homepage-hero-anim-zoom-in .container {
    animation: heroZoomIn 0.7s ease-out both;
}

@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(26px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes heroZoomIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.project-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 210px;
    object-fit: cover;
}

.project-card .card-body {
    min-height: 230px;
}

.project-card-fallback {
    object-fit: contain !important;
    background: #0f1722;
    padding: 1rem;
}

.project-main-image-wrap {
    width: 100%;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0f1722;
    border: 1px solid var(--brand-border);
}

.project-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.project-gallery-image {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border: 1px solid var(--brand-border);
}

.project-gallery-thumb {
    cursor: pointer;
}

.project-gallery-thumb.active .project-gallery-image {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 1px var(--brand-accent);
}

.project-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.35) !important;
}

#featured-projects,
.contact-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
}

a,
.text-primary {
    color: var(--brand-accent) !important;
}

a.btn,
a.btn:visited {
    color: inherit !important;
}

.text-secondary,
.small,
.lead {
    color: var(--brand-muted) !important;
}

.bg-white,
.bg-light-subtle,
.bg-body-tertiary,
.card,
.list-group-item,
.table {
    background-color: var(--brand-surface) !important;
    color: var(--brand-text) !important;
    border-color: var(--brand-border) !important;
}

.table > :not(caption) > * > * {
    background-color: transparent !important;
    color: var(--brand-text) !important;
    border-bottom-color: var(--brand-border) !important;
}

.navbar,
footer {
    background: #0a0f16 !important;
    border-color: var(--brand-border) !important;
}

.btn-dark {
    background: #223246;
    border-color: #223246;
    color: var(--brand-accent-light) !important;
}

.btn-outline-dark,
.btn-outline-secondary {
    color: var(--brand-accent) !important;
    border-color: var(--brand-border);
}

.btn-outline-dark:hover,
.btn-outline-secondary:hover {
    background: var(--brand-surface-2);
    border-color: var(--brand-border);
    color: var(--brand-accent-light) !important;
}

.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active {
    color: var(--brand-accent-light) !important;
}

.form-control,
.form-select,
.btn,
.card,
.alert,
.badge,
.navbar,
.list-group-item {
    border-radius: 0 !important;
}

.form-control,
.form-select {
    background: #0f1722;
    color: var(--brand-text);
    border-color: var(--brand-border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 0.12rem rgba(var(--brand-accent-rgb), 0.25);
}

.alert-light {
    background: #172231;
    color: var(--brand-text);
    border-color: var(--brand-border);
}

.badge.text-bg-secondary {
    background: #2a3a50 !important;
}

.code-block {
    background: #0d1520;
    border: 1px solid var(--brand-border);
    color: #bcd0e4;
    padding: 1rem;
    font-size: 0.92rem;
    line-height: 1.45;
    overflow-x: auto;
}

.site-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-layout > main {
    flex: 1 0 auto;
}

.site-layout > footer {
    margin-top: auto;
}

.admin-layout {
    min-height: 100vh;
}

.admin-shell {
    min-height: 100vh;
    display: flex;
}

.admin-sidebar {
    background: #0b1119;
    width: 280px;
    min-height: 100vh;
    flex-shrink: 0;
}

.admin-side-link {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--brand-text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.admin-side-link.active {
    border-left-color: var(--brand-accent);
    background: #162131;
    color: #ffffff;
}

.admin-side-link:hover {
    background: #121d2b;
    color: #ffffff;
}

.admin-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 2rem;
}

.admin-login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(var(--brand-accent-rgb), 0.14), transparent 30%),
        linear-gradient(145deg, #0d141f 0%, #0b1018 100%);
}

html[data-brand-style="light"] {
    --bs-body-bg: #f4f7fb;
    --bs-body-color: #1c2734;
    --brand-bg: #f4f7fb;
    --brand-surface: #ffffff;
    --brand-surface-2: #eef3f8;
    --brand-text: #1c2734;
    --brand-muted: #5d6f84;
    --brand-border: #d4deea;
}

html[data-brand-style="light"] body {
    background: #f4f7fb !important;
    color: var(--brand-text) !important;
}

html[data-brand-style="light"] .hero-section,
html[data-brand-style="light"] .contact-section,
html[data-brand-style="light"] .homepage-hero-section {
    background:
        radial-gradient(circle at 80% 20%, rgba(var(--brand-accent-rgb), 0.12), transparent 45%),
        linear-gradient(120deg, #f8fbff 0%, #eef4fa 100%);
}

html[data-brand-style="light"] .hero-panel,
html[data-brand-style="light"] .service-card,
html[data-brand-style="light"] .contact-panel,
html[data-brand-style="light"] .homepage-project-hero,
html[data-brand-style="light"] .project-main-image-wrap,
html[data-brand-style="light"] .project-card-fallback,
html[data-brand-style="light"] .alert-light,
html[data-brand-style="light"] .code-block,
html[data-brand-style="light"] .form-control,
html[data-brand-style="light"] .form-select {
    background: #ffffff !important;
    color: var(--brand-text) !important;
    border-color: var(--brand-border) !important;
}

html[data-brand-style="light"] .navbar,
html[data-brand-style="light"] footer {
    background: #ffffff !important;
    border-color: var(--brand-border) !important;
}

html[data-brand-style="light"] .navbar .nav-link,
html[data-brand-style="light"] .navbar .navbar-brand {
    color: var(--brand-text) !important;
}

html[data-brand-style="light"] .navbar .nav-link.active {
    color: var(--brand-accent) !important;
}

html[data-brand-style="light"] .btn-dark {
    background: var(--brand-accent-dark);
    border-color: var(--brand-accent-dark);
    color: var(--brand-accent-light) !important;
}

html[data-brand-style="light"] .btn-dark:hover,
html[data-brand-style="light"] .btn-dark:focus,
html[data-brand-style="light"] .btn-dark:active {
    background: var(--brand-accent) !important;
    border-color: var(--brand-accent) !important;
    color: var(--brand-accent-ink) !important;
}

html[data-brand-style="light"] .btn-outline-dark,
html[data-brand-style="light"] .btn-outline-secondary {
    color: var(--brand-accent-ink) !important;
}

html[data-brand-style="light"] .btn-outline-dark:hover,
html[data-brand-style="light"] .btn-outline-secondary:hover {
    color: var(--brand-accent-dark) !important;
}

html[data-brand-style="light"] .btn-outline-dark:focus,
html[data-brand-style="light"] .btn-outline-dark:active,
html[data-brand-style="light"] .btn-outline-secondary:focus,
html[data-brand-style="light"] .btn-outline-secondary:active {
    color: var(--brand-accent-dark) !important;
}

.admin-login-card {
    background: linear-gradient(160deg, #131d2a 0%, #111a25 100%) !important;
    border: 1px solid var(--brand-border) !important;
}

@media (max-width: 991.98px) {
    .site-layout main > section {
        padding-top: 4.5rem !important;
        padding-bottom: 4.5rem !important;
    }

    .navbar .navbar-nav {
        width: 100%;
        align-items: center;
        text-align: center;
        gap: 0.4rem;
        padding-top: 0.8rem;
        padding-bottom: 0.4rem;
    }

    .navbar .nav-link {
        display: inline-block;
        padding-top: 0.8rem !important;
        padding-bottom: 0.8rem !important;
    }

    .homepage-project-hero-image-wrap {
        height: 320px;
    }

    .project-main-image-wrap {
        height: 360px;
    }

    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        min-height: auto;
        border-bottom: 1px solid var(--brand-border);
    }
}

@media (prefers-reduced-motion: reduce) {
    .homepage-hero-anim-fade-up .container,
    .homepage-hero-anim-fade-in .container,
    .homepage-hero-anim-zoom-in .container {
        animation: none !important;
    }
}

@media (max-width: 575.98px) {
    .site-layout main > section {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    .homepage-project-hero-image-wrap {
        height: 220px;
    }

    .project-main-image-wrap {
        height: 240px;
    }
}
