/* --- CONFIGURATION --- */
:root {
    --color-primary: #ff8d3e;
    --color-alert: #fe252b;
    --color-success: #95ffd0;
    --color-dark: #08080a;
    --color-dim: rgba(255, 141, 62, 0.05);
    --chroma-gradient: linear-gradient(
        90deg,
        #66b5a5 0%,
        #0a1aa8 50%,
        #8923ca 100%
    );

    --font-title: "Zalando Sans Expanded", sans-serif;
    --font-body: "Xanh Mono", monospace;
    --font-barcode: "Libre Barcode 39 Extended", system-ui;

    /* ICONS */
    --bg-github: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96"><path fill="%23ffffff" fill-opacity="0.1" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z"/></svg>');
    --bg-gitlab: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23ffffff" fill-opacity="0.1" d="M105.2 24.9c-3.1-8.9-15.7-8.9-18.9 0L29.8 199.7h132c-.1 0-56.6-174.8-56.6-174.8zM496.5 170.6L432.2 13.5c-2.3-5.6-7.8-9.1-13.7-9.1-5.9 0-11.4 3.5-13.7 9.1L340.5 199.7h142.3c2.7-.1 16-20.2 13.7-29.1zM261.2 225.4l-75.1 231.1c-1.6 4.9 2.5 9.7 7.2 8.3l127-38.3-59.1-201.1zm-89.9 21.3l-106-32 165.9 255.4c4.3 6.6 14.3 6.6 18.6 0l16-24.6-94.5-198.8z"/></svg>');
}

/* --- ANIMATIONS --- */
@keyframes signal-pulse {
    0% {
        opacity: 1;
        text-shadow: 0 0 5px var(--color-success);
    }
    50% {
        opacity: 0.5;
        text-shadow: none;
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 5px var(--color-success);
    }
}

@keyframes scan {
    0% {
        top: 0%;
    }
    100% {
        top: 100%;
    }
}

/* Page Entry Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0; /* Hidden by default until animation runs */
}

.text-glow {
    text-shadow: 0 0 5px currentColor;
}

/* --- GLOBAL STYLES --- */
body {
    background-color: #000;
    color: white;
    margin: 0;
    font-family: var(--font-body);
    overflow-x: hidden;
    overflow-y: scroll; /* Force scrollbar */
    font-size: 16px;
}

#calibration-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* --- SYSTEM INTERFACE --- */
.sys-interface {
    max-width: 1280px;
    margin: 40px auto;
    background-color: rgba(5, 5, 5, 0.95);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 2;
    padding: 8px;

    /* CORNER BRACKETS */
    --b-width: 2px;
    --c-size: 15px;
    background-image:
        linear-gradient(
            to right,
            var(--color-primary) var(--b-width),
            transparent var(--b-width)
        ),
        linear-gradient(
            to right,
            var(--color-primary) var(--b-width),
            transparent var(--b-width)
        ),
        linear-gradient(
            to left,
            var(--color-primary) var(--b-width),
            transparent var(--b-width)
        ),
        linear-gradient(
            to left,
            var(--color-primary) var(--b-width),
            transparent var(--b-width)
        ),
        linear-gradient(
            to bottom,
            var(--color-primary) var(--b-width),
            transparent var(--b-width)
        ),
        linear-gradient(
            to bottom,
            var(--color-primary) var(--b-width),
            transparent var(--b-width)
        ),
        linear-gradient(
            to top,
            var(--color-primary) var(--b-width),
            transparent var(--b-width)
        ),
        linear-gradient(
            to top,
            var(--color-primary) var(--b-width),
            transparent var(--b-width)
        );
    background-position:
        0 0,
        0 100%,
        100% 0,
        100% 100%,
        0 0,
        100% 0,
        0 100%,
        100% 100%;
    background-repeat: no-repeat;
    background-size: var(--c-size) var(--c-size);
}

.chromatic-bar {
    height: 8px;
    width: 100%;
    background: var(--chroma-gradient);
    background-size: 100% 100%;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
@media (min-width: 900px) {
    .grid-layout {
        grid-template-columns: 250px 1fr;
    }
}

/* --- SIDEBAR --- */
.sidebar {
    background-color: var(--color-dim);
    border-right: 1px solid var(--color-primary);
    padding: 30px 20px;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 500px;
}
.id-block {
    margin-bottom: 30px;
}
.id-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
}
.operator-id {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 3rem;
    line-height: 0.8;
    color: var(--color-alert);
    letter-spacing: -2px;
    transform: scaleX(0.7);
    transform-origin: right;
    white-space: nowrap;
}
.meta-text {
    font-size: 0.75rem;
    color: var(--color-success);
    opacity: 0.8;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.nav-link {
    display: block;
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: #888;
    padding: 5px 0;
    border-right: 2px solid transparent;
    transition: 0.2s;
}
.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
    border-right: 4px solid var(--color-primary);
    padding-right: 10px;
    background: linear-gradient(to left, rgba(255, 141, 62, 0.1), transparent);
    text-shadow: 0 0 5px var(--color-primary);
}

.sidebar-footer {
    margin-top: 40px;
    border-top: 1px dotted rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}
.barcode-display {
    font-family: var(--font-barcode);
    font-size: 36px;
    color: var(--color-success);
    opacity: 0.4;
    line-height: 1;
}
.sys-status {
    font-size: 0.7rem;
    color: #666;
    margin-top: 5px;
}
.status-light {
    color: var(--color-success);
    animation: signal-pulse 2s infinite;
}

/* --- MAIN PANEL --- */
.main-panel {
    padding: 30px;
}

h1 {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 3rem;
    margin: 0 0 10px 0;
    line-height: 0.9;
    color: var(--color-primary);
}
h3 {
    font-family: var(--font-title);
    color: var(--color-success);
    border-left: 3px solid var(--color-primary);
    padding-left: 10px;
    margin-bottom: 15px;
    text-shadow: 0 0 3px rgba(149, 255, 208, 0.4);
}
.subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--color-success);
    margin-bottom: 30px;
    display: block;
    border-bottom: 1px solid var(--color-primary);
    padding-bottom: 5px;
    width: fit-content;
}
p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #ddd;
    text-align: justify;
}

/* --- LOGS LIST --- */
.log-list {
    list-style: none;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.log-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted #333;
    padding: 12px 10px;
    font-size: 1.1rem; /* MATCH BODY TEXT SIZE */
    transition:
        background 0.2s,
        color 0.2s;
    cursor: pointer;
}
.log-item:hover {
    background: var(--color-primary);
    color: black;
}
.log-item:hover .log-date,
.log-item:hover .log-title {
    color: black;
}

.log-date {
    color: var(--color-primary);
    font-family: var(--font-body);
    transition: 0.2s;
}
.log-title {
    color: #aaa;
    transition: 0.2s;
    font-weight: bold;
}

/* --- GALLERY --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-tile {
    border: 1px solid #333;
    background: rgba(0, 0, 0, 0.3);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.gallery-tile:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(255, 141, 62, 0.2);
    cursor: pointer;
}

.gallery-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    filter: grayscale(80%);
    transition: 0.5s;
}
.gallery-tile:hover .gallery-img {
    filter: grayscale(0%);
}

.gallery-info {
    padding: 10px;
    border-top: 1px solid #333;
}
.gallery-title {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: var(--color-primary);
    border-left: 3px solid var(--color-primary);
    padding-left: 8px;
}

.no-signal {
    height: 100%;
    min-height: 180px;
    background-color: #0d0d0d;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.no-signal span {
    font-size: 0.8rem;
    color: #333;
    font-weight: bold;
    z-index: 2;
}
.no-signal::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-alert);
    opacity: 0.3;
    animation: scan 2s linear infinite;
}

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#lightbox.active {
    display: flex;
}
#lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}
#lightbox-caption {
    margin-top: 15px;
    color: white;
    font-family: var(--font-body);
    max-width: 800px;
    text-align: center;
}
#lightbox-title {
    color: var(--color-primary);
    font-family: var(--font-title);
    font-size: 1.5rem;
    display: block;
    margin-bottom: 5px;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.lightbox-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    font-family: var(--font-title);
    font-size: 2rem;
    padding: 10px 20px;
    cursor: pointer;
    transition: 0.2s;
    margin: 0 20px;
}
.lightbox-btn:hover {
    background: var(--color-primary);
    color: black;
}
.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: #666;
    cursor: pointer;
}
.close-lightbox:hover {
    color: var(--color-alert);
}

/* --- LINKS --- */
a {
    color: white;
    text-decoration: none;
}
.main-panel p a {
    background: linear-gradient(90deg, transparent 50%, var(--color-alert) 50%);
    background-size: 200% 100%;
    transition: background-position 0.3s cubic-bezier(0, 0, 0.2, 1);
    padding: 0 4px;
}
.main-panel p a:hover {
    background-position: -100% 0;
    color: black;
}

.section-break {
    height: 2px;
    width: 100%;
    background: var(--chroma-gradient);
    margin: 40px 0;
    opacity: 0.7;
}
.footer-note {
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid #333;
    padding-top: 10px;
}

/* --- DATA MODULES & PROJECTS --- */
.data-module {
    border: 1px solid var(--color-success);
    background: rgba(149, 255, 208, 0.02);
}

/* PROJECT CARD BACKGROUNDS */
.project-card {
    position: relative;
    overflow: hidden;
}

/* Tiled Background Layer */
.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* DENSELY TILED PATTERN */
    background-repeat: repeat;
    background-size: 50px 50px;
    z-index: 0;
}
/* Heavy Gradient Layer */
.project-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient: 100% Black at top-left -> 30% Black at bottom-right */
    background: linear-gradient(
        135deg,
        rgba(5, 5, 5, 1) 40%,
        rgba(5, 5, 5, 0.3) 100%
    );
    z-index: 1;
}

.project-card.source-github::before {
    background-image: var(--bg-github);
}
.project-card.source-gitlab::before {
    background-image: var(--bg-gitlab);
}

.module-header {
    background: var(--color-success);
    color: black;
    font-family: var(--font-title);
    font-weight: 700;
    padding: 2px 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    display: inline-block;
    margin-top: -10px;
    margin-left: 10px;
    position: relative;
    z-index: 2;
}
.module-content {
    padding: 15px;
    position: relative;
    z-index: 2;
}

.data-row {
    display: flex;
    align-items: center;
    border-bottom: 1px dashed rgba(149, 255, 208, 0.3);
    padding-bottom: 5px;
    margin-bottom: 5px;
}
.data-label {
    font-weight: bold;
    color: var(--color-primary);
    width: 120px;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* --- BLOG POST --- */
.log-content-body {
    border-left: 2px solid #333;
    padding-left: 20px;
    margin-top: 30px;
}
.log-content-body h2 {
    color: var(--color-success);
    font-family: var(--font-title);
    font-size: 1.5rem;
    border-bottom: 1px dashed #333;
    padding-bottom: 5px;
    margin-top: 40px;
}
.log-content-body img {
    max-width: 100%;
    border: 1px solid var(--color-primary);
    background: #111;
    padding: 5px;
}
.log-content-body code {
    background: rgba(255, 141, 62, 0.1);
    color: var(--color-primary);
    padding: 2px 5px;
    border: 1px solid rgba(255, 141, 62, 0.2);
}
