/* ==========================================================================
   1. GLOBAL ARCHITECTURE & SYSTEM DESIGN VARIABLE ARRAY
   ========================================================================== */
:root {
    --bg-primary: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.75);
    --text-main: #1a1a1a;
    --accent: #5e60ce;
    --toggle-bg: #e4e6eb;
    --nav-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    --border-glass: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-primary: #0f1016;
    --bg-nav: rgba(15, 16, 22, 0.75);
    --text-main: #f5f5f7;
    --accent: #72efdd;
    --toggle-bg: #2f3136;
    --nav-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    --border-glass: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   2. CORE DOCUMENT BASELINE DECORATION RESET
   ========================================================================== */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    /* Prevents unwanted horizontal breaking layout bugs */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Global Document Utility System Scrollbar Tuning */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-main);
    border: 2px solid var(--bg-primary);
    border-radius: 10px;
}

/* ==========================================================================
   3. SHARED GLOBAL NAVIGATION HEADER
   ========================================================================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 4rem;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: var(--nav-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.nav-logo a {
    font-size: 1.6rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    letter-spacing: -1px;
}

.nav-logo span {
    color: var(--accent);
}

.navbar nav {
    display: flex;
    margin-left: auto;
    margin-right: 3rem;
}

.navbar ul {
    display: flex;
    align-items: center;
    gap: 2.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Visual Layout Grid Alignment Sorting Targets */
.mode-toggle {
    order: 3;
}

.navbar nav {
    order: 2;
}

.nav-logo {
    order: 1;
}

.link-home {
    order: 4;
}

.link-about {
    order: 3;
}

.link-projects {
    order: 2;
}

.link-contact {
    order: 1;
}

.navbar ul a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    padding: 0.4rem 0;
    transition: color 0.3s ease;
}

.navbar ul a:hover {
    color: var(--accent);
}

.navbar ul a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar ul a:hover::after {
    width: 100%;
}

/* Custom Sliding Light/Dark Switch Tooling */
#mode-toggle-checkbox {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--toggle-bg);
    width: 60px;
    height: 32px;
    border-radius: 50px;
    padding: 0 5px;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.4s ease;
}

.toggle-icon {
    font-size: 0.95rem;
    z-index: 1;
    user-select: none;
}

.toggle-label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background-color: #ffffff;
    border-radius: 50px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

#mode-toggle-checkbox:checked+.toggle-label::after {
    transform: translateX(28px);
}

/* ==========================================================================
   4. SHARED GLOBAL FOOTER ARCHITECTURE
   ========================================================================== */
.global-footer {
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-glass);
    padding: 6rem 4rem 2rem 4rem;
    position: relative;
    overflow: hidden;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.footer-wave-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    opacity: 0.6;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
}

.footer-col h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--text-main);
}

.brand-col {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    letter-spacing: -1px;
}

.footer-logo span {
    color: var(--accent);
}

.brand-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.7;
    max-width: 320px;
    margin: 0;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--toggle-bg);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.social-link:hover {
    background-color: var(--text-main);
    border-color: var(--text-main);
    transform: translateY(-4px);
}

.social-link:hover .social-icon {
    transform: scale(1.15);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-main);
    opacity: 0.75;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--accent);
    opacity: 1;
    transform: translateX(4px);
}

.status-indicator-box {
    background: var(--toggle-bg);
    border: 1px solid var(--border-glass);
    padding: 1.2rem;
    border-radius: 16px;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.status-indicator-box p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.75;
}

.status-pulse-ring {
    width: 8px;
    height: 8px;
    background-color: #34c759;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    position: relative;
}

.status-pulse-ring::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #34c759;
    border-radius: 50%;
    top: 0;
    left: 0;
    animation: availabilityGlow 2s infinite ease-in-out;
}

@keyframes availabilityGlow {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

.footer-baseline {
    border-top: 1px solid var(--border-glass);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

.footer-baseline p {
    margin: 0;
}

.baseline-links {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.baseline-links a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

.baseline-links a:hover {
    color: var(--accent);
}

/* ==========================================================================
   5. COMPACT GLOBAL VIEWPORT MOBILE ADAPTATION
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 2rem;
    }

    .navbar nav {
        margin-right: 1.5rem;
    }

    .navbar ul {
        gap: 1.2rem;
    }

    .navbar ul a {
        font-size: 0.9rem;
    }

    .global-footer {
        padding: 4rem 2rem 2rem 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-bottom: 3.5rem;
    }

    .footer-baseline {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}