:root {
    --primary-color: rgb(21, 21, 27);
    --border-color: rgb(85, 85, 85);
    --text-light: rgb(240, 240, 240);
    --text-gray: rgb(180, 180, 180);
    --text-dark-gray: rgb(115, 115, 115);
    --card-bg: rgb(30, 30, 36);
    --card-border: rgb(60, 60, 70);
}

/* Universal fixes to prevent overflow */
html {
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

body {
    background-color: var(--primary-color);
    color: white;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', Courier, monospace;
}

/* Ensure main content doesn't cause overflow */
main {
    flex: 1 0 auto;
    width: 100%;
    overflow-x: hidden;
    padding-bottom: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1; /* Lower z-index for main content */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    max-width: 100vw;
}

.nav-logo {
    margin: 0.5rem 0;
}

.nav-logo img {
    max-height: 50px;
    width: auto;
}

.nav-buttons {
    display: flex;
    gap: 3rem;
    font-size: 1.1rem;
    align-items: center;
    font-family: 'Courier New', Courier, monospace;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-buttons a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0;
}

.nav-buttons a:hover {
    text-decoration: underline;
}

.fontawesome {
    font-size: 1.6rem;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000; /* Higher z-index for header */
    padding: 0.5rem;
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

footer {
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
}

.footer-text {
    width: 100%;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-gray);
    margin: 0;
    padding: 0.8rem 0;
    font-family: 'Courier New', Courier, monospace;
    box-sizing: border-box;
}

/* Contact form styling */
.contact-form {
    width: 40%;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 1rem 0;
}

.contact-form input {
    margin-left: 0;
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    margin-right: 1.5rem;
    padding: 1rem;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: white;
    font-size: 18px;
    font-family: 'Courier New', Courier, monospace;
    box-sizing: border-box;
}

.contact-form input:focus {
    border-bottom: 1px solid white;
    outline: none;
}

.input-name {
    display: flex;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.input-name input {
    width: calc(50% - 2rem);
}

.input-email input {
    width: calc(100% - 2rem);
}

.input-phone input {
    width: calc(100% - 2rem);
}

.input-message textarea {
    width: calc(100% - 2rem);
}

.input-submit {
    display: flex;
    justify-content: center;
}

.input-submit input {
    width: 50%;
    color: rgb(118, 118, 118);
}

.input-submit input:hover {
    border-bottom: 1px solid white;
    color: white;
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative; /* Enable z-index */
    z-index: 1100; /* Higher than header */
}








/* Popup styles matching your site's aesthetic */
.popup {
    display: none;
    position: fixed;
    z-index: 2000; /* Above header */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(21, 21, 27, 0.8); /* Using primary color with opacity */
    font-family: 'Courier New', Courier, monospace;
}

.popup-content {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    margin: 15% auto;
    padding: 2rem;
    border-radius: 0; /* Keeping with your site's square aesthetic */
    width: 40%;
    max-width: 500px;
    text-align: center;
    position: relative;
    color: var(--text-light);
}

.popup-content h2 {
    margin-top: 0;
    color: white;
    font-family: 'Courier New', Courier, monospace;
}

.popup-content p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-dark-gray);
    transition: color 0.3s ease;
}

.close-popup:hover {
    color: white;
}

/* Adding textarea styling for message field */
.input-message {
    width: 100%;
    box-sizing: border-box;
}

.input-message textarea {
    width: calc(100% - 2rem);
    margin-left: 0;
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    margin-right: 1.5rem;
    padding: 1rem;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: white;
    font-size: 18px;
    font-family: 'Courier New', Courier, monospace;
    box-sizing: border-box;
    resize: vertical;
    min-height: 100px;
}

.input-message textarea:focus {
    border-bottom: 1px solid white;
    outline: none;
}

/* Responsive adjustments for popup */
@media screen and (max-width: 1500px) {
    .popup-content {
        width: 60%;
    }
}

@media screen and (max-width: 1024px) {
    .popup-content {
        width: 70%;
    }
}

@media screen and (max-width: 840px) {
    .popup-content {
        width: 80%;
    }
}

@media screen and (max-width: 768px) {
    .popup-content {
        width: 85%;
    }
}

@media screen and (max-width: 600px) {
    .popup {
        padding-top: 4rem;
    }
    
    .popup-content {
        width: 70%;
        padding: 1.5rem;
    }
}

@media screen and (max-width: 430px) {
    .popup-content {
        width: 60%;
        padding: 1rem;
    }
}








/* Responsive adjustments at various breakpoints */
@media screen and (max-width: 1500px) {
    .contact-form {
        width: 60%;
    }
}

@media screen and (max-width: 1400px) {
    .nav-logo img {
        width: 80%;
    }
    
    .nav-buttons {
        gap: 2rem;
    }
}


@media screen and (max-width: 1024px) {
    .contact-form {
        width: 70%;
    }

    .nav-buttons {
        gap: 1.5rem;
    }
    
    nav {
        padding: 0 1rem;
    }
}

@media screen and (max-width: 840px) {
    .contact-form {
        width: 80%;
    }

    /* Menu toggle button becomes visible */
    .menu-toggle {
        display: block;
    }
    
    /* Navigation buttons become a dropdown */
    .nav-buttons {
        position: fixed;
        top: var(--header-height, 0);
        left: 0;
        right: 0;
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        gap: 1rem;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        pointer-events: none;
        z-index: 999; /* High but below header and toggle */
    }
    
    .nav-buttons.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    
    .nav-buttons a {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }
    
    nav {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media screen and (max-width: 768px) {
    /* Specific fix for iPad and similar sizes */
    html, body {
        overflow-x: hidden;
        width: 100vw;
        margin: 0;
        padding: 0;
    }
    
    main {
        width: 100%;
        overflow-x: hidden;
    }
    
    .contact-form {
        width: 85%;
    }
}

@media screen and (max-width: 600px) {
    html, body, main {
        overflow-x: hidden;
        width: 100%;
    }

    /* Stack name inputs vertically */
    .input-name {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    /* Reset ALL container divs to be consistent */
    .input-name,
    .input-email,
    .input-phone,
    .input-submit,
    .input-message {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Override the center alignment of submit button */
    .input-submit {
        justify-content: flex-start;
    }
    
    /* Make ALL inputs exactly the same width */
    .input-name input,
    .input-email input, 
    .input-phone input,
    .input-submit input,
    .input-message textarea {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
        box-sizing: border-box;
    }
}

@media screen and (max-width: 480px) {
    .nav-logo img {
        width: 60%;
    }
}

@media screen and (max-width: 430px) {
    .contact-form {
        width: 90%;
    }
}

@media screen and (max-width: 375px) {
    .contact-form {
        width: 92%;
    }
    
    .contact-form input {
        padding: 0.75rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
    }
}