/* Reset & base */
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    padding: 0;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img {
    max-width: 100%;
    display: block;
}
a {
    color: inherit;
    text-decoration: none;
}
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease,
        border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}
.header.scrolled {
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: saturate(1.2) blur(10px);
    border-color: var(--line);
    box-shadow: var(--shadow);
}
.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.logo {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease-in-out;
}
.logo:hover {
    transform: scale(1.1);
}
.logo-sm {
    height: 28px;
}
.nav ul {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav a {
    opacity: 0.9;
}
.nav a:hover {
    opacity: 1;
}
.nav a.active {
    color: var(--primary);
}
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
}
.nav-toggle .bar {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    padding: 120px 0 80px;
}
.hero-inner {
    position: relative;
    z-index: 2;
}
.hero h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(34px, 6vw, 56px);
    line-height: 1.1;
}
.lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 760px;
}
.trust {
    margin-top: 14px;
}
.hero-bg-accent {
    display: none;
}

/* Sections */
.section {
    padding: 90px 0;
}
.section-alt {
    background: var(--bg-alt);
}
.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(26px, 4vw, 36px);
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}
.accent {
    color: var(--primary);
}
.link {
    color: var(--primary-light);
    font-weight: 500;
}

/* Cards / grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.card {
    background: #1d1d1d;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--elevate);
}
.cards .card h3 {
    margin-top: 0;
}

/* Global thumbnail placeholder (.ph) for the entire site */
.ph {
    height: clamp(160px, 30vw, 240px); /* dynamic height */
    border-radius: 12px;
    background-size: cover;
    background-position: top;
    border: 1px solid var(--line);
    margin-bottom: 12px;
}

/* Portfolio items hover */
.portfolio-item {
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 0.12s ease, background 0.3s ease,
        border-color 0.3s ease, color 0.3s ease;
    will-change: transform;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}
.btn-primary {
    background: var(--primary);
    color: #111;
    border-color: transparent;
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}
.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0;
}

/* Process */
.process {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.process li {
    background: #1d1d1d;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
}
.process li span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #111;
    font-weight: 700;
    margin-right: 8px;
}

/* Forms (global) */
.form {
    max-width: 760px;
    margin: 16px auto 0;
}
.form-grid .form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
label {
    font-weight: 600;
}
input,
textarea {
    background: #151515;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: var(--font-body);
}
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.form-actions {
    margin-top: 12px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--line);
    padding: 40px 0;
    background: #121212;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
}
.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-links li {
    margin: 6px 0;
}

/* Footer responsive layout */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr; /* stack all columns */
        text-align: center;
        gap: 32px;
    }
    .footer-grid img {
        margin: 0 auto;
    }
}

.muted {
    color: var(--text-muted);
}

/* Reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.reveal-in {
    opacity: 1;
    transform: none;
}
.delay-1 {
    transition-delay: 0.08s;
}
.delay-2 {
    transition-delay: 0.16s;
}
.delay-3 {
    transition-delay: 0.24s;
}

/* ======= Responsive (global grids & nav) ======= */
@media (max-width: 1200px) {
    /* optional container breathing room stays from base */
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    /* grid-2 stays 2 cols here */
}

/*mobile nav*/
/* ===== MOBILE NAV: LEFT DRAWER ONLY ===== */
@media (max-width: 768px) {
    /* Keep header fixed so content doesn't slip under it */
    .grid-3,
    .grid-2,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }

    .header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 9999;
    }
    main {
        padding-top: 70px;
    } /* matches header height */

    /* Toggle button visible on mobile */
    .nav-toggle {
        display: block;
        z-index: 10001;
    }

    /* Drawer container (below header, slides from LEFT) */
    .nav {
        position: fixed;
        top: 70px; /* sit below header */
        left: 0;
        height: calc(100vh - 70px);
        width: 260px;
        background: #111;
        border-right: 1px solid var(--line);
        padding: 24px;
        transform: translateX(-100%); /* hidden off-screen left */
        transition: transform 0.3s ease;
        z-index: 10000;
    }
    .nav.open {
        transform: translateX(0);
    }

    /* Vertical links */
    .nav ul {
        flex-direction: column;
        gap: 18px;
        text-align: left;
        padding: 0;
        margin: 0;
    }
    .nav a {
        font-size: 1.1rem;
        display: block;
        padding: 6px 0;
    }

    /* Dimmed overlay behind the drawer (but above page) */
    .nav-overlay {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0; /* below header */
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(3px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 9998;
    }
    .nav-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Prevent body scroll when drawer open */
    body.nav-open {
        overflow: hidden;
    }
}

/* ======= Contact page layout & fixes ======= */
.contact-layout {
    display: grid;
    grid-template-columns: 0.6fr 1.4fr; /* 35% / 65% desktop */
    gap: 32px;
    margin-top: 40px;
}

/* Ensure the form fills its grid column on contact page */
.contact-layout .form {
    max-width: 100%;
    margin: 0;
    width: 100%;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 18px; /* equal spacing between all fields */
}

/* Make left card auto-height & tidy */
.contact-info {
    padding: 24px;
    border-radius: var(--radius);
    background: #1d1d1d;
    border: 1px solid var(--line);
    box-shadow: var(--elevate);
    align-self: start;
}

.contact-info a {
    color: var(--primary-light);
    font-weight: 500;
    text-decoration: none;
}

/* Field internals */
.contact-layout .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.contact-layout .form input,
.contact-layout .form textarea {
    width: 100%;
    font-size: 15px;
}
.contact-layout textarea {
    min-height: 140px;
    resize: vertical;
}
.contact-layout .form-actions {
    margin-top: 10px;
}
.contact-layout .btn-primary {
    width: auto;
    padding: 12px 26px;
}

/* Contact responsive */
@media (max-width: 900px) {
    .contact-layout {
        grid-template-columns: 1fr;
    } /* stack earlier on small laptops/tablets */
}
@media (max-width: 600px) {
    /* center the submit button on small screens only */
    .contact-layout .form-actions {
        display: flex;
        justify-content: center;
    }
}

/* Honeypot field (keep invisible) */
.hp-field {
    display: none !important;
}

/* Contact success modal */
.contact-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.contact-modal-content {
    background: #1b1b1b;
    border: 1px solid var(--line);
    padding: 32px;
    border-radius: 14px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.contact-modal-content h3 {
    margin-bottom: 10px;
}

.tech-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    padding: 22px 0;
    align-items: center;
}

.tech-ribbon i {
    font-size: 48px;
    opacity: 0.9;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tech-ribbon i:hover {
    transform: translateY(-4px);
    opacity: 1;
}

@media (max-width: 600px) {
    .tech-ribbon {
        justify-content: center;
        gap: 18px;
    }
    .tech-ribbon i {
        font-size: 40px;
    }
}

.seo-hide {
    position: absolute;
    left: -9999px;
    opacity: 0;
}
