:root {
    --navy:#1A2942;
    --orange:#F57C00;
    --muted:#F5F7FA;
    --card:#ffffff;
    --radius:14px;
    --max-width:1100px;
    font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    color: var(--navy);
    background: linear-gradient(180deg, var(--muted), #fff);
}

.container {
    max-width: var(--max-width);
    margin: auto;
    padding: 28px;
}

/* HEADER */
header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:18px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    width:90px;
    height:auto;
}

/* Fix alignment of HandyMaz text & tagline */
.logo-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo-text h1 {
    margin: 0;
    line-height: 1.05;
}

.tag {
    font-size: 12px;
    color: #65758a;
    margin: 0;
}

nav a {
    margin-left:18px;
    text-decoration:none;
    color:var(--navy);
    font-weight:600;
}

.cta {
    background:var(--orange);
    color:white;
    padding:10px 14px;
    border-radius:10px;
    text-decoration:none;
    font-weight:700;
}

/* HERO */
.hero {
    display:grid;
    grid-template-columns:1fr 420px;
    gap:28px;
    align-items:center;
    margin-top:24px;
}

.hero-card {
    background:linear-gradient(180deg,#fff,#fbfdff);
    padding:28px;
    border-radius:var(--radius);
    box-shadow:0 8px 30px rgba(26,41,66,0.08);
}

.headline {
    font-family:'Montserrat',sans-serif;
    font-size:34px;
    margin:0 0 12px;
}

.sub {
    color:#55667a;
    margin-bottom:18px;
}

.hero-cta {
    display:flex;
    gap:12px;
}

.btn {
    padding:12px 16px;
    border-radius:10px;
    border:0;
    font-weight:700;
    cursor: pointer;
}

.btn-primary {
    background:var(--navy);
    color:white;
}

.btn-outline {
    background:transparent;
    border:2px solid var(--navy);
    color:var(--navy);
}

.stats {
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap:12px;
    margin-top:18px;
}

.stat {
    background:var(--muted);
    padding:10px;
    border-radius:10px;
    text-align:center;
    min-width:110px;
}

/* SERVICES */
.services {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:18px;
    margin-top:28px;
}

.service {
    background:var(--card);
    padding:18px;
    border-radius:12px;
    box-shadow:0 6px 18px rgba(26,41,66,0.04);
}

.service h3 {
    margin:6px 0 10px;
}

.icon {
    width:46px;
    height:46px;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(180deg,var(--navy),#2b3f63);
    color:white;
    font-weight:700;
}

/* SPLIT (About + Contact) */
.split {
    display:grid;
    grid-template-columns:1fr 420px;
    gap:20px;
    margin-top:30px;
}

.about {
    background:linear-gradient(180deg,#fff,#fcfeff);
    padding:22px;
    border-radius:var(--radius);
    box-shadow:0 8px 30px rgba(26,41,66,0.04);
}

.about img {
    width:120px;
    height:120px;
    border-radius:12px;
    object-fit:cover;
    float:right;
    margin-left:12px;
}

form .field {
    display:flex;
    flex-direction:column;
    margin-bottom:12px;
}

input,
textarea {
    padding:12px;
    border-radius:8px;
    border:1px solid #dde6ef;
    font-family:inherit;
}

textarea {
    min-height:120px;
}

/* REVIEWS */
.reviews {
    margin-top:22px;
    display:flex;
    gap:12px;
    overflow:auto;
    padding-bottom:6px;
}

.review {
    min-width:260px;
    background:white;
    padding:14px;
    border-radius:12px;
    box-shadow:0 6px 18px rgba(26,41,66,0.03);
}

.stars {
    color:var(--orange);
    font-weight:700;
}

/* FOOTER */
footer {
    padding:26px 0;
    margin-top:36px;
    border-top:1px solid #e6eef6;
    color:#546877;
}

/* =========================
   PROJECTS CAROUSEL
   ========================= */
.projects-carousel {
    margin-top: 40px;
    text-align: center;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
}

.carousel-track {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #e9edf3;
    min-height: 520px;
}

.carousel-track img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    display: none;
    border-radius: 18px;
}

.carousel-track img.active {
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 41, 66, 0.85);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c8d0db;
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.carousel-dots .dot.active {
    background: #F57C00;
    width: 22px;
}

/* =========================
   LIGHTBOX
   ========================= */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
}
#lightboxImg {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #1A2942;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    color: #1A2942;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-nav.prev { left: -12px; }
.lightbox-nav.next { right: -12px; }

/* RESPONSIVE */
@media (max-width: 980px) {
    .hero,
    .split {
        /* switch to block stacking to avoid iOS grid width quirks */
        display: block;
    }
    .hero > * + *,
    .split > * + * { margin-top: 20px; }
    /* keep previous intent: children should span full container width */
    .hero { justify-items: stretch; }
    .split { justify-items: stretch; }
    /* ensure the direct grid items stretch full width (Safari quirk) */
    .hero > *,
    .split > * {
        justify-self: stretch;
        width: 100%;
    }
    /* ensure hero cards fill the line like other sections */
    .hero .hero-card,
    .hero > aside > div {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
    /* ensure split section cards also fill container width */
    .split > aside > div,
    .split .about {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
    .services {
        grid-template-columns: repeat(2, 1fr);
    }
    nav a {
        display: none;
    }
}

@media (max-width: 560px) {
    .services {
        grid-template-columns: 1fr;
    }

    /* keep header/brand left-aligned on phones for consistent alignment */
    header { justify-content: flex-start; }
    .logo { justify-content: flex-start; text-align: left; }
    .logo-text { align-items: flex-start; }
    .tag { text-align: left; }

    .logo img {
        width:56px;
        height:auto;
    }

    .headline {
        font-size:26px;
    }

    /* smaller carousel on phones */
    .carousel-track {
        min-height: 400px;
    }
    .carousel-track img {
        height: 400px;
    }
}
