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

@keyframes grow-in {
    from { transform: scale(0.2); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.8s ease;
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-img {
    width: 100px;
    height: 100px;
    object-fit: cover;

    opacity: 0.85;
    animation: grow-in 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.loading-text {
    color: #333;
    font-family: "prestige-elite-std", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-align: center;
    animation: grow-in 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -20px;
    left: -20px;
    width: calc(100% + 30px);
    height: calc(100% + 30px);
    background: url('sand2.avif') no-repeat center center / cover;
    filter: blur(1.5px);
    z-index: -1;
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 8);
}

.title {
    position: fixed;
    top: 94%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: #f4f1de;
    font-size: 1.2rem;
    pointer-events: none;
font-family: new-hero, sans-serif;
font-weight: 250;
font-style: light;
    background-color: rgba(255, 255, 255, 0.045);
    padding: 7px;
    backdrop-filter: blur(10px); 
    border: 0.5px solid rgba(255, 255, 255, 0.18); 
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.007); 
    border-radius: 20px;
}


.library-container {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    cursor: grab;
    perspective: 1500px;             
    perspective-origin: center center;
}

.library-container.dragging {
    cursor: grabbing;
}


.library-grid {
    position: relative;
    user-select: none;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}


.card {
    width: 200px;
    height: auto;
    background: #f4f1de;
    cursor: pointer;
    border-radius: 10px;
    position: absolute;
    transition: none;
    padding: 15px;
    font-family: "prestige-elite-std", monospace;
    font-weight: 400;
    font-style: normal;
    color: #000000;
    overflow: auto;
    font-size: 9px;
    text-align: justify left;
}

.card u {
    text-decoration: underline;
    transition: background-color 0.2s ease;
}

.card.focused u:hover {
    background-color: #e76f5180;
    cursor: pointer;
}

.ext-ref {
    cursor: default;
    position: relative;
    font-size: 1.2em;
    vertical-align: baseline;
    color: rgb(115, 65, 3);
}

.card.focused .ext-ref {
    cursor: pointer;
}

.card.focused .ext-ref:hover {
    color: #e76f51;
}

.link-preview {
    position: fixed;
    z-index: 1100;
    background: #f4f1de;
    border: 1px solid black;
    border-radius: 8px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    width: 300px;
    height: 200px;
}

.link-preview.visible {
    opacity: 1;
}

.link-preview iframe {
    width: 1200px;
    height: 800px;
    transform: scale(0.25);
    transform-origin: top left;
    border: none;
    pointer-events: none;
}

.card.focused {
    position: fixed;
    z-index: 1000;
    filter: none;
    cursor: pointer;
    border-radius: 10px;
    transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                top 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 180%;
    height: 100%;
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.focus-overlay.active {
    opacity: 1;
    pointer-events: auto;
}