/* ==========================================================================
   GRACE ROOFING GROUP - Layout & Navigation CSS
   ========================================================================== */

/* Navigation Header */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 16px 0;
}

@media (min-width: 768px) {
    .nav-header {
        padding: 24px 0;
    }
}

.nav-header.scrolled {
    background-color: rgba(27, 27, 29, 0.95);
    backdrop-filter: blur(12px);
    padding: 12px 0;
}

@media (min-width: 768px) {
    .nav-header.scrolled {
        padding: 16px 0;
    }
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .nav-inner {
        padding: 0 4vw;
    }
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--brass);
    transition: all 0.3s ease;
    z-index: 150;
    position: relative;
}

.nav-logo:hover {
    filter: brightness(1.1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

@media (min-width: 768px) {
    .nav-right {
        gap: 24px;
    }
}

.nav-cta {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--brass);
    color: var(--charcoal);
    font-size: 14px;
    font-weight: 500;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .nav-cta {
        display: flex;
    }
}

.nav-cta:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

/* Hamburger Menu Button - Always Visible */
.nav-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 150;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu-btn:hover {
    background: rgba(200, 166, 116, 0.1);
    border-color: rgba(200, 166, 116, 0.3);
}

.menu-btn-text {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    display: none;
}

@media (min-width: 768px) {
    .menu-btn-text {
        display: block;
    }
}

.menu-btn-icon {
    width: 24px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.menu-line {
    width: 100%;
    height: 2px;
    background: var(--brass);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.menu-line:first-child {
    width: 100%;
}

.menu-line:last-child {
    width: 60%;
    margin-left: auto;
}

.nav-menu-btn:hover .menu-line:last-child {
    width: 100%;
}

/* Premium Fullscreen Menu */
.fullscreen-menu {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}

.fullscreen-menu.open {
    pointer-events: all;
}

.menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(27, 27, 29, 0.6);
    backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-menu.open .menu-backdrop {
    opacity: 1;
}

.menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 27, 29, 0.98) 0%, rgba(35, 35, 38, 0.98) 100%);
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .menu-panel {
        width: 50%;
        min-width: 480px;
        max-width: 600px;
    }
}

.fullscreen-menu.open .menu-panel {
    transform: translateX(0);
}

.menu-bg-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(200, 166, 116, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(200, 166, 116, 0.05) 0%, transparent 40%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease 0.3s;
}

.fullscreen-menu.open .menu-bg-pattern {
    opacity: 1;
}

/* Menu Header */
.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .menu-header {
        padding: 24px 48px;
    }
}

.menu-close-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-close-btn:hover {
    background: rgba(200, 166, 116, 0.1);
    border-color: rgba(200, 166, 116, 0.3);
}

.close-text {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
}

.close-icon {
    width: 20px;
    height: 20px;
    position: relative;
}

.close-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--brass);
    border-radius: 2px;
}

.close-line:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-line:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Menu Body / Navigation */
.menu-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
}

@media (min-width: 768px) {
    .menu-body {
        padding: 32px 48px;
    }
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .menu-link {
        gap: 24px;
        padding: 20px 0;
    }
}

.fullscreen-menu.open .menu-link {
    opacity: 1;
    transform: translateX(0);
}

.fullscreen-menu.open .menu-link:nth-child(1) {
    transition-delay: 0.15s;
}

.fullscreen-menu.open .menu-link:nth-child(2) {
    transition-delay: 0.2s;
}

.fullscreen-menu.open .menu-link:nth-child(3) {
    transition-delay: 0.25s;
}

.fullscreen-menu.open .menu-link:nth-child(4) {
    transition-delay: 0.3s;
}

.fullscreen-menu.open .menu-link:nth-child(5) {
    transition-delay: 0.35s;
}

.fullscreen-menu.open .menu-link:nth-child(6) {
    transition-delay: 0.4s;
}

.menu-link:hover {
    padding-left: 8px;
    border-bottom-color: rgba(200, 166, 116, 0.3);
}

.menu-link-number {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--brass);
    opacity: 0.6;
    min-width: 24px;
}

.menu-link-text {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    flex: 1;
    transition: color 0.3s ease;
}

@media (min-width: 768px) {
    .menu-link-text {
        font-size: 32px;
    }
}

.menu-link:hover .menu-link-text {
    color: var(--brass);
}

.menu-link-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--brass);
}

.menu-link:hover .menu-link-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Menu Footer */
.menu-footer {
    padding: 24px;
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.4s;
}

@media (min-width: 768px) {
    .menu-footer {
        padding: 32px 48px;
    }
}

.fullscreen-menu.open .menu-footer {
    opacity: 1;
    transform: translateY(0);
}

.menu-cta {
    margin-bottom: 32px;
}

.menu-cta .pill-button {
    width: 100%;
    justify-content: center;
}

.menu-contact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 480px) {
    .menu-contact {
        grid-template-columns: 1fr 1fr;
    }
}

.menu-contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-contact-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
}

.menu-contact-value {
    font-size: 14px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

a.menu-contact-value:hover {
    color: var(--brass);
}

.menu-decor {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-decor-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(200, 166, 116, 0.3) 0%, transparent 100%);
}

.menu-decor-line:last-child {
    background: linear-gradient(90deg, transparent 0%, rgba(200, 166, 116, 0.3) 100%);
}

.menu-decor-text {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--brass);
    opacity: 0.6;
    white-space: nowrap;
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 100;
    background-color: var(--charcoal);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-main {
    padding: 48px 16px;
}

@media (min-width: 768px) {
    .footer-main {
        padding: 64px 6vw;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr repeat(3, auto);
        gap: 32px;
    }
}

.footer-brand {
    margin-bottom: 24px;
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    display: block;
}

.footer-brand-sub {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--brass);
    display: block;
}

.footer-description {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-badge {
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.footer-social-link:hover {
    background: rgba(200, 166, 116, 0.12);
    border-color: rgba(200, 166, 116, 0.3);
    color: var(--brass);
}

.footer-social-link svg {
    width: 18px;
    height: 18px;
}

.footer-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--brass);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-contact-icon {
    flex-shrink: 0;
    margin-top: 4px;
}

.footer-contact-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.footer-contact-value {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.footer-contact-value:hover {
    color: var(--brass);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px 16px;
}

@media (min-width: 768px) {
    .footer-bottom {
        padding: 24px 6vw;
    }
}

.footer-bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

@media (min-width: 768px) {
    .footer-bottom-inner {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-copyright {
    font-size: 14px;
    color: rgba(185, 181, 170, 0.6);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-copyright {
        text-align: left;
    }
}

.footer-credit {
    font-size: 12px;
    color: rgba(185, 181, 170, 0.4);
}

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: var(--charcoal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preloader-logo {
    margin-bottom: 48px;
    text-align: center;
}

.preloader-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 30px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.preloader-sub {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--brass);
    margin-top: 4px;
}

.preloader-bar {
    width: 256px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
    transform-origin: left;
}

.preloader-progress {
    height: 100%;
    background: linear-gradient(to right, var(--brass), var(--brass-light));
    border-radius: 9999px;
    transition: width 0.1s ease-out;
}

.preloader-text {
    margin-top: 24px;
    text-align: center;
}

.preloader-label {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
}

.preloader-percent {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--brass);
    margin-left: 8px;
}

.preloader-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.preloader-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: rgba(200, 166, 116, 0.2);
    border-radius: 50%;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: difference;
    opacity: 0;
}

.cursor-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--brass);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor-ring {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(200, 166, 116, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

@media (pointer: coarse) {
    .custom-cursor {
        display: none;
    }
}

/* WordPress Admin Bar (prevents fixed header overlap while logged in) */
/* WP adds `html { margin-top: ... }` when the admin bar is visible. In this theme,
   that can create a second scroll container (double scrollbar) and break GSAP ScrollTrigger.
   We keep the admin bar overlay behavior and offset only the fixed header. */
html {
    margin-top: 0 !important;
}

body.admin-bar .nav-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .nav-header {
        top: 46px;
    }
}