:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #333333;
    --font-main: 'Inter', sans-serif;
    /* Assuming Inter or similar sans-serif */
    --gap-size: 2px;
    /* Tight grid */
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* Header */
header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    /* Let clicks pass through except on interactive elements */
}

header>* {
    pointer-events: auto;
}

.logo {
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -1px;
    text-transform: uppercase;
    text-decoration: none;
    color: inherit;
}

/* Grid Layout */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile: was 1, now 2 */
    gap: var(--gap-size);
    padding: var(--gap-size);
    width: 100%;
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Tablet: was 2, now 4 */
        grid-auto-flow: dense;
        /* Fill gaps better */
    }

    .project-card.wide {
        grid-column: span 2;
    }

    .project-card.tall {
        grid-row: span 2;
    }

    .project-card.large {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (min-width: 1200px) {
    .project-grid {
        grid-template-columns: repeat(6, 1fr);
        /* Desktop: was 3, now 6 */
    }

    /* Adjust spans for 3-column layout if needed, e.g. wide spans 2 */
}


/* Card Styles */
.project-card {
    position: relative;
    background-color: #111;
    overflow: hidden;
    /* Ensure content stays within border radius if any */
    cursor: pointer;
    min-height: 100px;
    /* Reduced from 200px for smaller cards */
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover img {
    transform: scale(1.05);
    /* Slight zoom on hover */
}

/* Info Overlay */
.project-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Darker overlay to read text */
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Space between details and score */
    padding: 1rem;
    /* Reduced padding for smaller cards */
    text-align: left;
}

.project-card:hover .project-info {
    opacity: 1;
}

.project-details {
    z-index: 2;
    /* Ensure on top of score if they overlap */
}

.project-title {
    font-size: 1.2rem;
    /* Reduced from 2rem */
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.25rem;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.project-meta {
    font-size: 0.7rem;
    /* Reduced from 0.9rem */
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
}

.project-card:hover .project-title,
.project-card:hover .project-meta {
    transform: translateY(0);
}

/* Giant Score Overlay */
.score-overlay {
    position: absolute;
    bottom: 0;
    right: 1rem;
    transform: none;
    font-family: 'Special Elite', cursive;
    font-size: 4rem;
    /* Smaller to fit two lines */
    font-weight: 400;
    color: #fff;
    opacity: 1;
    pointer-events: none;
    z-index: 1;
    /* white-space: nowrap; Removed to allow break */
    /* Double-struck effect using shadows */
    text-shadow: 3px 0 0 rgba(255, 255, 255, 0.7), -1px 0 1px rgba(0, 0, 0, 0.5);
    line-height: 0.9;
    text-align: right;
}

/* Adjust score size for smaller grids if needed */
@media (min-width: 768px) {
    .score-overlay {
        font-size: 3rem;
        /* Balanced for grid */
    }
}

/* Math Formula in Modal */
.math-formula {
    margin-top: 1rem;
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-size: 1.1rem;
    color: #ccc;
    letter-spacing: 0.5px;
}

.math-formula sub {
    font-size: 0.7em;
    font-style: normal;
    /* Subscripts often upright, or keep italic depending on preference */
    color: #888;
}

/* Slide-up Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.83, 0, 0.17, 1);
    /* Ease in-out expo-ish */
    display: flex;
    flex-direction: column;
}

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

.modal-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem 4rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.modal-info h1 {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.modal-info p {
    font-size: 1rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.modal-icons {
    color: white;
    cursor: pointer;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 1rem;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    width: 100%;
    height: 100%;
}

.video-wrapper {
    flex: 1;
    height: 100%;
    max-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 2rem;
}

.video-wrapper video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.nav-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    transition: color 0.3s;
}

.nav-btn:hover {
    color: white;
}

/* Admin Styles */
.admin-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2rem;
    background: #111;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #888;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: #000;
    border: 1px solid #333;
    color: white;
    border-radius: 4px;
}

.btn-submit {
    padding: 1rem 2rem;
    background: white;
    color: black;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #ccc;
}