@font-face {
    font-family: 'TT Ricordi Todi';
    src: url('tt-ricordi-todi/TT Ricordi Todi Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

html {
    overflow: hidden;
}

/* Loading screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

#loading-logo {
    width: 250px;
    height: 250px;
}

.logo-path {
    stroke-dasharray: 5000;
    stroke-dashoffset: 5000;
    animation: drawStroke 2s ease-in-out infinite;
}

@keyframes drawStroke {
    0% {
        stroke-dashoffset: 5000;
    }
    50% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -5000;
    }
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    position: relative;
}

body {
    background: #f0f0f0;
}

#dotCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: -1;
    pointer-events: none;
    transition: filter 0.3s ease;
}

#dotCanvas.blurred {
    filter: blur(8px);
    transform: scale(1.05);
}

#canvas-container {
    width: 100vw;
    height: 100vh;
    transition: filter 0.3s ease;
    position: relative;
    z-index: 10;
}

#canvas-container canvas {
    background: transparent !important;
}

#canvas-container.blurred {
    filter: blur(8px);
}

.sidebar {
    position: fixed;
    right: -500px;
    top: 0;
    width: 500px;
    height: 100vh;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 40px 30px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100vw;
        right: -100vw;
        padding: 40px 20px;
    }
}

.sidebar.open {
    right: 0;
}

.bottom-sidebar {
    position: fixed;
    bottom: -300px;
    left: 0;
    width: 100vw;
    height: 300px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    transition: bottom 0.3s ease;
    z-index: 1000;
    padding: 40px 30px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .bottom-sidebar {
        height: 50vh;
        bottom: -50vh;
        padding: 40px 20px;
    }
}

.bottom-sidebar.open {
    bottom: 0;
}

.left-sidebar {
    position: fixed;
    left: -500px;
    top: 0;
    width: 500px;
    height: 100vh;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 40px 30px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .left-sidebar {
        width: 100vw;
        left: -100vw;
        padding: 40px 20px;
    }
}

.left-sidebar.open {
    left: 0;
}

.close-btn {
    position: absolute;
    top: 50px;
    right: 30px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #f0f0f0;
    transition: color 0.2s;
    font-family: 'TT Ricordi Todi', serif;
    font-weight: 500;
}

@media (max-width: 768px) {
    .close-btn {
        right: 20px;
    }
}

.close-btn:hover {
    color: #a4a4a4;
}

#sidebar-content {
    margin-top: 10px;
    margin-bottom: 100px;
}

#sidebar-content h2 {
    color: #ffffff;
    margin-bottom: 45px;
    font-size: 28px;
}

#sidebar-content p {
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: 15px;
}

#sidebar-content a {
    color: #8b9dff;
    text-decoration: none;
    display: block;
    margin: 10px 0;
}

#sidebar-content a:hover {
    text-decoration: underline;
    color: #a5b4ff;
}

.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.portfolio-item {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.portfolio-item iframe {
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scale(0.5);
    transform-origin: top left;
    width: 200%;
    height: 200%;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    pointer-events: none;
}

.portfolio-item:hover .portfolio-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.portfolio-link {
    color: white;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -50%);
    font-family: 'TT Ricordi Todi', serif;
}

.portfolio-item:hover .portfolio-link {
    opacity: 1;
}

#sidebar-content h2 {
    font-family: 'TT Ricordi Todi', serif;
}
