/* ---------- Base ---------- */
body {
    margin: 0;
    background-color: #2c2c2c; /* lighter background */
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    text-align: center;
}

/* ---------- Menu Button ---------- */
.menu-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    background: #333;
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.menu-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 12px rgba(255,255,255,0.6);
}

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #333;
    overflow: hidden;
    height: 0;
    transition: height 0.4s ease, padding 0.4s ease;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 10;
}
.navbar.open {
    height: auto;
    padding: 12px 0;
    border-bottom: 3px solid white;
}
.texture-btn {
    width: 60px;
    height: 40px;
    margin: 6px;
    border: 2px solid white;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: all 0.35s ease;
}
.texture-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255,255,255,0.6);
}

/* ---------- Mondriaan Container ---------- */
#mondrian-container {
    position: relative;
    width: 700px;
    height: 700px;
    margin: 140px auto 60px auto;
    background: black;
    box-sizing: border-box;
    border: 6px solid white; /* container border */
    overflow: hidden;
}

/* ---------- Blocks ---------- */
.block {
    position: absolute;
    box-sizing: border-box;
    border: 4px solid black;
    outline: 4px solid white;
    transition: transform 0.45s ease, box-shadow 0.45s ease;
    transform-origin: center;
}

/* --- Inner semi-transparent borders inside blocks --- */
.block::before, .block::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 2px solid rgba(255,255,255,0.3);
    pointer-events: none;
    box-sizing: border-box;
}
.block::after {
    border-color: rgba(0,0,0,0.3);
}

/* --- Hover effect: subtle scale + dynamic glow --- */
.block:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 28px rgba(255,255,255,0.35);
    z-index: 5;
}

/* --- Layout (perfect fit, no gaps) --- */
.big-rect {
    top: 0;
    left: 0;
    width: 50%;
    height: 45%;
}

.tall-rect {
    top: 0;
    right: 0;
    width: 25%;
    height: 70%;
}

.square1 {
    top: 0;
    left: 50%;
    width: 25%;
    height: 45%;
}

.small1 {
    top: 45%;
    left: 0;
    width: 25%;
    height: 25%;
}

.medium1 {
    top: 45%;
    left: 25%;
    width: 25%;
    height: 25%;
}

.medium2 {
    top: 45%;
    left: 50%;
    width: 25%;
    height: 25%;
}

.wide1 {
    top: 70%;
    left: 0;
    width: 75%;
    height: 30%;
}

.short1 {
    top: 70%;
    right: 0;
    width: 25%;
    height: 30%;
}

/* ---------- Solid Mondriaan Colors ---------- */
.red    { background: #d40920; }
.blue   { background: #004592; }
.yellow { background: #f7d842; }
.white  { background: #f2f2f2; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    #mondrian-container {
        width: 90vw;
        height: 90vw;
    }
    .block {
        border-width: 3px;
        outline-width: 3px;
    }
    .navbar button, .menu-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}
