/* Global Theme Variables */
:root {
    --bg-color: #0b1021;
    --header-footer-bg: rgba(14, 21, 45, 0.95);
    --text-main: #e2e8f0;
    --text-muted: #cbd5e1;
    --neon-accent: #00f0ff;
    --neon-glow: 0 0 10px rgba(0, 240, 255, 0.5);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --header-border: rgba(0, 240, 255, 0.2);
}

html {
    scroll-padding-top: 90px;
}

/* Accessibility: Clear Focus Outline for Keyboard Navigation */
:focus-visible {
    outline: 2px dashed var(--neon-accent) !important;
    outline-offset: 4px;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-top: 100px; 
    padding-bottom: 100px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-y: scroll; /* Prevents infinite layout resize loops */
    transition: padding-left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), padding-right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.settings-active {
    padding-left: 280px;
}

/* Dynamic Cursor Sets */
body.cursor-default { cursor: default; }
body.cursor-default a, body.cursor-default button, body.cursor-default select, body.cursor-default input, body.cursor-default label, body.cursor-default .card { cursor: pointer; }

body.cursor-scifi { cursor: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMGYwZmYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIzIj48L2NpcmNsZT48cGF0aCBkPSJNMTIgMnY0TTEyIDE4djRNMiAxMmg0TTE4IDEyaDQiPjwvcGF0aD48L3N2Zz4=') 12 12, crosshair; }
body.cursor-scifi a, body.cursor-scifi button, body.cursor-scifi select, body.cursor-scifi input, body.cursor-scifi label, body.cursor-scifi .card { cursor: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSIjMDBmMGZmIiBzdHJva2U9Im5vbmUiPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjYiPjwvY2lyY2xlPjwvc3ZnPg==') 12 12, pointer !important; }

body.cursor-minimal { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iNCIvPjwvc3ZnPg==') 12 12, crosshair; }
body.cursor-minimal a, body.cursor-minimal button, body.cursor-minimal select, body.cursor-minimal input, body.cursor-minimal label, body.cursor-minimal .card { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDBmMGZmIiBzdHJva2Utd2lkdGg9IjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iOCIvPjwvc3ZnPg==') 12 12, pointer !important; }

body.cursor-cyber { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmY2NmZmIiBzdHJva2Utd2lkdGg9IjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgNGwxNiA4LTggMi0yIDhMNCA0eiIvPjwvc3ZnPg==') 4 4, crosshair; }
body.cursor-cyber a, body.cursor-cyber button, body.cursor-cyber select, body.cursor-cyber input, body.cursor-cyber label, body.cursor-cyber .card { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2ZmNjZmZiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNCA0bDE2IDgtOCAyLTIgOEw0IDR6Ii8+PC9zdmc+') 4 4, pointer !important; }

body.cursor-dot { cursor: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI0IiBmaWxsPSIjMDBmMGZmIi8+PC9zdmc+') 12 12, crosshair; }
body.cursor-dot a, body.cursor-dot button, body.cursor-dot select, body.cursor-dot input, body.cursor-dot label, body.cursor-dot .card { cursor: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI2IiBmaWxsPSIjZmY2NmZmIi8+PC9zdmc+') 12 12, pointer !important; }

body.cursor-target { cursor: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBzdHJva2U9IiMwMGYwZmYiIHN0cm9rZS13aWR0aD0iMS41IiBmaWxsPSJub25lIi8+PGxpbmUgeDE9IjEyIiB5MT0iMiIgeDI9IjEyIiB5Mj0iMjIiIHN0cm9rZT0iIzAwZjBmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiLz48bGluZSB4MT0iMiIgeTE9IjEyIiB4Mj0iMjIiIHkyPSIxMiIgc3Ryb2tlLXdpZHRoPSIxLjUiLz48L3N2Zz4=') 12 12, crosshair; }
body.cursor-target a, body.cursor-target button, body.cursor-target select, body.cursor-target input, body.cursor-target label, body.cursor-target .card { cursor: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBzdHJva2U9IiNmZjY2ZmYiIHN0cm9rZS13aWR0aD0iMiIgZmlsbD0ibm9uZSIvPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjIiIGZpbGw9IiNmZjY2ZmYiLz48L3N2Zz4=') 12 12, pointer !important; }

body.cursor-magic { cursor: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgMkwxNC41IDkuNUwyMiAxMkwxNC41IDE0LjVMMTIgMjJMOS41IDE0LjVMMiAxMkw5LjUgOS41WiIgZmlsbD0iIzAwZjBmZiIvPjwvc3ZnPg==') 12 12, crosshair; }
body.cursor-magic a, body.cursor-magic button, body.cursor-magic select, body.cursor-magic input, body.cursor-magic label, body.cursor-magic .card { cursor: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgMEwxNS41IDguNUwyNCAxMkwxNS41IDE1LjVMMTIgMjRMOC41IDE1LjVMMCAxMkw4LjUgOC41WiIgZmlsbD0iI2ZmNjZmZiIvPjwvc3ZnPg==') 12 12, pointer !important; }

/* Fixed Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: var(--header-footer-bg);
    border-bottom: 1px solid var(--header-border);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4), inset 0 -1px 0 rgba(255,255,255,0.05);
    transition: padding-left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), padding-right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.settings-active header {
    padding-left: 320px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--neon-accent);
    text-shadow: var(--neon-glow);
    letter-spacing: 1px;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 30px;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--neon-accent);
    text-shadow: var(--neon-glow);
}

/* Settings Button */
#settings-toggle {
    background: transparent;
    border: 1px solid var(--neon-accent);
    color: var(--neon-accent);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 0 rgba(0,0,0,0.3), 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#settings-toggle img {
    width: 100%; /* Make the image fill the button's width */
    height: 100%; /* Make the image fill the button's height */
    object-fit: cover; /* Ensure the image covers the circular area, cropping if necessary */
    border-radius: 50%; /* Make the image itself circular */
}

#settings-toggle:hover {
    background: var(--neon-accent); color: var(--bg-color); transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,0.3), 0 8px 20px var(--neon-glow);
}
#settings-toggle:active {
    transform: translateY(4px); box-shadow: 0 0 0 rgba(0,0,0,0.3), 0 2px 5px rgba(0,0,0,0.2);
}

/* Main Content Layout */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    align-items: center;
    text-align: center;
    width: 100%;
    min-height: calc(100vh - 200px);
    padding: 40px 0;
    box-sizing: border-box;
}

/* Dynamic Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--text-main), var(--neon-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    line-height: 1.6;
    margin-bottom: 50px;
}

/* Semantic Typography Enhancement */
strong {
    font-weight: 700;
    color: var(--text-main);
}

em {
    font-style: italic;
    font-weight: 500;
}

u {
    text-decoration: underline;
    text-decoration-color: var(--neon-accent);
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

/* Utilities & New Sections */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.justify-center { justify-content: center; }

.hero-actions {
    display: flex;
    gap: 20px;
}

.content-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 40px 0;
    box-sizing: border-box;
}

.section-title {
    font-size: 2.5rem; color: var(--text-main); margin-bottom: 40px; text-shadow: var(--neon-glow);
}

.glass-panel {
    background: linear-gradient(145deg, var(--header-footer-bg), var(--bg-color));
    backdrop-filter: blur(10px); border: 1px solid var(--card-border);
    border-top: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; 
    padding: 50px; width: 100%; max-width: 900px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4), inset 0 2px 5px rgba(255,255,255,0.05); box-sizing: border-box; text-align: left;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 60px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.08);
}
.glass-panel h2 {
    color: var(--neon-accent); margin-top: 0; font-size: 2.2rem; margin-bottom: 20px;
}
.glass-panel p {
    color: var(--text-muted); line-height: 1.8; font-size: 1.1rem; margin-bottom: 20px;
    text-align: justify;
}

/* Feature Cards */
.resource-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
}

.card {
    background: linear-gradient(145deg, var(--card-bg), var(--header-footer-bg));
    border: 1px solid var(--card-border);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    width: 300px;
    text-align: left;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3), inset 0 2px 5px rgba(255,255,255,0.05);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--neon-accent);
    box-shadow: -15px 25px 35px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.1);
}

.card h3 { color: var(--neon-accent); margin-top: 0; font-size: 1.3rem; }
.card p { color: var(--text-muted); line-height: 1.5; font-size: 0.95rem; flex-grow: 1; text-align: justify; }

.card-link {
    display: inline-block; margin-top: 20px; color: var(--neon-accent);
    text-decoration: none; font-weight: 600; font-size: 0.95rem;
    transition: all 0.3s ease;
}

.card-link:hover {
    color: var(--text-main); text-shadow: var(--neon-glow); transform: translateX(5px);
}

/* Fixed Footer */
footer {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 60px;
    background-color: var(--header-footer-bg); border-top: 1px solid var(--header-border);
    display: flex; justify-content: center; align-items: center; z-index: 1000;
    font-size: 0.9rem; color: var(--text-muted);
    box-sizing: border-box;
    box-shadow: 0 -8px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: padding-left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), padding-right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
body.settings-active footer {
    padding-left: 280px;
}

/* Settings Sidebar Panel */
#settings-modal {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px;
    background: var(--header-footer-bg); backdrop-filter: blur(20px);
    border-right: 1px solid var(--header-border); 
    box-shadow: 15px 0 40px rgba(0,0,0,0.6), inset 2px 0 5px rgba(255,255,255,0.05);
    z-index: 9999;
    pointer-events: none;
    transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
#settings-modal.active { transform: translateX(0); pointer-events: auto; }

.settings-content {
    height: 100%; width: 100%;
    display: flex; flex-direction: column;
    box-sizing: border-box;
}

.settings-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; border-bottom: 1px solid var(--header-border);
}
.settings-header h2 { margin: 0; color: var(--neon-accent); font-size: 0.95rem; }

#close-settings {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 1.2rem; cursor: pointer; transition: color 0.3s; padding: 0;
}
#close-settings:hover { color: var(--neon-accent); }

.settings-body {
    flex: 1; overflow-y: auto; padding: 15px;
}

.setting-row {
    display: flex; align-items: center; gap: 10px; margin-top: 15px;
}
.setting-row:first-child { margin-top: 0; }
.setting-row label { font-size: 1.2rem; margin: 0; cursor: help; display: flex; align-items: center; justify-content: center; width: 24px; }

.settings-body select {
    flex: 1; padding: 6px; background: var(--bg-color); color: var(--text-main);
    border: 1px solid var(--card-border); border-radius: 4px; outline: none; font-family: inherit; font-size: 0.8rem;
}
.settings-body input[type="range"] { flex: 1; cursor: pointer; accent-color: var(--neon-accent); }
.settings-body input[type="checkbox"] { accent-color: var(--neon-accent); cursor: pointer; width: 16px; height: 16px; margin: 0; }

/* 3D Form Inputs */
input[type="text"], input[type="password"] {
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}
input[type="text"]:focus, input[type="password"]:focus {
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.5), 0 0 12px var(--neon-glow);
}

/* Service Popups */
.service-popup {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease; /* Keep opacity for smooth fade */
    padding: 20px; box-sizing: border-box;
    display: none; /* Hidden by default */
}
.service-popup.active { opacity: 1; pointer-events: auto; display: flex; } /* Show when active */
.service-popup .popup-content {
    position: relative; max-width: 650px; width: 100%;
    max-height: 90vh; /* Ensures it never clips off-screen on landscape mobile */
    overflow-y: auto; /* Allows scrolling inside the popup if necessary */
    transform: translateY(50px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.service-popup.active .popup-content { transform: translateY(0); }
.close-popup {
    position: absolute; top: 20px; right: 25px;
    background: transparent; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; transition: color 0.3s; padding: 0;
}
.close-popup:hover { color: var(--neon-accent); }

/* Custom Scrollbar for Settings Menu */
.settings-body::-webkit-scrollbar { width: 6px; }
.settings-body::-webkit-scrollbar-track { background: var(--card-bg); border-radius: 10px; }
.settings-body::-webkit-scrollbar-thumb { background: var(--neon-accent); border-radius: 10px; }

/* Responsive & Mobile Optimizations */
@media (max-width: 768px) {
    body { padding-top: 140px; padding-bottom: 120px; }
    header { 
        flex-direction: column; height: auto; padding: 20px; gap: 15px; width: 100%;
    }

    .glass-panel { padding: 30px; }
    h1 { font-size: 3rem; }
    p.subtitle { margin: 0 auto 40px auto; }
    
    nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
    nav a { margin: 5px 10px; }

    .hero-section, .content-section {
        min-height: calc(100vh - 260px); /* Accounts for taller mobile header/footer */
    }

    /* Do not shift content on small mobile screens */
    body.settings-active { padding-left: 0; }
    body.settings-active header { padding-left: 20px; }
    body.settings-active footer { padding-left: 0; }
}