@font-face {
    font-family: 'Fira Code Nerd Font';
    src: url('/font/FiraCodeNerdFont-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    background: #000000;
    color: #ff3333;
    font-family: 'Fira Code Nerd Font', monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

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

.dynamic-header,
.content {
    position: relative;
    z-index: 1;
}

.content {
    max-width: 540px;
    margin: 40px auto;
    padding: 0 16px;
}

.dynamic-header {
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(214, 36, 36, 0.3), rgba(0, 0, 0, 1)), url('/assets/cloud.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 0% 50%;
    border-bottom: 1px solid #d62424;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: drift 120s linear infinite alternate;
}

@keyframes drift {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

a { color: #ff1a1a; text-decoration: none; }
a:hover { color: #ff9999; }

.clear-link {
    text-decoration: underline dotted #d62424;
    text-underline-offset: 4px;
}

.clear-link:hover {
    text-decoration: underline solid #ff9999;
}

h1 {
    color: #ff6666;
    font-size: 18px;
    font-weight: normal;
    letter-spacing: 4px;
    text-align: center;
    border-bottom: 1px solid #240000;
    padding-bottom: 8px;
    margin-bottom: 32px;
}

.dynamic-header h1 {
    font-size: 26px;
    letter-spacing: 6px;
    text-align: center;
    border-bottom: none;
    margin: 0;
    text-shadow: 2px 2px #000000;
    padding-bottom: 0;
}

h2 {
    color: #ff6666;
    font-size: 13px;
    font-weight: normal;
    margin-top: 24px;
    margin-bottom: 4px;
}

p { margin: 8px 0; }

ul { list-style: none; padding: 0; }
li { padding: 2px 0; }
li::before { content: "> "; color: #d62424; }

img {
    max-width: 100%;
    height: auto;
    border: 1px solid #240000;
    display: block;
    margin: 16px 0;
}

hr { border: 0; border-top: 1px solid #240000; margin: 20px 0; }

/* Blocks */
.art-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 60px 0 40px 0;
}

.portal-wrapper {
    display: inline-block;
    text-align: center;
    margin-bottom: 24px;
}

.portal-wrapper a {
    display: inline-block;
    text-decoration: none;
}

.main-image {
    max-width: 180px;
    border: 1px dashed #ff1a1a;
    padding: 8px;
    margin: 0 auto 12px auto;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: void-breath 3s infinite alternate ease-in-out;
}

@keyframes void-breath {
    0% {
        filter: drop-shadow(0 0 4px #490000);
        transform: scale(1.0);
    }
    100% {
        filter: drop-shadow(0 0 12px #ff1a1a);
        transform: scale(1.01);
    }
}

.portal-wrapper a:hover .main-image {
    filter: drop-shadow(0 0 16px #ff1a1a) brightness(1.5);
    border-style: solid;
}

.portal-wrapper a:active .main-image {
    transform: scale(0.98);
    border-color: #ffffff;
    filter: brightness(1.5) drop-shadow(0 0 20px #ffffff);
    transition: all 0.1s ease;
}

.action-prompt {
    font-size: 11px;
    color: #ff1a1a;
    letter-spacing: 3px;
    margin: 0;
    animation: crt-flicker 0.15s infinite alternate;
    transition: all 0.3s ease;
}

@keyframes crt-flicker {
    0% { opacity: 0.8; }
    100% { opacity: 1.0; }
}

.portal-wrapper a:hover .action-prompt {
    color: #ffffff;
    text-shadow: 0 0 8px #ff1a1a;
}

.decay-text { font-size: 13px; letter-spacing: 2px; color: #ff6666; margin: 0; }

.page-body { text-align: center; color: #d62424; margin: 60px 0; letter-spacing: 1px; }

/* Helpers */
.alarm-clock { color: #ff3333; font-size: 11px; transition: all 0.4s ease; cursor: default; }
.alarm-clock:hover { color: #ff1a1a; text-shadow: 0 0 4px #ff1a1a; }
.dim { color: #d62424; }
.mid { color: #d62424; }

/* Footer */
.home-btn { display: flex; justify-content: center; gap: 16px; margin: 40px 0 20px 0; }
.home-btn a { display: inline-block; line-height: 0; }
.home-btn img { height: 56px; width: auto; image-rendering: pixelated; opacity: 0.6; transition: opacity 0.3s ease; border: none; margin: 0; }
@media (min-width: 768px) { .home-btn img { height: 34px; } }
.home-btn img:hover { opacity: 1; }

/* --- DIRECTORY TREE --- */
.dir-tree { padding: 0; margin: 20px 0 40px 0; }
.dir-entry { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.dir-entry .folder-icon { width: 16px; height: 16px; image-rendering: pixelated; border: none; margin: 0; flex-shrink: 0; }
.dir-entry a { color: #ff1a1a; font-weight: normal; }
.dir-entry a:hover { color: #ff9999; }
.sub-tree { margin-left: 24px; color: #d62424; }
.sub-entry { display: flex; align-items: center; gap: 0; padding: 1px 0; }
.tree-branch { color: #240000; white-space: pre; user-select: none; }
.sub-entry a { color: #ff1a1a; }
.sub-entry a:hover { color: #ff9999; }

/* Media Gallery */
.media-gallery {
    position: relative;
    height: 360px;
    margin: 40px 0 60px 0;
    overflow: visible;
}

.photo-frame {
    position: absolute;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.photo-frame div {
    background: #000;
    border: 1px solid #d62424;
    padding: 6px;
}

.photo-frame:hover {
    transform: rotate(0deg) scale(1.1) !important;
    z-index: 10 !important;
}

@media (max-width: 600px) {
    .media-gallery {
        height: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .photo-frame img {
        width: 100% !important;
    }
    .photo-frame {
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        transform: rotate(0deg) !important;
    }
}
