/* css/project-modals.css — the reading of each find
   A game dialog box: flat near-black panel, square corners, a double
   sand-gold frame, a hard offset shadow. Titles in the HUD voice, tags in
   the mono instrument voice, one chunky button that leads to the work. */

/* ===== Modal Overlay ===== */
.project-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.project-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease;
}

/* ===== Backdrop ===== */
.project-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 5, 15, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

 /* ===== Modal Container: the dialog box ===== */
.project-modal {
    position: relative;
    background: rgba(3, 12, 24, 0.96);
    border: 2px solid var(--panel-line, #d8b56a);
    outline: 1px solid var(--panel-line-dim, rgba(216, 181, 106, 0.38));
    outline-offset: 4px;
    border-radius: 0;
    max-width: 700px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow:
        8px 8px 0 rgba(2, 8, 16, 0.7),
        0 25px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(30px) scale(0.96);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-modal-overlay.active .project-modal {
    transform: translateY(0) scale(1);
}

/* Custom scrollbar for modal */
.project-modal::-webkit-scrollbar {
    width: 6px;
}

.project-modal::-webkit-scrollbar-track {
    background: transparent;
}

.project-modal::-webkit-scrollbar-thumb {
    background: rgba(216, 181, 106, 0.45);
    border-radius: 0;
}

/* ===== Close Button: a square HUD key ===== */
.project-modal-close {
    position: sticky;
    top: 0.9rem;
    float: right;
    z-index: 10;
    width: 40px;
    height: 40px;
    margin: 0.9rem 1rem 0 0;
    background: var(--panel-line, #d8b56a);
    border: 2px solid #2a1c08;
    border-radius: 0;
    box-shadow: 3px 3px 0 var(--hud-shadow, #061220);
    color: #1a1206;
    font-family: var(--hud-font, sans-serif);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
}

.project-modal-close:hover {
    background: var(--hud-gold, #ffd36a);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--hud-shadow, #061220);
}

.project-modal-close:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--hud-shadow, #061220);
}

.project-modal-close:focus {
    outline: 2px solid var(--hud-gold, #ffd36a);
    outline-offset: 2px;
}

/* ===== Modal Body ===== */
.project-modal-body {
    clear: both;
    margin-top: -3.4rem;
}

/* ===== Header Image ===== */
.modal-header-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.modal-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 2px solid var(--panel-line-dim, rgba(216, 181, 106, 0.38));
}

/* Gradient overlay on image */
.modal-header-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top,
            rgba(13, 33, 54, 0.95) 0%,
            transparent 100%);
    pointer-events: none;
}

/* ===== Content Body ===== */
.modal-content-body {
    padding: 1.5rem 2rem 2rem;
}

/* ===== Date and status: mono tags with hard edges ===== */
.modal-date,
.modal-status {
    display: inline-block;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.28rem 0.75rem;
    border-radius: 0;
    margin-bottom: 0.75rem;
}

.modal-date {
    color: var(--hud-ink, #fff4d8);
    background: rgba(8, 24, 44, 0.9);
    border: 1px solid var(--panel-line-dim, rgba(216, 181, 106, 0.38));
}

.modal-status {
    color: rgba(125, 240, 212, 0.95);
    background: rgba(8, 36, 32, 0.9);
    border: 1px solid rgba(125, 240, 212, 0.4);
    margin-left: 0.4rem;
}

.modal-status::before {
    content: '●';
    margin-right: 0.45rem;
    font-size: 0.6rem;
    vertical-align: 1px;
}

/* ===== Course Badge ===== */
.modal-course {
    display: block;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.5rem;
}

/* ===== Screenshots ===== */
.modal-screenshots {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 8, 18, 0.5);
    border: 1px solid var(--panel-line-dim, rgba(216, 181, 106, 0.38));
    border-radius: 0;
}

.modal-screenshot {
    width: 100%;
    border-radius: 0;
    border: 1px solid rgba(216, 181, 106, 0.25);
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-screenshot:last-child {
    margin-bottom: 0;
}

/* ===== Title ===== */
.modal-title {
    font-family: var(--hud-font, sans-serif);
    font-size: 1.7rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--hud-ink, #fff4d8);
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 3px 3px 0 var(--hud-shadow, #061220);
}

/* ===== Objective: a gold rule down the left edge ===== */
.modal-objective {
    position: relative;
    font-size: 1rem;
    color: #c9d8e6;
    line-height: 1.6;
    padding: 0.9rem 1.1rem 0.9rem 1.2rem;
    background: rgba(216, 181, 106, 0.06);
    border-left: 4px solid var(--panel-line, #d8b56a);
    border-radius: 0;
    margin-bottom: 1.5rem;
}

.modal-objective strong {
    font-family: var(--hud-font, sans-serif);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--hud-gold, #ffd36a);
    text-shadow: 2px 2px 0 var(--hud-shadow, #061220);
}

/* ===== Tools Section ===== */
.modal-tools {
    margin-bottom: 1.5rem;
}

.modal-tools h3 {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(216, 181, 106, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-bottom: 0.75rem;
}

.modal-tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Square mono tags */
.modal-tool-tag {
    display: inline-block;
    padding: 0.28rem 0.7rem;
    background: rgba(8, 24, 44, 0.9);
    border: 1px solid var(--panel-line-dim, rgba(216, 181, 106, 0.38));
    border-radius: 0;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: var(--hud-ink, #fff4d8);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.modal-tool-tag:hover {
    transform: translate(-1px, -1px);
    border-color: var(--panel-line, #d8b56a);
}

/* ===== Description ===== */
.modal-description {
    margin-bottom: 1.5rem;
}

.modal-description p {
    color: #c5d5e5;
    line-height: 1.75;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.modal-description p:last-child {
    margin-bottom: 0;
}

/* ===== External Link: the one chunky button, and it leads =====
   Sits right under the goal — when a project is live somewhere,
   that's the first thing worth pressing. */
.modal-external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.1rem 0 1.5rem;
    font-family: var(--hud-font, sans-serif);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1206;
    background: var(--panel-line, #d8b56a);
    border: 2px solid #2a1c08;
    border-radius: 0;
    padding: 0.55rem 1.1rem;
    text-decoration: none;
    box-shadow: 3px 3px 0 var(--hud-shadow, #061220);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
}

.modal-external-link::after {
    content: '→';
}

.modal-external-link:hover,
.modal-external-link:focus-visible {
    background: var(--hud-gold, #ffd36a);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--hud-shadow, #061220);
}

.modal-external-link:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--hud-shadow, #061220);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .project-modal {
        width: 96%;
        max-height: 90vh;
    }

    .modal-header-image {
        height: 160px;
    }

    .modal-content-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .modal-objective {
        font-size: 0.9rem;
        padding: 0.75rem 1rem 0.75rem 1.2rem;
    }

    .project-modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .project-modal,
    .project-modal-close,
    .modal-tool-tag,
    .modal-external-link {
        transition: none;
    }
}
