/* CSS Variables for Lumon Theme */
:root {
    --primary-color: #00FF41;
    /* Classic Terminal Green */
    --bg-dark: #000000;
    /* Pure Black for OLED/CRT feel */
    --text-dim: rgba(0, 255, 65, 0.6);
    --glow-spread: 8px;
    --font-ui: 'Public Sans', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Global Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.theme-lumon {
    background-color: var(--bg-dark);
    color: var(--primary-color);
    font-family: var(--font-mono);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    /* Hide scrollbars during loading */
    text-shadow: 0 0 calc(var(--glow-spread) / 2) var(--text-dim);
}

/* Loading Screen Overlay */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out, visibility 1s;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.lumon-logo-container {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lumon-logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.5));
}

@keyframes drip-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.5));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px rgba(0, 255, 65, 0.8));
    }
}

.boot-sequence {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary-color);
}

#boot-text {
    margin-bottom: 1rem;
    height: 1.5rem;
    letter-spacing: 0.1rem;
}

.loading-bar-container {
    width: 100%;
    height: 2px;
    background-color: rgba(0, 255, 65, 0.1);
    position: relative;
    overflow: hidden;
}

#loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.2s ease-out;
}

/* Hide main container initially */
.container {
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.container.visible {
    opacity: 1;
}

::selection {
    background: var(--text-dim);
    color: var(--bg-dark);
    text-shadow: none;
}

/* -------------------- */
/* CRT Screen Effects   */
/* -------------------- */

/* Scanlines Array Overlay */
body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 50%,
            rgba(0, 255, 65, 0.03) 50%);
    background-size: 100% 4px;
    z-index: 50;
    pointer-events: none;
}

/* Radial Vignette */
body::after {
    content: " ";
    display: block;
    position: fixed;
    /* Fixed to cover screen correctly on scroll */
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.4) 110%);
    z-index: 51;
    pointer-events: none;
}

/* Screen Flicker Animation */
@keyframes flicker {
    0% {
        opacity: 0.98;
    }

    5% {
        opacity: 0.92;
    }

    10% {
        opacity: 0.98;
    }

    15% {
        opacity: 1;
        text-shadow: 0 0 calc(var(--glow-spread)) var(--primary-color);
    }

    100% {
        opacity: 1;
    }
}

.theme-lumon {
    animation: flicker 0.15s infinite;
}

/* -------------------- */
/* UI Components        */
/* -------------------- */

/* Macrodata Refinement Background Canvas */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.15;
}

.container {
    width: 100%;
    max-width: 520px;
    /* Constrain width like Linktree mobile view */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Vertically center content */
    padding: 2rem;
    position: relative;
    z-index: 20;
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    width: 100%;
}

.system-status {
    width: 100%;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 0.5rem;
    font-size: 0.75rem;
    /* ~12px */
    display: flex;
    justify-content: space-between;
    padding: 0 1rem 0.5rem 1rem;
}

/* Animated Pulse/Blink Utility */
.blink {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Profile Section */
.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.5rem;
}

.profile-pic-border {
    width: 6rem;
    /* 96px */
    height: 6rem;
    border: 1px solid var(--primary-color);
    padding: 0.25rem;
    /* Gives the double inner border effect */
    margin-bottom: 1rem;
}

.profile-pic {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* Translates Tailwind: grayscale contrast-150 brightness-75 sepia-[0.5] hue-rotate-[100deg] */
    filter: grayscale(100%) contrast(150%) brightness(75%) sepia(50%) hue-rotate(100deg);
}

.profile-info {
    text-align: center;
}

.employee-status {
    font-size: 0.625rem;
    /* 10px */
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.25rem;
}

.id-ref {
    font-size: 0.875rem;
    /* 14px */
}

/* Link Items */
.links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 3rem;
}

/* 3D Flip Button Effect */
.btn-flip {
    opacity: 1;
    outline: 0;
    color: transparent;
    /* Hide original text, using pseudo-elements */
    height: 100%;
    width: 100%;
    position: relative;
    text-align: center;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: 0.3s;
    perspective: 1000px;
    background: transparent !important;
}

.btn-flip:hover:after {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.btn-flip:hover:before {
    opacity: 0;
    transform: translateY(50%) rotateX(90deg);
}

.btn-flip:after {
    top: 0;
    left: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    color: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
    position: absolute;
    background: var(--primary-color);
    content: attr(data-back);
    transform: translateY(-50%) rotateX(90deg);
    pointer-events: none;
    border: 1px solid var(--primary-color);
    /* Same border as front to match width */
}

.btn-flip:before {
    top: 0;
    left: 0;
    opacity: 1;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    transition: 0.5s;
    position: absolute;
    /* Using absolute for both ensures perfect alignment */
    background: var(--bg-dark);
    border: 1px solid var(--primary-color);
    content: attr(data-front);
    transform: translateY(0) rotateX(0);
}

/* Link Items Adjustment */
.link-item {
    border: none;
    /* Removed original border to let btn-flip handle it */
    padding: 0;
    display: block;
    height: 3rem;
}

.link-title,
.link-tag {
    display: none;
    /* Hide original spans, using data attributes */
}

.link-title {
    font-size: 0.875rem;
    /* 14px */
    letter-spacing: 0.1em;
}

.link-tag {
    font-size: 0.75rem;
    /* 12px */
}

/* Toggle Switch Bottom Bar */
.toggle-section {
    margin-top: 3rem;
    /* Changed from auto to center the whole block vertically */
    width: 100%;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 255, 65, 0.3);
}

.toggle-container {
    border: 1px solid var(--primary-color);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-info {
    font-size: 0.75rem;
    /* 12px */
}

.toggle-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    letter-spacing: 0.1em;
}

.toggle-status {
    opacity: 0.7;
}

.highlight {
    color: #fff;
    /* White text creates the bright green impact against the text-shadow */
    text-shadow: 0 0 4px var(--primary-color);
    opacity: 1;
}

.hover-glow:hover {
    background-color: var(--primary-color);
    color: var(--bg-dark);
    text-shadow: none;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.toggle-btn {
    font-size: 0.75rem;
    border: 1px solid var(--primary-color);
    padding: 0.25rem 0.5rem;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

/* Footer Section */
footer {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-content {
    font-size: 0.625rem;
    /* 10px */
    color: var(--primary-color);
    opacity: 0.6;
}

.essential-msg {
    letter-spacing: 0.5em;
    margin-bottom: 0.5rem;
}

.script-name {
    margin-bottom: 1rem;
}

.copy-info {
    font-size: 0.5rem;
    /* 8px */
    letter-spacing: -0.05em;
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }

    .system-status {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .hex-grid {
        display: none;
        /* Hide decorative hexes on small screens */
    }
}