:root {
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --glass-bg: rgba(15, 23, 42, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Dynamic Theme Variables */
    --bg-primary: #2d96cf;
    /* Default Night */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --glass-card-bg: rgba(15, 23, 42, 0.9);
    --glass-card-border: rgba(255, 255, 255, 0.1);
    --stat-border: rgba(6, 182, 212, 0.5);
    /* Cyan */
}

body.day-mode {
    /* --bg-primary override removed */
    /* Slate 800 - Lighter Dark Blue */
    --text-primary: #f8fafc;
    /* Keep Text Light */
    --text-secondary: #cbd5e1;
    /* Enhance glass for slightly lighter background */
    --glass-bg: rgba(30, 41, 59, 0.85);
    --glass-border: rgba(255, 255, 255, 0.15);
}

body.sunset-mode {
    /* --bg-primary override removed */
    /* Deep Purple Twilight */
    --text-primary: #f8fafc;
}

body.sunrise-mode {
    /* --bg-primary override removed */
    /* Warm Orange Tint */
    --text-primary: #431407;
    --glass-bg: rgba(255, 247, 237, 0.7);
}

/* Removed native smooth scroll to let Lenis handle the physics */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

body {
    background: radial-gradient(circle at top center, var(--bg-primary) 0%, #0f172a 100%);
    background-attachment: fixed;
    /* Keeps gradient stable on scroll */
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-primary);
    border-radius: 5px;
    border: 2px solid #0f172a;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* --- DASHBOARD WRAPPER --- */
.dashboard-wrapper {
    background: rgba(15, 23, 42, 0.6);
    /* Dark semi-transparent */
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin: 0.5rem auto;
    width: 95%;
    max-width: 1600px;
    position: relative;
    overflow: visible;
    /* Holo-Border & Inner Glow */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 0 20px rgba(0, 243, 255, 0.05);
}

/* Mobile Adjustments for Dashboard */
@media (max-width: 768px) {
    .dashboard-wrapper {
        padding: 1rem;
        margin: 0.5rem;
        width: auto;
        border-radius: 1.5rem;
    }
}

h1,
h2,
h3,
.tech-font {
    font-family: 'Poppins', sans-serif;
}

/* Canvas Backgrounds */
#snow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(400px);
    -webkit-backdrop-filter: blur(400px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    /* Ensure positioning context */
    transition: all 0.5s ease;
}

.glass-card {
    background: var(--glass-card-bg);
    backdrop-filter: blur(400px);
    -webkit-backdrop-filter: blur(400px);
    border: 1px solid var(--glass-card-border);
    transition: all 0.5s ease;
    color: var(--text-primary);
    position: relative;
    /* Ensure positioning context */
}

/* Spotlight / Light Effect */
.glass-panel::after,
.glass-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(255, 255, 255, 0.1),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 2;
}

@media (hover: hover) {

    .glass-panel:hover::after,
    .glass-card:hover::after {
        opacity: 1;
    }
}

/* Text Readability Backdrop - VISUALS REMOVED */
.text-backdrop {
    /* Transparent / No Border as requested */
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    /* Keep layout */
    border-radius: 1rem;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

/* Mobile: Edge-to-edge and centered */
@media (max-width: 768px) {
    .text-backdrop {
        width: 100%;
        display: flex;
        justify-content: center;
        box-sizing: border-box;
    }
}



/* HOVER EFFECTS: DESKTOP ONLY */
@media (hover: hover) {

    /* Apply to both cards AND panels now */
    .glass-card:hover,
    .glass-panel:hover {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 243, 255, 0.1);
        transform: translateY(-2px);
    }
}

/* --- SECTION DIVIDERS --- */
.section-divider {
    position: relative;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.5), transparent);
    margin: 4rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Floating Diamond Crystal */
.section-divider::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--bg-primary);
    border: 2px solid var(--neon-blue);
    transform: rotate(45deg);
    box-shadow: 0 0 10px var(--neon-blue), 0 0 20px rgba(0, 243, 255, 0.5);
    animation: divider-pulse 3s infinite ease-in-out;
}

/* Divider Pulse Animation */
@keyframes divider-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px var(--neon-blue), 0 0 20px rgba(0, 243, 255, 0.5);
        transform: rotate(45deg) scale(1);
    }

    50% {
        box-shadow: 0 0 20px var(--neon-blue), 0 0 40px rgba(0, 243, 255, 0.8);
        transform: rotate(45deg) scale(1.2);
    }
}

@media (hover: hover) {
    .glass-card:hover .icon-twitter {
        color: white;
    }

    .glass-card:hover .icon-tiktok {
        fill: #ec4899;
        color: #ec4899;
    }

    .glass-card:hover .icon-instagram {
        color: #E1306C;
    }

    .glass-card:hover .icon-threads {
        color: #ffffff;
    }

    .glass-card:hover .icon-youtube {
        color: #ef4444;
    }

    .glass-card:hover .icon-steam {
        color: #3b82f6;
    }

    .glass-card:hover .icon-reddit {
        fill: #f97316;
        color: #f97316;
    }

    .glass-card:hover .icon-mal {
        color: #93c5fd;
    }

    .glass-card:hover .icon-discord {
        color: #a5b4fc;
    }

    /* CLICK/ACTIVE EFFECTS: PUSHED INWARDS */
    .glass-panel:active,
    #oc-kazu a:active,
    #music a:active,
    #backToTop:active {
        transform: scale(0.95) translateY(2px);
        /* 0.95 scale = push in, translateY = slight depression */
        box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
        transition: transform 0.05s ease-out, box-shadow 0.05s ease-out;
    }

    /* DEEPER PUSH FOR SOCIALS & CARDS */
    .glass-card:active {
        transform: scale(0.95) translateY(4px);
        /* More vertical travel = deeper feel */
        box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.4);
        /* Stronger inner shadow */
        border-color: rgba(255, 255, 255, 0.05);
        /* Darken border slightly */
        transition: transform 0.05s ease-out, box-shadow 0.05s ease-out;
    }
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@media (min-width: 1024px) {
    .animate-float {
        animation: float 6s ease-in-out infinite;
    }

    .profile-glow {
        animation: pulse-glow 4s infinite;
    }
}

/* Music Visualizer Bars */
.music-bar {
    width: 4px;
    background: var(--neon-purple);
    animation: equalize 1s infinite;
}

@keyframes equalize {
    0% {
        height: 10px;
    }

    50% {
        height: 30px;
    }

    100% {
        height: 10px;
    }
}

.music-bar:nth-child(1) {
    animation-delay: 0.1s;
}

.music-bar:nth-child(2) {
    animation-delay: 0.3s;
}

.music-bar:nth-child(3) {
    animation-delay: 0.5s;
}

.music-bar:nth-child(4) {
    animation-delay: 0.2s;
}

/* Loader & Entrance Animations */
#page-loader {
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

/* --- MODERN ENTRANCE ANIMATION --- */
.content-hidden {
    opacity: 0 !important;
    transform: perspective(1000px) translateY(40px) scale(0.8);
    /* Scale down + Move down */
    filter: blur(10px);
    pointer-events: none;
    transition:
        opacity 0.6s ease-out,
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        /* Springy pop */
        filter 0.6s ease-out;
}

.content-visible {
    opacity: 1 !important;
    transform: perspective(1000px) translateY(0) scale(1);
    filter: blur(0);
    pointer-events: auto;
    /* Ensure transitions don't get stuck */
    transition:
        opacity 0.8s ease-out,
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        /* Springy pop */
        filter 0.8s ease-out;
}


/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #020617;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}



/* --- MODAL SYSTEM --- */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 27, 42, 0.85);
    /* Dark overlay */
    backdrop-filter: blur(400px);
    -webkit-backdrop-filter: blur(400px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    border-radius: 20px;
    /* More rounded */
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close:hover {
    background: red;
}

/* Clock Canvas */
#analog-clock-canvas {
    width: 300px;
    height: 300px;
    margin: 0 auto 1.5rem auto;
    display: block;
}

/* Birthday Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-family: monospace;
    text-align: center;
    margin-top: 1rem;
}

.calendar-day {
    padding: 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.calendar-header {
    font-weight: bold;
    color: var(--neon-blue);
}

.calendar-today {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.calendar-target {
    background: #ec4899;
    color: white;
    box-shadow: 0 0 10px #ec4899;
}

/* --- GLOBAL PAUSE (Resource Saving) --- */
body.global-paused * {
    animation-play-state: paused !important;
    transition: none !important;
}



/* --- WEATHER EFFECTS --- */
@media (min-width: 1024px) {
    .sun-glow {
        border-color: rgba(253, 224, 71, 1) !important;
        box-shadow: 0 0 30px rgba(253, 224, 71, 0.6), 0 0 60px rgba(253, 224, 71, 0.4), inset 0 0 20px rgba(253, 224, 71, 0.5) !important;
        animation: sun-pulse 3s infinite alternate !important;
    }

    @keyframes sun-pulse {
        0% {
            box-shadow: 0 0 30px rgba(253, 224, 71, 0.6), 0 0 10px rgba(253, 224, 71, 0.2);
        }

        100% {
            box-shadow: 0 0 50px rgba(253, 224, 71, 0.9), 0 0 20px rgba(253, 224, 71, 0.5);
        }
    }
}



/* --- BACK TO TOP BUTTON --- */
/* Hide on mobile (show only on tablet/desktop) */
@media (max-width: 768px) {
    #backToTop {
        display: none !important;
    }
}

/* Desktop Only Hover Glow */
@media (hover: hover) {
    #backToTop:hover {
        box-shadow: 0 0 25px rgba(6, 182, 212, 0.8), 0 0 50px rgba(6, 182, 212, 0.4);
    }
}