/* ========================================================= */
/* WINDOWS 98 + VT323 — MODULAR CONTENT HOLDERS VERSION      */
/* ========================================================= */

/* ------------------------- */
/* ROOT VARIABLES            */
/* ------------------------- */
:root {
    /* Core Palette */
    --win98-bg: #c0c0c0;
    --win98-text: #000000;
    --win98-gray-light: #dfdfdf;
    --win98-gray-dark: #808080;
    --win98-gray-darker: #404040;
    --win98-white: #ffffff;
    --win98-black: #000000;

    /* Branding */
    --win98-blue: #000080;
    --win98-blue-light: #1084d0;
    --accent-color: #008080; /* Teal for primary buttons */

    /* Custom background */
    --desktop-bg: #006666; /* Can be changed easily */

    /* CRT Effect */
    --scanline-opacity: 0.04;
}

/* Dark Mode Override */
.dark-mode {
    --win98-bg: #1a1a1a;
    --win98-text: #00ff00;
    --win98-gray-light: #2d2d2d;
    --win98-gray-dark: #004400;
    --win98-gray-darker: #002200;
    --win98-white: #00cc00;
    --win98-black: #000000;
    --win98-blue: #004400;
    --win98-blue-light: #008800;
    --desktop-bg: #000000;
}

/* ------------------------- */
/* FONT */
@font-face {
    font-family: 'VT323';
    src: local('VT323'),
         url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
}

/* ------------------------- */
/* RESET & GLOBAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'VT323', 'MS Sans Serif', 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.5;
    color: var(--win98-text);
    background-color: var(--desktop-bg);
    min-height: 100vh;
    overflow-x: hidden;

    /* Optional dot pattern overlay */
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi+P//PwMTAwMDEwMQAAQYABVcA0k1n67xAAAAAElFTkSuQmCC');
    background-repeat: repeat;
}

/* CRT Scanlines */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%), linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    opacity: var(--scanline-opacity);
}

/* Base text sizing for VT323 font */
h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.2rem; }
p, li { font-size: 1.1rem; }

/* General Link Styling */
a {
    color: var(--win98-blue);
    text-decoration: underline;
}

a:hover {
    color: var(--accent-color);
}


/* ------------------------- */
/* SCROLLBARS */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
    background: var(--win98-gray-light);
}

::-webkit-scrollbar-thumb {
    background: var(--win98-bg);
    border: 1px solid var(--win98-black);
    box-shadow: inset 1px 1px var(--win98-white), inset -1px -1px var(--win98-gray-dark);
}

::-webkit-scrollbar-track {
    background: #e0e0e0;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
}

::-webkit-scrollbar-corner {
    background: var(--win98-bg);
}

/* ------------------------- */
/* HEADER & NAVIGATION (Assuming a top fixed taskbar/header) */
header {
    background-color: var(--win98-bg);
    padding: 4px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-top: 1px solid var(--win98-white);
    border-bottom: 1px solid var(--win98-black);
    box-shadow: inset 0 -1px 0 var(--win98-gray-dark);
}

nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 4px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
}

/* Placeholder for .button-98 styles if used outside of .win98-button */
/* nav a, nav button, .button-98 are replaced by .win98-button below */


/* ------------------------- */
/* MAIN CONTENT CONTAINER */
.container {
    max-width: 1000px;
    margin: 60px auto 20px auto; /* Adjust top margin to clear the fixed header */
    padding: 10px;
}


/* ------------------------- */
/* WIN98 BEVELS & UTILITY */
/* ------------------------- */

/* Outer Bevel: Default button/card look (3D raised) */
.win98-bevel-out {
    box-shadow:
        inset 1px 1px 0 var(--win98-white),
        inset -1px -1px 0 var(--win98-gray-dark),
        inset -2px -2px 0 var(--win98-black);
    border: 1px solid var(--win98-black);
    background-color: var(--win98-bg); /* Use base gray for cards */
}

/* Inner Bevel: Sunken/Pressed look (like input fields or active buttons) */
.win98-bevel-in {
    box-shadow:
        inset 1px 1px 0 var(--win98-black),
        inset 2px 2px 0 var(--win98-gray-dark),
        inset -1px -1px 0 var(--win98-white);
    border: 1px solid var(--win98-black);
    background-color: var(--win98-bg);
}

/* ------------------------- */
/* WINDOWS 98 FRAME (win98-window) */
/* ------------------------- */

.win98-window {
    background: var(--win98-bg);
    padding: 1px;
    box-shadow:
        inset 1px 1px 0 var(--win98-white),
        inset -1px -1px 0 var(--win98-gray-dark),
        inset -2px -2px 0 var(--win98-black),
        1px 1px 0 var(--win98-black);
    border: 1px solid var(--win98-white);
    position: relative;
    margin-bottom: 2rem;
}

/* Window Title Bar */
.window-title {
    background: linear-gradient(90deg, var(--win98-blue) 0%, var(--win98-blue-light) 100%);
    color: var(--win98-white);
    padding: 4px 6px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
    font-size: 1.1rem;
}

/* Window Content Area */
.window-content {
    margin-top: 5px;
    padding: 10px;
    background: var(--win98-white);
    color: var(--win98-text);
    min-height: 50px;
}

/* Dark Mode adjustment for content */
.dark-mode .window-content {
    background: var(--win98-bg);
    color: var(--win98-text);
}


/* ------------------------- */
/* BUTTONS */
/* ------------------------- */
.win98-button, nav a, nav button {
    color: var(--win98-text);
    text-decoration: none;
    padding: 4px 10px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    background: var(--win98-bg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow:
        inset 1px 1px 0 var(--win98-white),
        inset -1px -1px 0 var(--win98-gray-dark),
        inset -2px -2px 0 var(--win98-black),
        1px 1px 0 var(--win98-black);
    transition: none;
}

.win98-button:hover, nav a:hover, nav button:hover {
    background: var(--win98-gray-light);
}

.win98-button:active, nav a:active, nav button:active {
    box-shadow:
        inset 1px 1px 0 var(--win98-black),
        inset 2px 2px 0 var(--win98-gray-dark),
        inset -1px -1px 0 var(--win98-white);
    transform: translate(1px,1px);
    background: var(--win98-bg);
}

/* Primary Button (for CTAs) */
.win98-button.primary {
    background-color: var(--accent-color); /* Teal color */
    color: var(--win98-white);
    text-shadow: 1px 1px var(--win98-black);
}

.win98-button.primary:hover {
    filter: brightness(1.1);
}

.win98-button.primary:active {
    filter: brightness(0.9);
}

/* Smaller button variant for project cards */
.win98-button.small-button {
    font-size: 0.9rem;
    padding: 2px 8px;
}


/* ------------------------- */
/* LAYOUTS & COMPONENTS */
/* ------------------------- */

/* The two-column layout for Latest Blog Posts and Featured Projects */
.grid-layout-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* The two-column layout for About and Contact */
.grid-layout-secondary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Blog Post List */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-card {
    padding: 10px;
}

.post-card-title {
    margin-bottom: 5px;
}

.post-meta {
    font-size: 0.9rem;
    color: var(--win98-gray-darker);
    margin-bottom: 8px;
}

.post-excerpt {
    margin-bottom: 10px;
}

/* Project Cards Grid (within the project window) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.project-card {
    padding: 10px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Push button to the bottom */
}

/* Hero Section specific styles */
.hero h1 {
    margin-bottom: 5px;
    text-shadow: 1px 1px 0 var(--win98-white), -1px -1px 0 var(--win98-gray-dark);
}

.hero .subtitle {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

/* Placeholder for the Cube */
.spinning-cube-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    color: var(--win98-gray-dark);
}
/* ============================= */
/* SPINNING CUBE — WINDOWS 98    */
/* ============================= */

.cube-container {
    width: 120px;
    height: 120px;
    margin: 10px auto;
    perspective: 600px;
    background: var(--win98-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: cube-spin 5s linear infinite;
}

.cube-face {
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--win98-gray-light);
    border: 2px solid var(--win98-gray-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'VT323', monospace;
    color: var(--win98-black);
    box-shadow:
        inset 1px 1px 0 var(--win98-white),
        inset -1px -1px 0 var(--win98-gray-darker);
}

/* Position each face in 3D */
.cube-face.front  { transform: rotateY(0deg) translateZ(60px); }
.cube-face.back   { transform: rotateY(180deg) translateZ(60px); }
.cube-face.right  { transform: rotateY(90deg) translateZ(60px); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(60px); }
.cube-face.top    { transform: rotateX(90deg) translateZ(60px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(60px); }

/* Animation */
@keyframes cube-spin {
    from { transform: rotateX(0deg) rotateY(0deg); }
    to   { transform: rotateX(360deg) rotateY(360deg); }
}

/* ------------------------- */
/* RESPONSIVE REFINEMENTS */
/* ------------------------- */

@media (max-width: 768px) {
    /* Existing mobile nav logic */
    .nav-links {
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
    }

    .nav-links.active {
        display: flex;
    }
}

@media (min-width: 600px) {
    .grid-layout-secondary {
        grid-template-columns: 1fr 1fr; /* About and Contact side-by-side */
    }
}

@media (min-width: 900px) {
    .grid-layout-main {
        grid-template-columns: 2fr 1fr; /* Blog posts (2/3 width) and Projects (1/3 width) */
    }
}

/* Dark mode toggle consistency */
body.dark-mode {
    background-color: var(--desktop-bg);
}
