/* Global Styles - Key's World Final Polish */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --accent-color: #ffff00;
    --secondary-accent: #ccff00;
    --box-bg: rgba(0, 0, 0, 0.95);
    --border-color: #ffffff;
    --font-main: 'Press Start 2P', cursive;
    --font-hand: 'VT323', monospace;

    /* Creative Colors */
    --crt-green: #33ff00;
    --crt-bg: #001100;
    --floppy-color: #3f51b5;
    --cartridge-gray: #424242;
    --led-red: #ff0000;
    --led-green: #00ff00;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image: url('assets/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.5;
    min-height: 100vh;
    font-size: 12px;
}

/* Snowfall Canvas */
#snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Typography */
h1,
h2,
h3,
h4 {
    text-transform: uppercase;
    margin-bottom: 10px;
    color: var(--accent-color);
    text-shadow: 2px 2px 0px #000;
    line-height: 1.4;
    font-size: 14px;
}

a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--secondary-accent);
    transition: color 0.2s;
    cursor: pointer;
}

a:hover {
    color: var(--accent-color);
    border-bottom-style: solid;
}

/* Layout: 3-Column Grid */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 250px;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.col-1,
.col-2,
.col-3 {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.col-3 {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* Standard Box */
.box {
    background: var(--box-bg);
    border: 2px solid var(--border-color);
    padding: 15px;
    box-shadow: 4px 4px 0px #000;
    position: relative;
    width: 100%;
}

.box-title {
    background: var(--text-color);
    color: #000;
    padding: 5px 10px;
    margin: -15px -15px 15px -15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.box-title a {
    color: #000;
    text-decoration: none;
    border-bottom: none;
    font-weight: bold;
}

.box-title a:hover {
    text-decoration: underline;
    color: #000;
}

/* --- CREATIVE ELEMENTS --- */

/* 1. Premium CRT Monitor */
.crt-monitor {
    background: #222;
    border-radius: 20px;
    padding: 20px;
    box-shadow: inset 0 0 20px #000, 5px 5px 0px #000;
    border: 4px solid #444;
    position: relative;
}

.crt-screen {
    background: var(--crt-bg);
    color: var(--crt-green);
    padding: 20px;
    border-radius: 50% / 10%;
    border: 2px solid #111;
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 5px var(--crt-green);
    min-height: 220px;
}

.crt-screen::before {
    content: " ";
    display: block;
    position: absolute;
    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: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.crt-content {
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 1;
    align-items: center;
}

.crt-img {
    width: 100px;
    height: 100px;
    border: 2px solid var(--crt-green);
    filter: grayscale(100%) sepia(100%) hue-rotate(90deg) saturate(300%);
    box-shadow: 0 0 10px var(--crt-green);
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.4rem;
    background: var(--crt-green);
    animation: blink 1s infinite;
    vertical-align: bottom;
}

/* 2. Floppy Disk Stack */
.floppy-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.floppy-disk {
    background: var(--floppy-color);
    border: 2px solid #000;
    border-radius: 5px 5px 0 0;
    padding: 10px;
    position: relative;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    overflow: hidden;
}

.floppy-disk:hover {
    transform: translateY(-2px);
}

.floppy-label {
    background: #fff;
    color: #000;
    padding: 8px;
    font-size: 10px;
    border: 1px solid #ccc;
    margin-bottom: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floppy-shutter {
    width: 40px;
    height: 50px;
    background: #ccc;
    position: absolute;
    top: 0;
    right: 20px;
    border: 1px solid #999;
}

.floppy-content {
    background: #fff;
    color: #000;
    padding: 10px;
    border: 2px solid #000;
    margin-top: 5px;
    display: none;
    font-family: var(--font-hand);
    font-size: 1.2rem;
}

/* 3. Game Cartridge (Projects) */
.cartridge-box {
    background: var(--cartridge-gray);
    border: 4px solid #212121;
    border-radius: 10px 10px 0 0;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 5px 5px 0px #000;
    position: relative;
}

.cartridge-label {
    background: #e0e0e0;
    border: 2px solid #000;
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    border-radius: 5px;
    color: #000;
}

.cartridge-label h4 {
    color: #000;
    text-shadow: none;
    margin-bottom: 0;
}

.cartridge-art {
    width: 48px;
    height: 48px;
    background: #000;
    border: 2px solid #555;
    image-rendering: pixelated;
}

.cartridge-grooves {
    height: 12px;
    background: repeating-linear-gradient(90deg, #333, #333 5px, #424242 5px, #424242 10px);
}

/* 4. Spotify Widget */
.spotify-widget {
    background: var(--box-bg);
    border: 3px solid var(--border-color);
    padding: 10px 12px;
    box-shadow: inset 0 0 10px #000, 3px 3px 0 #000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-hand);
    color: var(--text-color);
}

.spotify-header {
    font-size: 10px;
    letter-spacing: 1px;
    text-align: left;
    padding: 2px 6px;
    background: #000;
    border: 1px solid var(--crt-green);
    color: var(--crt-green);
    text-transform: uppercase;
}

.spotify-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spotify-widget .cover-art img {
    width: 72px;
    height: 72px;
    image-rendering: pixelated;
    border: 2px solid var(--crt-green);
    box-shadow: 0 0 6px var(--crt-green);
    background: #000;
}

.track-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.spotify-widget .track-info {
    font-size: 11px;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-widget .track-info .track-title {
    color: var(--accent-color);
}

.spotify-widget .track-info .track-artist {
    color: #ccc;
    font-size: 10px;
}

.spotify-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.spotify-status-pill {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid #444;
    background: #111;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spotify-status-playing {
    border-color: var(--crt-green);
    color: var(--crt-green);
}

.spotify-status-paused {
    border-color: #888;
    color: #bbb;
}

/* Equalizer */
.spotify-widget .playing-indicator .equalizer {
    display: none; /* JS turns this on when actually playing */
    width: 26px;
    height: 10px;
    background: var(--crt-green);
    animation: equalizer 1s infinite;
}

@keyframes equalizer {
    0% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
    100% { transform: scaleY(0.4); }
}

/* Nerdy meta row */
.spotify-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #333;
    font-size: 9px;
    color: #aaa;
    white-space: nowrap;
}

.spotify-meta-left,
.spotify-meta-right {
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-meta span {
    font-family: var(--font-hand);
}


/* 5. Catpad Notes */
.catpad {
    background: #fff9c4;
    border: 4px solid #fbc02d;
    padding: 15px;
    position: relative;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
    font-family: var(--font-hand);
    color: #000;
}

.catpad::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 20px;
    background: repeating-linear-gradient(90deg, #333 0, #333 5px, transparent 5px, transparent 15px);
    border-bottom: 2px solid #333;
}

.css-cat {
    width: 40px;
    height: 30px;
    background: #000;
    position: relative;
    margin: 10px auto;
    border-radius: 10px 10px 0 0;
}

.css-cat::before,
.css-cat::after {
    content: "";
    position: absolute;
    top: -10px;
    width: 10px;
    height: 15px;
    background: #000;
}

.css-cat::before {
    left: 0;
}

.css-cat::after {
    right: 0;
}

.css-cat-eye {
    position: absolute;
    top: 8px;
    width: 4px;
    height: 4px;
    background: #fff;
    animation: blink 3s infinite;
}

.css-cat-eye.left {
    left: 8px;
}

.css-cat-eye.right {
    right: 8px;
}

/* 6. Mini Guestbook */
.mini-board {
    background: #d7ccc8;
    border: 4px solid #8d6e63;
    padding: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.mini-note {
    background: #fff9c4;
    padding: 5px;
    font-size: 10px;
    color: #000;
    margin-bottom: 5px;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.3);
    font-family: var(--font-hand);
}

/* Sidebar Links */
.links-list {
    list-style: none;
}

.links-list li {
    margin-bottom: 8px;
}

.links-list a {
    display: block;
    padding: 5px;
    border: 1px solid transparent;
    border-bottom: none;
}

.links-list a:hover {
    background: #fff;
    color: #000;
    border: 1px solid #fff;
}

.notify-icon {
    color: #ff0000;
    animation: blink 1s infinite;
    float: right;
}

/* Inner Pages Container */
.inner-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
}

/* 3D Book Styles */
.book-container {
    perspective: 1500px;
    width: 900px;
    height: 600px;
    margin: 0 auto;
    position: relative;
}

.book {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.page {
    width: 50%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 50%;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1);
    z-index: 1;
}

.page.flipped {
    transform: rotateY(-180deg);
}

#page-0 {
    z-index: 10;
}

.page-front,
.page-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    padding: 30px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #000;
}

.page-front {
    background: #fdfbf7;
    z-index: 2;
}

.page-back {
    background: #fdfbf7;
    transform: rotateY(180deg);
    z-index: 1;
}

.cover-front {
    background: #5d4037;
    border: 4px solid #3e2723;
    display: flex;
    align-items: center;
    justify-content: center;
}

.journal-lines {
    background-image: linear-gradient(#e6d0b3 1px, transparent 1px);
    background-size: 100% 1.5rem;
    line-height: 1.5rem;
    height: 100%;
}

.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    font-family: var(--font-main);
    font-size: 10px;
}

.about-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

@keyframes blink {

    0%,
    90%,
    100% {
        opacity: 1;
    }

    95% {
        opacity: 0;
    }
}

/* Photo Album Grid & Lightbox */
.photo-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 20px;
    align-items: center;
}

.photo-wrapper {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.photo-item {
    width: 100%;
    height: auto;
    object-fit: contain;
    border: 4px solid #000;
    cursor: pointer;
    transition: transform 0.2s;
    background: #ccc;
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.5);
}

.photo-item:hover {
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.5);
}

.photo-timestamp {
    font-family: var(--font-hand);
    font-size: 1.2rem;
    color: #555;
    background: #fff;
    padding: 2px 8px;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    transform: rotate(-2deg);
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border: 4px solid #fff;
    box-shadow: 0 0 20px #000;
    image-rendering: pixelated;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    font-family: var(--font-main);
    background: #000;
    padding: 5px 10px;
    border: 2px solid #fff;
}

.close-btn:hover {
    background: #f00;
}