/* CodePen Nav — scoped under .cpnav-wrapper */

.cpnav-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 24px auto 0;
}

.cpnav-wrapper #cpnav-close,
.cpnav-wrapper #cpnav-open {
    display: none;
}

/* ── Hamburger button ── */
.cpnav-wrapper .cpnav-btn {
    display: flex;
    width: 100px;
    height: 86px;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    position: relative;
    z-index: 1;
}

.cpnav-wrapper .cpnav-btn:hover {
    transform: scale(1.1);
}

.cpnav-wrapper .cpnav-btn:active {
    transform: scale(0.9);
}

.cpnav-wrapper #cpnav-open:checked + .cpnav-btn {
    transform: rotateZ(90deg);
    animation: cpnav-btn-hide 0.3s ease-in-out 0.8s forwards;
}

@keyframes cpnav-btn-hide {
    to { opacity: 0; pointer-events: none; width: 0; height: 0; overflow: hidden; margin: 0; padding: 0; }
}

.cpnav-wrapper .cpnav-btn > figure {
    width: 100%;
    height: 13%;
    margin: 0;
    transition: height 0.3s ease-in-out;
}

.cpnav-wrapper .cpnav-btn:hover > figure {
    height: 33%;
}

.cpnav-wrapper #cpnav-open:checked + .cpnav-btn > figure {
    height: 33.3%;
}

.cpnav-wrapper .cpnav-btn > figure:nth-child(2) { background: #cd8181; }
.cpnav-wrapper .cpnav-btn > figure:nth-child(3) { background: #c9702f; }
.cpnav-wrapper .cpnav-btn > figure:nth-child(4) { background: #873913; }

.cpnav-wrapper .cpnav-btn > label {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

/* ── Close button ── */
.cpnav-wrapper .cpnav-close-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 40px;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpnav-wrapper #cpnav-open:checked ~ .cpnav-close-btn {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 5.5s;
}

.cpnav-wrapper .cpnav-close-btn > svg {
    fill: white;
    width: 100%;
    height: auto;
}

.cpnav-wrapper .cpnav-close-btn > label {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

/* ── Nav overlay ── */
.cpnav-wrapper .cpnav-overlay {
    position: fixed;
    left: 0;
    width: 100%;
    height: 100vh;
    bottom: 100vh;
    background: linear-gradient(
        120deg,
        #cd8181, #c9702f, #873913
    );
    z-index: 1000;
    overflow: hidden;
}

.cpnav-wrapper #cpnav-open:checked ~ .cpnav-overlay {
    bottom: 0;
    transition: bottom 1s ease-in-out 3.5s;
    animation: cpnav-mask 1s ease-in-out 3.5s forwards;
}

@keyframes cpnav-mask {
    0%   { clip-path: polygon(0% 100%, 35% 100%, 65% 100%, 100% 100%); }
    100% { clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0); }
}

/* ── Nav list ── */
.cpnav-wrapper .cpnav-overlay > ul {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1001;
}

.cpnav-wrapper .cpnav-overlay > ul > li {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 33.33%;
    height: 100%;
    bottom: 100%;
    overflow: hidden;
    z-index: 1002;
    transition: none;
}

.cpnav-wrapper #cpnav-open:checked ~ .cpnav-overlay > ul > li {
    bottom: 0;
    transition: bottom 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.cpnav-wrapper .cpnav-overlay > ul > li:nth-child(1) {
    left: 0;
    background: #cd8181;
    transition-delay: 4s !important;
}
.cpnav-wrapper .cpnav-overlay > ul > li:nth-child(2) {
    left: 33.33%;
    background: #c9702f;
    transition-delay: 4.4s !important;
}
.cpnav-wrapper .cpnav-overlay > ul > li:nth-child(3) {
    left: 66.66%;
    background: #873913;
    transition-delay: 4.8s !important;
}

/* ── Nav links ── */
.cpnav-wrapper .cpnav-overlay > ul > li > a {
    position: relative;
    color: white;
    text-decoration: none;
    font-size: 20pt;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 30px;
    z-index: 1;
    overflow: hidden;
    box-shadow:
        rgba(0,0,0,0.4) 0px 2px 4px,
        rgba(0,0,0,0.3) 0px 7px 13px -3px,
        rgba(0,0,0,0.2) 0px -3px 0px inset;
    transition: color 0.3s ease-in-out;
}

.cpnav-wrapper .cpnav-overlay > ul > li > a:active {
    transform: scale(0.92);
}

/* Hover fill effect */
.cpnav-wrapper .cpnav-overlay > ul > li > a::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    height: 0;
    width: 100%;
    z-index: -1;
    background: #cd8181;
    transition: height 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.cpnav-wrapper .cpnav-overlay > ul > li::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    height: 0;
    width: 100%;
    background: black;
    transition: height 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.cpnav-wrapper .cpnav-overlay > ul > li > a:hover::after,
.cpnav-wrapper .cpnav-overlay > ul > li:hover::after {
    bottom: auto;
    top: 0;
    height: 100%;
}

.cpnav-wrapper .cpnav-overlay > ul > li > a:hover {
    color: white;
}

/* ── Responsive ── */
@media (max-width: 890px) {
    .cpnav-wrapper .cpnav-overlay > ul > li > a {
        font-size: 14pt;
        padding: 12px 18px;
    }
}

@media (max-width: 600px) {
    .cpnav-wrapper #cpnav-open:checked ~ .cpnav-overlay > ul > li {
        width: 100% !important;
        height: 33.33% !important;
        left: 0 !important;
        transition-delay: 0s !important;
    }
    .cpnav-wrapper #cpnav-open:checked ~ .cpnav-overlay > ul > li:nth-child(1) { bottom: 66.66% !important; }
    .cpnav-wrapper #cpnav-open:checked ~ .cpnav-overlay > ul > li:nth-child(2) { bottom: 33.33% !important; }
    .cpnav-wrapper #cpnav-open:checked ~ .cpnav-overlay > ul > li:nth-child(3) { bottom: 0% !important; }
}
