@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Sora:wght@400;500;600;700;800&display=swap');

:root {
    --ink-900: #10243a;
    --ink-700: #2d4763;
    --ink-500: #4f6782;
    --paper-50: #fffdf8;
    --paper-100: #f7f3eb;
    --paper-200: #ede6d8;
    --brand-600: #1f5b99;
    --brand-500: #2f74bd;
    --brand-300: #86b4e4;
    --accent-500: #d37b4a;
    --accent-300: #e6a37d;
    --mint-300: #9fc8b7;
    --line: rgba(16, 36, 58, 0.14);
    --card-shadow: 0 14px 28px rgba(24, 49, 77, 0.12);
    --card-shadow-hover: 0 18px 34px rgba(24, 49, 77, 0.2);
    --radius-lg: 24px;
    --radius-md: 16px;
    --section-space: clamp(4rem, 6vw, 6.25rem);
    --primary-color: var(--brand-600);
    --dark-color: var(--ink-900);
    --light-bg: var(--paper-100);
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', 'Segoe UI', sans-serif;
    color: var(--ink-700);
    padding-top: 92px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 6%, rgba(214, 123, 74, 0.14), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(134, 180, 228, 0.22), transparent 36%),
        repeating-linear-gradient(
            90deg,
            rgba(16, 36, 58, 0.015) 0,
            rgba(16, 36, 58, 0.015) 1px,
            transparent 1px,
            transparent 28px
        ),
        linear-gradient(180deg, #fffcf5 0%, #f8f1e4 100%);
}

section {
    position: relative;
}

section.py-5 {
    padding-top: var(--section-space) !important;
    padding-bottom: var(--section-space) !important;
}

img {
    max-width: 100%;
    height: auto;
}

.ratio img {
    object-fit: cover;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'DM Serif Display', Georgia, serif;
    color: var(--ink-900);
    letter-spacing: 0.01em;
}

.display-3,
.display-4,
.display-5,
.display-6 {
    line-height: 1.06;
}

p,
small,
li,
label,
.btn,
.nav-link,
.form-control,
.form-select,
button {
    font-family: 'Sora', 'Segoe UI', sans-serif;
}

.text-muted {
    color: #5c738e !important;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease, transform 0.25s ease;
}

/* Navigation */
.navbar {
    background: transparent !important;
    padding: 0.6rem 0;
    transition: padding 0.25s ease;
}

.navbar .container {
    background: rgba(255, 252, 245, 0.94);
    border: 1px solid rgba(16, 36, 58, 0.18);
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(27, 47, 70, 0.12);
    padding: 0.45rem 0.85rem;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.navbar.scrolled {
    padding: 0.4rem 0;
}

.navbar.scrolled .container {
    border-color: rgba(16, 36, 58, 0.28);
    box-shadow: 0 10px 25px rgba(27, 47, 70, 0.18);
    transform: translateY(-1px);
}

.navbar-brand {
    color: var(--ink-900) !important;
    font-size: 1.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.navbar-brand i {
    color: var(--accent-500);
}

.nav-link {
    color: var(--ink-500) !important;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    border-radius: 8px;
    padding: 0.45rem 0.62rem !important;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0.62rem;
    right: 0.62rem;
    bottom: 0.2rem;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--ink-900) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.nav-link.active {
    color: var(--ink-900) !important;
}

.navbar-toggler {
    border: 1px solid rgba(16, 36, 58, 0.35);
    box-shadow: none !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(47, 116, 189, 0.2) !important;
}

.navbar-toggler-icon {
    filter: invert(12%) sepia(29%) saturate(1195%) hue-rotate(173deg) brightness(91%) contrast(96%);
}

/* Hero and Headers */
.hero-section {
    min-height: min(90vh, 900px);
    margin-top: -92px;
    padding-top: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(to bottom, rgba(5, 15, 25, 0.28) 0%, rgba(5, 15, 25, 0.58) 100%),
        url('../images/modern-house-extension.jpeg') center/cover;
}

.hero-section::before {
    display: none;
}

.hero-section::after {
    display: none;
}

.hero-overlay {
    width: 100%;
    padding: clamp(5.4rem, 8vw, 8rem) 0 clamp(4rem, 6vw, 5.8rem);
    position: relative;
    z-index: 1;
}

.hero-section h1,
.hero-section p {
    color: #fff;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

.page-header {
    margin-top: -92px;
    padding-top: 142px !important;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(31, 91, 153, 0.94), rgba(76, 141, 205, 0.9)),
        url('../images/roof-construction.jpeg') center/cover !important;
}

.page-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.6) 0,
        rgba(255, 255, 255, 0.6) 14px,
        rgba(214, 123, 74, 0.8) 14px,
        rgba(214, 123, 74, 0.8) 28px
    );
}

.page-header h1,
.page-header p {
    color: #fff;
}

/* Surface blocks */
.bg-light {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.62)),
        radial-gradient(circle at 10% 15%, rgba(159, 200, 183, 0.24), transparent 42%) !important;
    border-top: 1px solid rgba(16, 36, 58, 0.08);
    border-bottom: 1px solid rgba(16, 36, 58, 0.08);
}

.bg-primary {
    background:
        linear-gradient(120deg, #1f5b99 0%, #2f74bd 58%, #4a95d7 100%) !important;
}

.bg-dark {
    background: linear-gradient(180deg, #0f2439 0%, #112b45 100%) !important;
}

.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6 {
    color: #fff;
}

/* Cards and media */
.card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: transform 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease;
    overflow: hidden;
}

.card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-300), var(--accent-300));
}

.card:hover {
    transform: translateY(-8px) rotate(-0.25deg);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(16, 36, 58, 0.24);
}

.card-body {
    padding: 1.45rem;
}

.card-img-top {
    height: 300px;
    object-fit: cover;
    border-radius: 0;
}

/* Service preview cards on homepage — taller to show subjects clearly */
.service-card-img {
    height: 340px;
}

/* Clickable gallery image overlay */
#galleryGrid .card {
    position: relative;
    overflow: hidden;
}

#galleryGrid .card-img-top {
    transition: transform 0.35s ease;
}

#galleryGrid .card:hover .card-img-top {
    transform: scale(1.04);
}

/* Expand icon badge — top-right of image */
#galleryGrid .card::after {
    content: '⛶';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0.65;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

#galleryGrid .card:hover::after {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(47, 116, 189, 0.85);
}

/* Touch devices: show a persistent "Tap to expand" pill since hover doesn't exist */
@media (hover: none) {
    #galleryGrid .card::after {
        content: '⛶  Tap to expand';
        width: auto;
        height: auto;
        border-radius: 20px;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        padding: 5px 12px;
        top: auto;
        right: auto;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        opacity: 1;
        background: rgba(0, 0, 0, 0.62);
        white-space: nowrap;
    }
}

.hover-card {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.hover-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover) !important;
}

.shadow,
.shadow-sm {
    box-shadow: var(--card-shadow) !important;
}

.rounded,
.img-fluid.rounded {
    border-radius: 18px !important;
}

.gallery-item {
    overflow: hidden;
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    background: #fff;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item img {
    transition: transform 0.55s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

/* Buttons */
.btn {
    border-radius: 12px;
    padding: 0.72rem 1.38rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    box-shadow: 0 10px 22px rgba(31, 91, 153, 0.28);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: linear-gradient(135deg, #1a4d82, #2b68aa);
    box-shadow: 0 14px 26px rgba(31, 91, 153, 0.34);
}

.btn-outline-primary {
    color: var(--ink-900);
    border-color: rgba(16, 36, 58, 0.35);
    background: rgba(255, 255, 255, 0.74);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #1f5b99, #2f74bd);
}

.btn-light {
    color: var(--ink-900);
    background: linear-gradient(180deg, #ffffff, #ebf1fa);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.btn-light:hover,
.btn-light:focus-visible {
    color: var(--ink-900);
    background: linear-gradient(180deg, #ffffff, #dfeaf8);
}

.btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.72);
}

.btn-outline-light:hover,
.btn-outline-light:focus-visible {
    color: #1f5b99;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
}

.btn-lg {
    padding: 0.86rem 1.9rem;
    font-size: 1rem;
}

/* Service page images — consistent height regardless of photo orientation */
.service-section-img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* Components */
.text-primary,
.service-icon i,
.bi.text-primary {
    color: var(--brand-600) !important;
}

.text-warning,
.text-warning i {
    color: #d79b40 !important;
}

.badge {
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.45rem 0.68rem;
    border-radius: 999px;
}

.badge.bg-primary {
    color: #1f5b99;
    background: rgba(134, 180, 228, 0.3) !important;
}

.badge.bg-success {
    color: #2e6f54;
    background: rgba(159, 200, 183, 0.28) !important;
}

.badge.bg-warning {
    color: #8f5d22;
    background: rgba(229, 181, 103, 0.32) !important;
}

.badge.bg-info {
    color: #2e7398;
    background: rgba(141, 207, 237, 0.3) !important;
}

.badge.bg-danger {
    color: #9a4e35;
    background: rgba(229, 163, 125, 0.3) !important;
}

.stat-item {
    height: 100%;
    padding: 1.3rem;
    border-radius: 18px;
    border: 1px dashed rgba(31, 91, 153, 0.35);
    background: rgba(255, 255, 255, 0.83);
    box-shadow: var(--card-shadow);
}

.alert {
    border-radius: 16px;
    border: 1px solid rgba(16, 36, 58, 0.15);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink-700);
}

.alert-info,
.alert-primary {
    background: linear-gradient(180deg, rgba(229, 240, 252, 0.78), rgba(241, 248, 255, 0.88));
    color: var(--ink-700);
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid rgba(16, 36, 58, 0.24);
    padding: 0.77rem 0.95rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink-900);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(47, 116, 189, 0.8);
    box-shadow: 0 0 0 0.2rem rgba(47, 116, 189, 0.18);
}

.form-label {
    font-weight: 700;
    color: var(--ink-900);
}

.form-check-input {
    border-color: rgba(16, 36, 58, 0.35);
}

.form-check-input:checked {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
}

.accordion-item {
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
}

.accordion-button {
    color: var(--ink-900);
    font-weight: 700;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    color: var(--ink-900);
    background: rgba(134, 180, 228, 0.24);
}

.accordion-button:focus {
    border-color: rgba(47, 116, 189, 0.42);
}

/* Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

footer .text-muted,
footer a.text-muted,
footer p,
footer li {
    color: rgba(224, 236, 250, 0.86) !important;
}

footer a.text-muted:hover {
    color: rgba(255, 255, 255, 0.98) !important;
}

footer hr {
    opacity: 0.26;
}

/* Reveal motion */
[data-reveal] {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    body {
        padding-top: 88px;
    }

    .navbar .container {
        border-radius: 12px;
    }

    .navbar-collapse {
        margin-top: 0.6rem;
        border-radius: 12px;
        padding: 0.65rem;
        border: 1px solid rgba(16, 36, 58, 0.2);
        background: rgba(255, 252, 245, 0.95);
    }

    .hero-section,
    .page-header {
        margin-top: -88px;
    }

    .page-header {
        padding-top: 126px !important;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        min-height: 76vh;
        padding-top: 102px;
    }

    .hero-overlay {
        padding-top: 3.9rem;
        padding-bottom: 3.5rem;
    }

    .display-3 {
        font-size: 2.28rem;
    }

    .display-4 {
        font-size: 1.96rem;
    }

    .display-5 {
        font-size: 1.68rem;
    }

    .display-6 {
        font-size: 1.43rem;
    }

    .btn-lg {
        width: 100%;
    }

    .hero-section::after {
        display: none;
    }
}

@media (max-width: 575.98px) {
    body {
        padding-top: 82px;
    }

    .navbar-brand {
        font-size: 1.24rem;
    }

    .navbar .container {
        padding: 0.38rem 0.68rem;
    }

    .card-img-top {
        height: 260px;
    }

    .service-card-img {
        height: 300px;
    }

    .card-body {
        padding: 1.12rem;
    }
}

@media print {
    .navbar,
    .btn,
    footer {
        display: none;
    }
}
