/* ==========================================================
   TowDynamiq shared site chrome: header, mobile menu, footer, buttons.
   Used by the homepage (home.css) and /demo (demo.css) via
   templates/partials/site_header.html and site_footer.html.

   Everything here is scoped to the partials (variables, reset, base
   typography) so it cannot clash with a page's own :root variables or
   global selectors. Values match home.css (kit teal #0E8F8C).
   ========================================================== */

.site-header,
.mobile-nav-overlay,
.site-footer {
    --navy:        #002f44;
    --navy-light:  #004d66;
    --navy-dark:   #001f2e;
    --teal:        #0E8F8C;
    --teal-dark:   #0A7370;
    --teal-light:  #22B5B2;
    --white:       #ffffff;
    --radius-sm:   8px;
    --font:        'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition:  all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font);
    line-height: 1.7;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Base resets use :where() so they have ZERO specificity: they never out-rank component classes
   (.logo-img, .nav-link ...) and never leak into the page's own selectors. */
:where(.site-header, .mobile-nav-overlay, .site-footer),
:where(.site-header, .mobile-nav-overlay, .site-footer) :where(*, *::before, *::after),
:where(.btn) {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:where(.site-header, .mobile-nav-overlay, .site-footer) a { text-decoration: none; color: inherit; transition: var(--transition); }
:where(.site-header, .mobile-nav-overlay, .site-footer) ul { list-style: none; }
:where(.site-header, .site-footer) img { max-width: 100%; height: auto; display: block; }
:where(.site-header, .mobile-nav-overlay, .btn) button, :where(.btn) { font-family: var(--font); }

.container {
    max-width: 1140px;
    width: 90%;
    margin: 0 auto;
    padding: 0 20px;
}


/* ===== Shared Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-sm {
    padding: 9px 22px;
    font-size: 14px;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 17px;
}

.btn-accent {
    background: var(--teal);
    color: var(--white);
    border-color: var(--teal);
}

.btn-accent:hover {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 143, 140, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
    transform: translateY(-2px);
}

.btn-full { width: 100%; }


/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 31, 46, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.site-header.scrolled {
    background: rgba(0, 31, 46, 0.95);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.12);
}

.header-container {
    max-width: 1140px;
    width: 90%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

/* Logo */
.logo { flex-shrink: 0; }

.logo-img {
    height: 38px;
    width: auto;
}

.logo-icon { display: none; height: 34px; }

/* Desktop Nav */
.main-nav { display: flex; align-items: center; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-login {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 6px;
}

.header-login:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-toggle.open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-toggle.open .hamburger-line:nth-child(2) { opacity: 0; }
.mobile-toggle.open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 68px;
    background: var(--navy-dark);
    z-index: 999;
    overflow-y: auto;
}

.mobile-nav-overlay.open {
    display: block;
    animation: fadeSlideDown 0.25s ease;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-nav { padding: 20px 24px 40px; }

.mobile-nav-links { margin-bottom: 20px; }

.mobile-nav-link {
    display: block;
    padding: 14px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-nav-link:hover { color: var(--teal-light); }

.mobile-login-btn {
    display: block;
    text-align: center;
    padding: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.mobile-demo-btn {
    display: block;
    box-sizing: border-box;
    width: 100%;
    text-align: center;
    padding: 14px;
    background: var(--teal);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}

.mobile-demo-btn:hover { background: var(--teal-dark); }


/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--navy-dark);
    color: rgba(255, 255, 255, 0.6);
    padding: 56px 0 0;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr repeat(2, 0.7fr);
    gap: 36px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-logo {
    height: 72px;
    width: auto;
    margin-bottom: 14px;
}

.footer-brand p {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
    max-width: 280px;
}

.footer-col h4 {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col ul li { margin-bottom: 8px; }

.footer-col ul li a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
}

.footer-col ul li a:hover {
    color: var(--teal-light);
}

/* Footer Bottom */
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

.footer-email { color: rgba(255, 255, 255, 0.35); }
.footer-email:hover { color: var(--teal-light); }



/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .header-actions { display: none; }
    .mobile-toggle { display: flex; }
    .main-nav { display: none; }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .container { width: 92%; padding: 0 16px; }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }
    .footer-brand { text-align: center; }
    .footer-brand p { max-width: 100%; }
    .footer-logo { margin: 0 auto 14px; }
    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }


    .btn { padding: 12px 22px; font-size: 14px; }
    .btn-lg { padding: 14px 28px; font-size: 15px; }
}

@media (max-width: 600px) {
    .logo-img { height: 30px; }
}

/* Icon-only logo only on very narrow phones */
@media (max-width: 339px) {
    .logo-full { display: none; }
    .logo-icon { display: block; height: 34px; }
}

