/* ==========================================================================
   SYBERNETICS — SITE-WIDE STYLES
   This stylesheet contains the core theme, layout, and global elements 
   shared across the entire Sybernetics portal.
   ========================================================================== */

/* 
   GLOBAL VARIABLES
   Defines the primary color palette, fonts, and reusable glass effects.
*/
:root {
    --bg-dark: #0d0d0d;
    --cyan: #00ffcc;
    --magenta: #ff00ff;
    --text-light: #e0e0e0;

    --font-display: 'Silkscreen', sans-serif; 
    --font-body: 'Space Grotesk', sans-serif;

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(0, 255, 204, 0.3);
}

/* 
   CURSOR FIXES
   Ensures the custom cursor persists on interactive elements.
   This prevents the cursor from reverting to the default Windows pointer 
   when hovering over links, books, or the chatbox.
*/
a, button, input, textarea, select, .art-ref, .shelf li, .modal-close, .chatbox, iframe {
    cursor: inherit !important;
}

/* 
   BASE RESET & GLOBAL ELEMENTS
   Sets the default background, ensures minimum height, and handles layout flow.
*/
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;

    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 255, 204, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.05) 0%, transparent 50%);
}

/* 
   BACKGROUND STARFIELDS & ANIMATIONS
   Creates the layered starfield effect using pseudo-elements and fixed positioning.
*/
body::before,
body::after,
.hero-stars {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Small twinkling stars background layer */
body::before {
    background-image:
        radial-gradient(1px 1px at 25px 35px, #fff, transparent),
        radial-gradient(1px 1px at 50px 80px, #fff, transparent),
        radial-gradient(1px 1px at 90px 150px, #fff, transparent),
        radial-gradient(1px 1px at 130px 220px, #fff, transparent),
        radial-gradient(1px 1px at 170px 40px, #fff, transparent),
        radial-gradient(1px 1px at 210px 110px, #fff, transparent);
    background-size: 250px 250px;
    animation: twinkle 3s infinite ease-in-out;
}

/* Medium stars background layer */
body::after {
    background-image:
        radial-gradient(1.5px 1.5px at 100px 100px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 300px 250px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 500px 100px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 200px 450px, #fff, transparent);
    background-size: 600px 600px;
    animation: twinkle 5s infinite ease-in-out alternate;
}

/* Foreground "hero" stars for extra depth */
.hero-stars {
    background-image:
        radial-gradient(2.5px 2.5px at 15% 15%, #fff, transparent),
        radial-gradient(2.5px 2.5px at 85% 25%, #fff, transparent),
        radial-gradient(2px 2px at 45% 65%, #fff, transparent),
        radial-gradient(2.5px 2.5px at 70% 85%, #fff, transparent),
        radial-gradient(2px 2px at 25% 80%, #fff, transparent),
        radial-gradient(2.5px 2.5px at 5% 45%, #fff, transparent),
        radial-gradient(2px 2px at 95% 60%, #fff, transparent),
        radial-gradient(2.5px 2.5px at 55% 10%, #fff, transparent),
        radial-gradient(2px 2px at 35% 35%, #fff, transparent),
        radial-gradient(2.5px 2.5px at 80% 75%, #fff, transparent),
        radial-gradient(2px 2px at 10% 90%, #fff, transparent);
    animation: sparkle-hero 1.5s infinite ease-in-out;
}

/* Animation for the background stars to create a twinkling effect */
@keyframes twinkle {
    0%, 100% { opacity: 0.1; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* Animation for the foreground stars to create a bright sparkling effect */
@keyframes sparkle-hero {
    0%, 100% { opacity: 0.2; filter: brightness(1); }
    20%, 80% { opacity: 0.4; }
    50% { opacity: 1; filter: brightness(2) drop-shadow(0 0 2px #fff); }
}

/* 
   LAYOUT — HEADER, MAIN, FOOTER
   Defines the structural containers for the site.
*/

/* Global Header styling with glassmorphism and neon borders */
header {
    max-width: 1000px;
    width: 90%;
    margin: 40px auto;
    padding: 40px;
    text-align: center;
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--cyan);
    border-radius: 16px;
    box-shadow:
        4px 4px 0px var(--magenta),
        0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Main content area styling */
main {
    max-width: 1000px;
    margin: 0 auto 40px auto;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(5px);
    border: 1px dashed var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Global Footer styling */
footer {
    text-align: center;
    margin: 60px 0 40px 0;
    padding: 40px;
}

/* 
   COMPONENTS — LOGO & NAVIGATION
   Styles for the site's branding and primary navigation links.
*/

/* Main site logo styling with a subtle cyan glow */
.logo {
    width: 30%;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
    filter: drop-shadow(0 0 10px rgba(0, 255, 204, 0.3));
}

/* Navigation list container */
nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Navigation link styling with hover transitions */
nav a {
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--magenta);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

/* Navigation link hover state with neon cyan underline */
nav a:hover {
    color: var(--cyan);
    border-bottom: 2px solid var(--cyan);
    text-shadow: 1px 1px var(--magenta);
}

/* 
   TYPOGRAPHY
   Global font settings and heading styles.
*/

/* Primary heading style with retro-futuristic text shadow */
h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--magenta);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px var(--cyan);
    margin: 20px 0;
    padding-bottom: 8px;
    border-bottom: 2px dashed rgba(255, 0, 255, 0.4);
}

/* Sub-heading style for sidebars or smaller sections */
.sidebar-header {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--magenta);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px var(--cyan);
    margin: 20px 0;
    padding-bottom: 8px;
    border-bottom: 2px dashed rgba(255, 0, 255, 0.4);
}

/* Remove border from headings inside the footer */
footer h2 {
    border-bottom: none;
}

/* Base paragraph styling */
p {
    font-family: var(--font-body);
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Orbitron font utility classes for specific futuristic accents */
.orbitron-font {
    font-family: "Orbitron", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
}

.orbitron-font-glow {
    font-family: "Orbitron", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    text-shadow: 
        0 0 4px rgba(0, 255, 204, 0.4), 
        0 0 8px rgba(0, 255, 204, 0.2);  
}

.orbitron-small {
    font-family: "Orbitron", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 0.9rem;
    text-shadow: none;
}

/* Standard text link styling with neon glow */
.text-link {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px dashed var(--cyan);
    text-shadow:
        0 0 4px rgba(0, 255, 204, 0.6),
        0 0 8px rgba(0, 255, 204, 0.4),
        0 0 12px rgba(0, 255, 204, 0.2);
    transition: 0.3s ease;  
}

/* Timestamp styling for blog entries and updates */
.timestamp {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--cyan);

    background: rgba(0, 255, 204, 0.1);
    padding: 2px 6px;
    border-radius: 4px;

    text-shadow: 0 0 5px rgba(0, 255, 204, 0.5);
}

/* Text link hover state switching to magenta glow */
.text-link:hover {
    color: var(--magenta);
    border-bottom-color: var(--magenta);
    text-shadow:
        0 0 6px rgba(255, 0, 255, 0.7),
        0 0 12px rgba(255, 0, 255, 0.5),
        0 0 18px rgba(255, 0, 255, 0.3);
}

/* 
   FOOTER ELEMENTS
   Styles for links and art references in the footer.
*/

/* Footer list item layout */
footer li {
    list-style: none;
    display: inline-block;
    width: 25%;
}

/* Images within footer links */
footer li img {
    width: 100%;
    height: auto;
    padding-top: 5%;
    display: block;
}

/* Art reference link with CRT-style flicker animation */
.art-ref {
    transition: transform 0.2s ease;
    filter:
        drop-shadow(0 0 4px #b142f5)
        drop-shadow(0 0 8px #00ffff);
    animation: logoCRT 0.15s infinite;
}

.art-ref:hover {
    transform: scale(1.05);
}

/* Neocities link branding with magenta glow */
.neocities-link {
  padding-top: 50px;
  width: 150px;
  filter:
    drop-shadow(0 0 4px #ff33cc)
    drop-shadow(0 0 8px #ff33cc);
}

.neocities-link:hover {
  transform: scale(1.05);
}

/* CRT flicker animation for logos and art references */
@keyframes logoCRT {
    0% {
        filter: brightness(1)
            drop-shadow(0 0 4px #b142f5)
            drop-shadow(0 0 8px #00ffff);
    }
    50% {
        filter: brightness(1.12)
            drop-shadow(0 0 6px #b142f5)
            drop-shadow(0 0 10px #00ffff);
    }
    100% {
        filter: brightness(1)
            drop-shadow(0 0 4px #b142f5)
            drop-shadow(0 0 8px #00ffff);
    }
}

/* 
   CUSTOM SITE-WIDE SCROLLBAR
   Themed scrollbar for Webkit browsers (Chrome, Safari, Edge).
*/

/* Scrollbar width */
::-webkit-scrollbar {
    width: 10px;
}

/* Scrollbar track background */
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* Draggable scrollbar thumb with cyan glow */
::-webkit-scrollbar-thumb {
    background: var(--cyan);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--cyan);
}

/* Scrollbar thumb hover state switching to magenta */
::-webkit-scrollbar-thumb:hover {
    background: var(--magenta);
    box-shadow: 0 0 12px var(--magenta);
}
