*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{

    font-family:'Be Vietnam Pro', sans-serif;
    
}

h1{
    font-family: 'Lost Vietnam', serif;
    font-size:8rem;
}

a {
    color:#c75739
}

/*section 1*/
.hero{

    position:relative;

    height:100vh;
}

.hero img{

    width:100%;
    height:100%;

    object-fit:cover;
}

.hero-overlay{

    position:absolute;

    inset:0;

    display:flex;

    flex-direction:column;

    justify-content:center;
    align-items:center;

    color:white;

    text-align:center;

    text-shadow: 2px 2px 4px #000000;
}

.hero-overlay p {
    font-size: 1.5rem;
}

/*section 2*/

.scratch-section{

    position:relative;

    width:100%;

    min-height:97vh;

    display:flex;

    justify-content:center;

    align-items:center;

    overflow:hidden;
}

.scratch-bg{

    position:absolute;

    inset:0;

    width:100%;
    height:100%;

    object-fit:cover;

    object-position:center center;
}

.photo-stack{

    position:relative;

    width:min(900px,100vw);

    aspect-ratio:16/10;

    margin:auto;
}

.stack-photo{

    position:absolute;

    width:230px;

    height:auto;

    cursor:pointer;

    transition:
    transform .3s,
    box-shadow .3s;

    box-shadow:
    0 8px 18px rgba(0,0,0,.18);
}

.stack-photo:hover{

    transform:

    translateY(-8px)

    scale(1.03);
}

.stack-photo:nth-child(1){
    left:300px;
    top:200px;
}

.stack-photo:nth-child(2){
    left:620px;
    top:170px;
}

.stack-photo:nth-child(3){
    left:50px;
    top:120px;
}

.stack-photo:nth-child(4){
    left:450px;
    top:90px;
}

.stack-photo:nth-child(5){
    left:350px;
    top:370px;
}

.stack-photo:nth-child(6){
    left:270px;
    top:10px;
}

.stack-photo:nth-child(7){
    left:470px;
    top:260px;
}

.stack-photo:nth-child(8){
    left:520px;
    top:420px;
}

.stack-photo:nth-child(9){
    left:120px;
    top:270px;
}

.stack-photo:nth-child(10){
    left:650px;
    top:40px;
}

.stack-photo:nth-child(11){
    left:1px;
    top:70px;
}

.detail-panel{

    position:absolute;

    inset:0;

    display:flex;

    justify-content:center;
    align-items:center;

    gap:60px;

    overflow-y:auto;

    background:white;

    opacity:0;

    visibility:hidden;

    transition:.35s;

    z-index:100;
}

.detail-panel.show{

    opacity:1;

    visibility:visible;
}

.detail-gallery{

    width:520px;

    display:grid;

    grid-template-columns:

    repeat(2,1fr);

    gap:15px;
}

.detail-gallery img{

    width:100%;

    display:block;
}

.detail-text{

    width:420px;

    font-family:"Be Vietnam Pro", sans-serif;

    line-height:1.8;
}

.detail-text h2{

    font-family: 'Be Vietnam Pro', sans-serif;

    font-size:calc(2rem * var(--font-scale));

    margin-bottom:25px;
}

.detail-text p{

    line-height:1.7;

    margin-bottom:1.5rem;

    font-size:calc(1.1rem * var(--font-scale));

}

.hidden{

    display:none;
}

/*section 3*/
.credits{

    min-height:auto;

    display:flex;

    justify-content:center;
    align-items:center;

    padding:80px 40px;
}
.message{

    max-width:900px;

    width:100%;

    padding:60px;

    background:white;

    border:none;

    border-radius:20px;

    box-shadow:
    0 5px 20px rgba(0,0,0,.08);

    font-size:1.4rem
}

@media(max-width:1024px){

    .photo-stack{

        transform:scale(.8);
    }

    .detail-panel{

        gap:30px;
    }

    .detail-gallery{

        width:320px;
    }

    .detail-text{

        width:320px;
    }

}

/* MOBILE (safety net) — layout này chủ đích không tối ưu cho mobile (xem
   ghi chú trong hero), phần dưới chỉ đảm bảo không có ảnh nào bị cắt mất/
   không bấm được do toạ độ left/top cố định (tới 650px) tràn ra ngoài
   overflow:hidden của .scratch-section. Không phải một bản thiết kế mobile
   đầy đủ. */

@media(max-width:600px){

    .photo-stack{

        transform:scale(.42);
    }

    .detail-panel{

        flex-direction:column;

        justify-content:flex-start;

        gap:20px;

        padding:28px 20px;

        overflow-y:auto;
    }

    .detail-gallery{

        width:100%;
        max-width:320px;
    }

    .detail-text{

        width:100%;
        max-width:420px;
    }

    .detail-text h2{

        font-size:calc(1.5rem * var(--font-scale));

        margin-bottom:16px;
    }

    .detail-text p{

        font-size:calc(1rem * var(--font-scale));

        margin-bottom:1rem;
    }

    .toolbox{
        top:auto;
        bottom:20px;
        left:20px;
    }

}

/* Điện thoại xoay ngang: đủ rộng để rơi vào breakpoint tablet ở trên (layout
   ảnh + chữ nằm cạnh nhau, cỡ chữ mặc định 2rem/1.1rem), nhưng chiều cao lại
   rất thấp -> chữ dài (đặc biệt story 7 - bài thơ) không đủ chỗ. Giảm riêng
   cỡ chữ + khoảng cách cho trường hợp này. */
@media (orientation:landscape) and (max-height:500px){

    .detail-panel{
        gap:24px;
    }

    .detail-gallery{
        width:220px;
    }

    .detail-text{
        width:280px;
    }

    .detail-text h2{
        font-size:calc(1.3rem * var(--font-scale));
        margin-bottom:12px;
    }

    .detail-text p{
        font-size:calc(.9rem * var(--font-scale));
        line-height:1.5;
        margin-bottom:.8rem;
    }

}

/* ---------- 1 image ---------- */

.gallery-1{

    display:block;
}

.gallery-1 img{

    width:100%;

    display:block;
}

/* ---------- 2–4 images ---------- */

.gallery-2,
.gallery-3,
.gallery-4{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:15px;
}

/*nav*/
#navbar{

    position:absolute;

    top:5px;
    left:0;

    width:100%;

    display:flex;

    justify-content:space-around;
    align-items:center;

    z-index:1000;
}

#navbar a{

    font-family:'Lost Vietnam';

    font-size:2rem;

    color:#C75739;

    text-decoration:none;
}

#navbar a:hover{

    text-decoration:underline;
}

#nav-middle{

    display:flex;

    justify-content:center;
    align-items:center;
}

#nav-logo{

    width:100px;

    height:auto;

    display:block;
}

#nav-home{

    display:none;
}

#navbar.scrolled{

    position:fixed;

    top:0;

    background:#C75739;

    padding:7px 0;
}

#navbar.scrolled a{

    color:white;
}

#navbar.scrolled #nav-logo{

    display:none;
}

#navbar.scrolled #nav-home{

    display:block;
}

/*accessibility*/
.toolbox{

    position:fixed;

    top:120px;
    left:30px;

    z-index:9999;

    display:flex;

    gap:12px;
}

.toolbox button{

    width:48px;
    height:48px;

    border:none;

    background:none;

    padding:0;

    cursor:pointer;
}

.toolbox img{

    width:100%;
    height:100%;

    display:block;
}

/*resize*/

:root{

    --font-scale:1;
}

body.font-big{ --font-scale:1.25; }
body.font-small{ --font-scale:.8; }