/* =============================================================================
   global.css — hateqwq.xyz shared design system
   ============================================================================= */

/* --- 1. Design Tokens -------------------------------------------------------- */
:root {
    /* Original color palette — black/white/dark-gray */
    --color-bg-deepest:   #000000;
    --color-bg-base:      #0a0a0a;
    --color-bg-surface:   #1c1c1c;
    --color-bg-elevated:  #2a2a2a;
    --color-bg-mid:       #151515;
    --color-bg-divider:   #424242;
    --color-bg-overlay:   rgba(0, 0, 0, 0.70);

    /* Borders */
    --color-border-subtle:  rgba(255, 255, 255, 0.06);
    --color-border-default: rgba(255, 255, 255, 0.15);

    /* Accent — white, same as original */
    --color-accent:       #ffffff;
    --color-accent-glow:  rgba(255, 255, 255, 0.15);

    /* Text */
    --color-text-primary:   #ffffff;
    --color-text-secondary: #cccccc;
    --color-text-muted:     #888888;

    /* Nav */
    --color-nav-bg: rgba(0, 0, 0, 0.85);

    /* Font — original Montserrat */
    --font-main: 'Montserrat', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-main);
    color: var(--color-text-primary);
    background-color: var(--color-bg-deepest);
    overflow-x: hidden;
}

/* --- 3. Shared Animations ---------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes fadeBackground {
    0%   { opacity: 0; }
    10%  { opacity: 1; }
    20%  { opacity: 1; }
    30%  { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes warpBackground {
    0% {
        transform: scale(1.03) translate(-1.5%, -1.5%);
        filter: brightness(0.92) blur(0px);
    }
    50% {
        transform: scale(1.08) translate(1.5%, 1.5%);
        filter: brightness(1.02) blur(1px);
    }
    100% {
        transform: scale(1.05) translate(-0.8%, 1.2%);
        filter: brightness(0.96) blur(0px);
    }
}

/* --- 4. Navbar — frosted glass sticky --------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    background-color: var(--color-nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    opacity: 0;
    animation: slideDown 1s forwards 0.5s;
    width: 100%;
    box-sizing: border-box;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo {
    height: 55px;
    width: auto;
    opacity: 0.95;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.logo:hover {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar a {
    color: var(--color-text-primary);
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: bold;
    margin: 0 15px;
    text-decoration: none;
    transition: transform 0.3s, text-shadow 0.3s, color 0.3s;
    position: relative;
}

.navbar a:hover,
.navbar a:focus {
    transform: scale(1.1);
    text-shadow: 2px 2px 5px rgba(255, 255, 255, 0.5);
    color: #e0e0e0;
}

.navbar a:active {
    transform: scale(0.95);
}

.navbar a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: white;
    transition: all 0.3s ease;
}

.navbar a:hover::after,
.navbar a:focus::after {
    width: 100%;
    left: 0;
}

.navbar .logo-container::after {
    display: none;
}

/* Hide old divider — navbar border-bottom replaces it */
.divider {
    display: none !important;
}

/* Hamburger button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: rgba(0, 0, 0, 0.97);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
        z-index: 99;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 14px 24px;
        font-size: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        margin: 0;
        transform: none !important;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }
}

/* Tablet nav size */
@media (max-width: 768px) and (min-width: 641px) {
    .navbar a {
        font-size: 16px;
        margin: 0 10px;
    }
    .logo {
        height: 45px;
    }
}

/* --- 5. Footer --------------------------------------------------------------- */
footer,
.footer {
    background-color: var(--color-bg-deepest);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    margin-top: 0;
}

footer p,
.footer p {
    color: var(--color-text-primary);
    font-family: var(--font-main);
    font-size: 12px;
    margin: 0;
}

footer a,
.footer a {
    color: var(--color-text-primary);
    font-family: var(--font-main);
    font-size: 12px;
    text-decoration: none;
    margin-left: 10px;
    transition: all 0.3s;
    position: relative;
}

footer a:hover,
footer a:focus,
.footer a:hover,
.footer a:focus {
    color: #e0e0e0;
}

footer a::after,
.footer a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 50%;
    background-color: white;
    transition: all 0.3s ease;
}

footer a:hover::after,
footer a:focus::after,
.footer a:hover::after,
.footer a:focus::after {
    width: 100%;
    left: 0;
}

/* --- 6. Back-to-top button --------------------------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
    font-size: 18px;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

/* --- 7. Reading Progress Bar ------------------------------------------------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: white;
    width: 0%;
    z-index: 200;
    transition: width 0.1s linear;
}

/* --- 8. Utility --------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- 9. Social Links (shared: aboutme.html & contact.html) ------------------- */
.links-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.social-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    border-radius: 50px;
    overflow: hidden;
    height: 60px;
    width: 60px;
    transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.social-link:hover {
    width: 200px;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 24px;
    position: absolute;
    left: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.link-text {
    position: absolute;
    right: 15px;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 14px;
}

.social-link:hover .link-text {
    opacity: 1;
}

.social-link.twitter  { background: linear-gradient(45deg, #1DA1F2, #0d8ecf); }
.social-link.youtube  { background: linear-gradient(45deg, #FF0000, #cc0000); }
.social-link.gearz    { background: linear-gradient(45deg, #838383, #7a7a7a); }
.social-link.business { background: linear-gradient(45deg, #00C853, #009624); }

.custom-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

@media (max-width: 480px) {
    .social-link { width: 220px; }
    .social-link:hover { width: 220px; }
    .icon-container { left: 10px; }
    .link-text { opacity: 1; right: auto; left: 70px; }
    .links-container { flex-direction: column; align-items: center; gap: 15px; }
}
