/* Nuxt wraps the page in extra divs; main.css needs a full-height chain from body */
#__nuxt,
#__nuxt > div {
    height: 100%;
}

/* Section transitions: cube rotation between sections */
.animated-section.cube-out {
    z-index: 100;
}

.animated-section.cube-out.cube-left {
    animation: cube-out-left 0.6s ease-in both;
}

.animated-section.cube-in.cube-left {
    animation: cube-in-left 0.6s ease-in both;
}

.animated-section.cube-out.cube-right {
    animation: cube-out-right 0.6s ease-in both;
}

.animated-section.cube-in.cube-right {
    animation: cube-in-right 0.6s ease-in both;
}

@keyframes cube-out-left {
    50% {
        animation-timing-function: ease-out;
        transform: translateX(-50%) translateZ(-200px) rotateY(-45deg);
    }
    100% {
        opacity: 0.3;
        transform: translateX(-100%) rotateY(-90deg);
    }
}

@keyframes cube-in-left {
    0% {
        opacity: 0.3;
        transform: translateX(100%) rotateY(90deg);
    }
    50% {
        animation-timing-function: ease-out;
        transform: translateX(50%) translateZ(-200px) rotateY(45deg);
    }
}

@keyframes cube-out-right {
    50% {
        animation-timing-function: ease-out;
        transform: translateX(50%) translateZ(-200px) rotateY(45deg);
    }
    100% {
        opacity: 0.3;
        transform: translateX(100%) rotateY(90deg);
    }
}

@keyframes cube-in-right {
    0% {
        opacity: 0.3;
        transform: translateX(-100%) rotateY(-90deg);
    }
    50% {
        animation-timing-function: ease-out;
        transform: translateX(-50%) translateZ(-200px) rotateY(-45deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .animated-section.cube-out,
    .animated-section.cube-in {
        animation: none !important;
    }

    .animated-section.cube-out {
        opacity: 0;
        visibility: hidden;
    }
}

/* Portfolio gallery trigger (replaces the fslightbox anchors) */
.gallery-trigger {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

/* Forms */
.field-control {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 2px solid #d5d6d7;
    border-radius: 5px;
    background: #fff;
    color: #555;
    font: inherit;
    line-height: 1.4;
    outline: none;
    box-shadow: 0 10px 10px -8px rgba(0, 0, 0, 0.1);
}

.field-control:focus {
    border-color: #04b4e0;
}

.field-control.invalid {
    border-color: #ff4c4c;
}

textarea.field-control {
    height: 170px;
    resize: vertical;
}

.contact-form .btn-send {
    display: block;
    margin: 10px auto 0;
    cursor: pointer;
}

.contact-form .btn-send:disabled,
.modal-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-status {
    margin-top: 16px;
    font-size: 14px;
}

.form-status.success {
    color: #1a8f4c;
}

.form-status.invalid {
    color: #c23b3b;
}

section[data-id='contact'] .contact-email {
    display: block;
    margin-top: 8px;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    word-break: break-word;
}

/* Repository modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(50, 50, 50, 0.7);
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: auto;
    padding: 28px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.modal-intro {
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #999;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    color: #222;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.modal-actions .btn {
    margin: 0;
}

/* Image lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
}

.lightbox-count {
    position: absolute;
    top: 18px;
    left: 22px;
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    cursor: pointer;
}

.lightbox-close {
    top: 10px;
    right: 18px;
    font-size: 34px;
    line-height: 1;
}

.lightbox-nav {
    top: 50%;
    width: 52px;
    height: 52px;
    margin-top: -26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 26px;
    line-height: 52px;
    text-align: center;
}

.lightbox-nav:hover,
.lightbox-close:hover {
    color: #04b4e0;
}

.lightbox-nav.prev {
    left: 18px;
}

.lightbox-nav.next {
    right: 18px;
}

@media only screen and (max-width: 480px) {
    .field-control {
        margin-bottom: 12px;
    }

    textarea.field-control {
        height: 140px;
    }

    .modal-card {
        padding: 22px 18px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        margin-top: -21px;
        line-height: 42px;
    }

    .lightbox-nav.prev {
        left: 8px;
    }

    .lightbox-nav.next {
        right: 8px;
    }
}
