:root{
    --outer:#3f4656;
    --card:#ffffff;
    --text:#111;
    --muted:#666;
    --line:rgba(0,0,0,.08);
    --gap:10px;
    --radius:4px;
    --shadow:0 18px 60px rgba(0,0,0,.22);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
    margin:0;
    font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
    background:var(--outer);
    color:var(--text);
}

.page{min-height:100%; padding:26px;}
.shell{
    background:var(--card);
    border-radius:10px;
    overflow:hidden;
    max-width:1180px;
    margin:0 auto;
    box-shadow:var(--shadow);
}

/* Header */
.header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:22px 26px;
    border-bottom:1px solid var(--line);
}

.brand__name{
    font-weight:800;
    letter-spacing:.18em;
    font-size:18px;
    line-height:1.1;
}
.brand__sub{
    margin-top:6px;
    font-size:11px;
    letter-spacing:.55em;
    color:var(--muted);
}

/* Nav */
.nav{display:flex; align-items:center; gap:18px;}
.nav__link{
    text-decoration:none;
    color:var(--text);
    font-size:12px;
    letter-spacing:.12em;
    padding:8px 2px;
    border-bottom:2px solid transparent;
}
.nav__link.is-active{border-bottom-color:var(--text);}
.nav__icon{
    text-decoration:none;
    color:var(--text);
    font-weight:700;
    font-size:16px;
    padding:6px 8px;
    border:1px solid var(--line);
    border-radius:10px;
}

.burger{
    display:none;
    width:44px;height:44px;
    border:0;background:transparent;
    cursor:pointer;
    padding:10px;
    gap:6px;
}
.burger span{display:block;height:2px;background:#111;border-radius:2px;}

.main{ padding:18px; }

/* Grid: desktop 4 columns */
.grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:var(--gap);
    align-items:stretch;
    grid-auto-rows:180px;
    grid-auto-flow: dense; /* ✅ add this */
}

.tile{
    margin:0;
    overflow:hidden;
    border-radius:var(--radius);
    background:#eee;
    cursor: zoom-in;
    position:relative;
}

.tile img{
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
    transform:scale(1.01);
    transition:transform 250ms ease, filter 250ms ease;
}

.tile:hover img{
    transform:scale(1.05);
    filter:contrast(1.02);
}

/* Span helpers */
.span-2c{ grid-column: span 2; }
.span-2r{ grid-row: span 2; }

/* Sections */
.section{
    margin-top:26px;
    padding:18px 8px 4px;
    border-top:1px solid var(--line);
}
.section h2{
    margin:0 0 8px;
    font-size:12px;
    letter-spacing:.18em;
    text-transform:uppercase;
}
.section p{ margin:0; color:var(--muted); line-height:1.6; }
.section a{ color:var(--text); }

/* Mobile nav hidden by default */
.nav--mobile{ display:none; }

/* Mobile */
@media (max-width: 820px){
    .nav--desktop{ display:none; }
    .burger{ display:grid; }
    .main{ padding:14px; }

    .grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        grid-auto-rows:150px;
    }

    /* keep mobile tidy */
    .span-2c{ grid-column: span 1; }
    .span-2r{ grid-row: span 1; }

    .nav--mobile{
        display:none;
        padding:10px 18px 16px;
        border-bottom:1px solid var(--line);
        gap:8px;
        flex-direction:column;
    }
    .nav--mobile.open{ display:flex; }
    .nav__icons{ display:flex; gap:10px; padding-top:8px; }
}

/* -------------------------
 *   LIGHTBOX (Fixed X)
 * ------------------------- */
.lightbox{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.92);
    display:none;
    z-index:999;
}

.lightbox.open{ display:block; }

/* stage behind controls */
.lb-stage{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:28px;
    z-index:1;
}

.lb-img{
    max-width:min(1100px, 96vw);
    max-height:86vh;
    object-fit:contain;
    border-radius:10px;
    box-shadow:0 20px 80px rgba(0,0,0,.4);
}

.lb-caption{
    position:fixed;
    left:0;
    right:0;
    bottom:18px;
    text-align:center;
    color:rgba(255,255,255,.85);
    font-size:13px;
    letter-spacing:.06em;
    padding:0 18px;
    user-select:none;
    z-index:5;
}

/* Buttons always clickable */
.lb-close{
    position:fixed;
    top:14px;
    right:14px;
    width:48px;
    height:48px;
    border-radius:999px;
    border:0;
    background:rgba(255,255,255,.12);
    color:#fff;
    font-size:30px;
    cursor:pointer;
    z-index:6;
    pointer-events:auto;
}

.lb-prev, .lb-next{
    position:fixed;
    top:50%;
    transform:translateY(-50%);
    width:54px;
    height:54px;
    border-radius:999px;
    border:0;
    background:rgba(255,255,255,.12);
    color:#fff;
    font-size:34px;
    cursor:pointer;
    z-index:6;
    pointer-events:auto;
}

.lb-prev{ left:16px; }
.lb-next{ right:16px; }

@media (max-width: 820px){
    .lb-prev, .lb-next{
        width:46px;
        height:46px;
        font-size:30px;
    }
    .lb-stage{ padding:18px; }
}

/*Site Footer*/
.site-footer{
    border-top:1px solid rgba(0,0,0,.08);
    margin-top:40px;
    padding:24px 18px 30px;
}

.footer-inner{
    max-width:1180px;
    margin:0 auto;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    text-align:center;
}

.site-footer p{
    margin:0;
    font-size:12px;
    letter-spacing:.08em;
    color:#666;
}

.footer-links{
    display:flex;
    gap:10px;
    align-items:center;
    font-size:12px;
}

.footer-links a{
    text-decoration:none;
    color:#111;
    letter-spacing:.12em;
}

.footer-links a:hover{
    text-decoration:underline;
}

/* Mobile spacing */
@media (max-width:820px){
    .site-footer{
        padding:20px 14px 26px;
    }
}

/* outside background */
body{
    margin:0;
    background:#402F28; /* dark */
    font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* spacing around the white card */
.page{
    min-height:100vh;
    padding:26px;         /* space around the card */
}

/* white “card” */
.shell{
    max-width:1180px;
    margin:0 auto;
    background:#F0EEED;
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 18px 60px rgba(0,0,0,.22);
}
