/**
 * sitewide.css - Universal styles for all Fuelshield pages
 * Includes: Theme variables, base styles, header, footer, buttons, utilities
 */

/* --- THEME & BRAND ALIGNMENT --- */
:root {
    /* Typography */
    --font-sans: 'Space Grotesk', sans-serif;
    --fz-xxl: 28px;
    --fz-xl: 24px;
    --fz-lg: 20px;
    --fz-md: 16px;
    --fz-sm: 14px;
    --fz-xs: 12px;

    /* Theming */
    --border-radius: 4px;
    --section-padding: 100px;
    --header-height: 80px;
    --transition-speed: 0.3s;

    /* Dark Theme Colors (Default) */
    --color-background: #122352;
    --color-surface: #1A2B5E;
    --color-border: #2D3A6B;
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #A0AEC0;
    --color-accent-primary: #00BCE5;
    --color-accent-secondary: #1B75BB;
    --color-glow: rgba(0, 188, 229, 0.5);
}

html.light-theme,
.light-theme {
    /* Light Theme Color Overrides */
    --color-background: #F7FAFC;
    --color-surface: #FFFFFF;
    --color-border: #E2E8F0;
    --color-text-primary: #1A202C;
    --color-text-secondary: #4A5568;
}

/* --- Base & Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
    background-color: var(--color-background);
    background-image: linear-gradient(to bottom, var(--color-background), var(--color-surface));
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

body {
    margin: 0;
    min-height: 100vh;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: var(--font-sans);
    font-size: var(--fz-md);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    transition: color var(--transition-speed);
    display: flex;
    flex-direction: column;
}

body.mobile-nav-open {
    overflow: hidden;
}

/* Grid Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(rgba(128,128,128,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128,128,128,0.05) 1px, transparent 1px);
    background-size: 25px 25px;
    z-index: -1;
    pointer-events: none;
}

/* --- Layout & Typography --- */
main {
    padding: 0 25px;
    flex: 1; 
}

.main-content {
    padding-top: var(--header-height);
}

section {
    padding-top: 60px;
    padding-bottom: var(--section-padding);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 10px 0;
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.1;
    transition: color var(--transition-speed);
}

h2 {
    display: flex;
    align-items: center;
    position: relative;
    margin: 10px 0 40px;
    width: 100%;
    font-size: clamp(26px, 5vw, 32px);
    white-space: nowrap;
}

h2::after {
    content: '';
    display: block;
    position: relative;
    top: 2px;
    width: 300px;
    height: 1px;
    margin-left: 20px;
    background-color: var(--color-border);
    transition: background-color var(--transition-speed);
}

/* Section titles that are H1s but styled like H2s */
h1.section-title {
    display: flex;
    align-items: center;
    position: relative;
    margin: 10px 0 40px;
    width: 100%;
    font-size: clamp(26px, 5vw, 32px);
    white-space: nowrap;
}

h1.section-title::after {
    content: '';
    display: block;
    position: relative;
    top: 2px;
    width: 300px;
    height: 1px;
    margin-left: 20px;
    background-color: var(--color-border);
    transition: background-color var(--transition-speed);
}

p {
    margin: 0 0 15px 0;
    font-weight: 400;
}

a {
    text-decoration: none;
    color: var(--color-accent-primary);
    transition: color 0.25s ease;
}

a:hover {
    color: var(--color-accent-secondary);
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.section-subtitle {
    text-align: left;
    max-width: 700px;
    margin: 0 0 50px 0;
    font-size: var(--fz-lg);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* --- Header --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    z-index: 11;
    padding: 0 50px;
    width: 100%;
    height: var(--header-height);
    background-color: color-mix(in srgb, var(--color-background) 85%, transparent);
    backdrop-filter: blur(10px);
    transition: background-color var(--transition-speed);
}

.logo img {
    height: 35px;
    width: auto;
    display: block;
}

/* Logo theme swapping */
.logo .logo-light {
    display: none;
}

.light-theme .logo .logo-dark {
    display: none;
}

.light-theme .logo .logo-light {
    display: block;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.desktop-nav li {
    margin: 0 15px;
    font-family: var(--font-sans);
    font-size: var(--fz-md);
    font-weight: 600;
}

.desktop-nav a:not(.btn) {
    color: var(--color-text-primary);
}

.desktop-nav a:not(.btn):hover {
    color: var(--color-accent-primary);
}

/* --- Theme Toggle --- */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.25s ease;
}

.theme-toggle:hover {
    color: var(--color-accent-primary);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

.theme-toggle .icon-moon {
    display: block;
}

.theme-toggle .icon-sun {
    display: none;
}

.light-theme .theme-toggle .icon-sun {
    display: block;
}

.light-theme .theme-toggle .icon-moon {
    display: none;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--color-accent-primary);
    background-color: transparent;
    border: 1px solid var(--color-accent-primary);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: var(--fz-md);
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    text-align: center;
}

.btn:hover {
    background-color: rgba(0, 188, 229, 0.1);
    color: var(--color-text-primary);
    box-shadow: 0 0 10px var(--color-glow);
}

.light-theme .btn:hover {
    color: var(--color-accent-secondary);
}

.btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
}

.btn.btn-nav {
    padding: 0.6rem 1.2rem;
    font-size: var(--fz-sm);
    gap: 8px;
}

/* --- Mobile Navigation --- */
.mobile-nav-toggle {
    display: none;
}

.mobile-nav {
    display: none;
}

/* --- Footer --- */
.main-footer {
    padding: 50px 0;
    font-family: var(--font-sans);
    font-size: var(--fz-sm);
    text-align: center;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 20px;
}

.footer-socials a {
    color: var(--color-text-secondary);
    transition: color 0.25s ease, transform 0.25s ease;
    display: inline-block;
}

.footer-socials a:hover {
    color: var(--color-accent-primary);
    transform: translateY(-2px);
}

.footer-socials svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.footer-links a {
    color: var(--color-text-secondary);
    display: inline-block;
    transition: color 0.25s ease, transform 0.25s ease;
}

.footer-links a:hover {
    color: var(--color-accent-primary);
    transform: translateY(-2px);
}

.price-ticker {
    margin-bottom: 20px;
    font-size: var(--fz-sm);
}

.price-ticker .label {
    color: var(--color-text-secondary);
    margin-right: 10px;
}

.price-ticker .price {
    color: var(--color-accent-primary);
    font-weight: 600;
    background-color: var(--color-surface);
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
}

.copyright,
.footer-disclaimer {
    font-size: var(--fz-xs);
    color: var(--color-text-secondary);
    margin: 0;
}

.footer-disclaimer {
    margin-top: 20px;
    padding: 0 20px;
}

.footer-disclaimer a {
    font-weight: 600;
}

/* --- Utility Classes --- */
.turnstile-full-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: color-mix(in srgb, var(--color-background) 90%, transparent);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.page-content-hidden {
    display: none !important;
}

/* Prevent repaints on hover */
.footer-socials a,
.footer-links a,
.btn,
.tag,
.insight-card,
.bento-card,
.contact-info {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* --- Responsive Styles --- */
@media (max-width: 992px) {
    main {
        padding: 0 15px;
    }

    .main-header {
        padding: 0 25px;
    }

    .desktop-nav {
        display: none;
    }

    .section-subtitle {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    h2 {
        justify-content: center;
        text-align: center;
    }

    h2::after {
        display: none;
    }
    
    h1.section-title {
        justify-content: center;
        text-align: center;
    }
    
    h1.section-title::after {
        display: none;
    }

    /* Mobile Navigation Toggle */
    .mobile-nav-toggle {
        display: block;
        position: relative;
        z-index: 12;
        width: 30px;
        height: 22px;
        background: transparent;
        border: none;
        cursor: pointer;
    }

    .hamburger-bar {
        position: absolute;
        left: 0;
        width: 30px;
        height: 2px;
        background-color: var(--color-text-primary);
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .hamburger-bar.top {
        top: 0;
    }

    .hamburger-bar.middle {
        top: 10px;
    }

    .hamburger-bar.bottom {
        top: 20px;
    }

    .mobile-nav-toggle.is-active .hamburger-bar.top {
        transform: translateY(10px) rotate(45deg);
    }

    .mobile-nav-toggle.is-active .hamburger-bar.middle {
        opacity: 0;
    }

    .mobile-nav-toggle.is-active .hamburger-bar.bottom {
        transform: translateY(-10px) rotate(-45deg);
    }

    /* Mobile Navigation Menu */
    .mobile-nav {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--color-background);
        box-shadow: -10px 0px 30px -15px rgba(0,0,0,0.7);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out, background-color var(--transition-speed);
        padding: 50px;
        list-style: none;
        margin: 0;
        will-change: transform;
    }
    
    .mobile-nav.is-active {
        transform: translateX(0);
    }

    .mobile-nav-inner {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4rem;
        height: 100%;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .mobile-nav-main {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 0;
        list-style: none;
    }

    .mobile-nav-main li {
        margin: 10px 0;
    }

    .mobile-nav-main a {
        font-size: var(--fz-xl);
        padding: 10px;
    }

    .mobile-nav-footer {
        text-align: center;
        padding-bottom: 20px;
    }

    .mobile-socials {
        display: flex;
        justify-content: center;
        gap: 2rem;
        margin-bottom: 20px;
    }

    .mobile-socials a {
        color: var(--color-accent-primary);
    }

    .mobile-socials a:hover {
        color: var(--color-text-primary);
    }

    .mobile-socials svg {
        width: 28px;
        height: 28px;
        fill: currentColor;
    }

    .mobile-nav .copyright {
        font-size: var(--fz-xs);
    }

    /* Footer */
    .main-footer {
        padding: 50px 15px;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}
