@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: #0e0e0e;
    color: #ececff;
    padding-top: 70px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: #0e0e0e;
    z-index: 1000;
    border-bottom: 1px solid #03000f;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ececff;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #ececff;
    text-decoration: none;
    font-size: 1rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: #000000;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}


header {
    padding: 40px 20px 20px 20px;
    text-align: center;
    font-size: 3rem;
    font-weight: bold;
}

.about-me {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
}

.about-me p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #d6d6e8;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 600px));
    justify-content: center;
    column-gap: 40px;
    row-gap: 60px;
    padding: 60px 40px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-form label {
    font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #2e2e38;
    border-radius: 8px;
    background: #16161f;
    color: #ececff;
    padding: 12px;
    font: inherit;
}

.contact-form textarea {
    resize: vertical;
    min-height: 130px;
}

.contact-form button {
    align-self: flex-start;
    padding: 10px 18px;
    border: 1px solid #ececff;
    border-radius: 8px;
    background: transparent;
    color: #ececff;
    font: inherit;
    cursor: pointer;
}

.contact-form button:hover {
    background: #ececff;
    color: #0e0e0e;
}

#contact-status {
    margin: 4px 0 0;
    min-height: 1.2em;
    color: #9dd39a;
}

.project {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.project:hover {
    transform: scale(1.05);
}

.project img,
.project video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project video {
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    background: #000;
}

.project:hover video {
    opacity: 1;
}

.project-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-align: center;
    pointer-events: none;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
    transition: opacity 1s ease;
    z-index: 3;
}

.project:hover .project-title {
    opacity: 0;
}

.project-cog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    font-size: 2.6rem;
    color: #fff;
    opacity: 0;
    z-index: 4;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.project-underconstruction:hover .project-cog {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: cog-spin 1s linear infinite;
}

@keyframes cog-spin {
    from { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    to { transform: translate(-50%, -50%) scale(1) rotate(360deg); }
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #111;
    width: 84%;
    max-width: 980px;
    max-height: 80vh;
    padding: 40px;
    overflow-y: auto;
    border-radius: 12px;
    position: relative;
}

.contact-modal-content {
    max-width: 640px;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content video {
    width: 100%;
    margin: 20px 0;
    border-radius: 8px;
}

.modal-content iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 20px 0;
    border-radius: 8px;
    border: 0;
    display: none;
    background: #000;
}

.modal-gallery-section {
    margin-top: 24px;
}

.modal-gallery-section h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
}

.modal-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.gallery-thumb {
    width: min(760px, 88%);
    padding: 0;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #000;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-thumb:hover {
    transform: translateY(-2px);
    border-color: #5a5a5a;
}

.gallery-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.gallery-caption {
    margin: 0;
    width: min(760px, 88%);
    font-size: 0.95rem;
    line-height: 1.4;
    color: #c9c9d9;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.92);
    z-index: 3000;
}

.image-lightbox.active {
    display: flex;
}

#lightbox-image {
    max-width: min(1200px, 100%);
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}

.image-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

#lightbox-caption {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    max-width: min(900px, calc(100% - 40px));
    text-align: center;
    color: #ececff;
    font-size: 1rem;
    line-height: 1.4;
}

.fun-hex-button {
    position: fixed;
    right: 18px;
    top: 56px;
    width: 30px;
    height: 30px;
    border: 0;
    padding: 0;
    background: #fff;
    clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
    cursor: pointer;
    z-index: 3500;
}

.site-footer {
    width: 100%;
    padding: 16px 12px 24px;
    box-sizing: border-box;
    text-align: center;
    color: #b9b9c9;
    font-size: 0.9rem;
}

.fun-hello {
    position: fixed;
    right: 12px;
    top: 20px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: lowercase;
    opacity: 0;
    pointer-events: none;
    z-index: 3600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.65);
}

.fun-hello.show {
    animation: hello-jump 1.6s ease forwards;
}

.fun-hex-button.spin {
    animation: hex-spin 0.6s ease;
}

.fun-hex-button.spin-fast {
    animation: hex-spin-fast 1.9s cubic-bezier(0.14, 0.78, 0.16, 1);
}

.fun-spark {
    position: fixed;
    width: var(--spark-size, 4px);
    height: var(--spark-size, 4px);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
    pointer-events: none;
    z-index: 3600;
    animation: spark-burst var(--spark-duration, 1.2s) ease-out forwards;
}

@keyframes hex-spin {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1.05); }
}

@keyframes hex-spin-fast {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(150deg) scale(1.12); }
    55% { transform: rotate(1260deg) scale(1.25); }
    78% { transform: rotate(1760deg) scale(1.06); }
    100% { transform: rotate(1800deg) scale(1); }
}

@keyframes spark-burst {
    from {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(var(--dx), var(--dy)) scale(0.3);
        opacity: 0;
    }
}

@keyframes hello-jump {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.9);
    }
    15% {
        opacity: 1;
        transform: translateY(-6px) scale(1.04);
    }
    40% {
        transform: translateY(-2px) scale(1);
    }
    70% {
        opacity: 1;
        transform: translateY(-8px) scale(1.03);
    }
    100% {
        opacity: 0;
        transform: translateY(-14px) scale(0.96);
    }
}

@media (max-width: 1320px) {
    .grid {
        grid-template-columns: minmax(280px, 900px);
    }
}

@media (max-width: 760px) {
    body {
        padding-top: 80px;
    }

    .nav-container {
        padding: 0 16px;
    }

    .nav-links {
        gap: 16px;
    }

    .grid {
        padding: 30px 16px;
        row-gap: 28px;
        column-gap: 0;
    }

    .about-me {
        margin-top: 10px;
    }

    .modal-content {
        width: calc(100% - 24px);
        padding: 24px 16px;
    }

    .fun-hex-button {
        top: 64px;
        right: 12px;
    }

    .fun-hello {
        top: 28px;
        right: 10px;
    }
}
