/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #ffffff;
    color: #000000;
    font-family: 'Audiowide', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Page Cover Styles */
.page-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 1000;
    transition: all 2.0s ease-in-out;
    transform-origin: bottom right;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
    perspective: 1000px;
}

.page-cover.hover-peek {
    clip-path: polygon(2% 2%, 100% 0%, 100% 100%, 0% 100%);
    transition: all 2.0s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.page-cover.fully-open {
    transform: translate(calc(100vw - 50px), calc(100vh - 50px)) rotateY(180deg) rotateX(90deg) scale(0.1); /* tin can curl effect */
    transform-style: preserve-3d;
    transition: all 3.0s ease-in-out;
    border: 3px solid #ffffff;
    box-shadow: 
        inset 0 0 30px rgba(255, 255, 255, 0.1),
        5px 5px 15px rgba(0, 0, 0, 0.5),
        0 0 0 10px rgba(255, 255, 255, 0.1); /* outer glow for page effect */
}

/* Tear spot in top left */
.tear-spot {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 150px;
    height: 150px;
    background-color: #ffffff;
    cursor: pointer;
    z-index: 1001;
    transform: scaleX(-1) rotate(90deg); /* triangular folded corner effect */
    
    clip-path: polygon(
        0% 0%,
        30% 0%,
        0% 30%
    );
    
    box-shadow: 
        0 0 5px rgba(255, 255, 255, 0.8),
        inset -1px -1px 2px rgba(0, 0, 0, 0.2),
        1px 1px 3px rgba(0, 0, 0, 0.4);
    animation: subtle-glow 3s ease-in-out infinite alternate;
}

@keyframes subtle-glow {
    from {
        box-shadow: 
            0 0 5px rgba(255, 255, 255, 0.8),
            inset -2px -2px 5px rgba(0, 0, 0, 0.3);
    }
    to {
        box-shadow: 
            0 0 10px rgba(255, 255, 255, 1),
            inset -2px -2px 5px rgba(0, 0, 0, 0.3);
    }
}

/* Close trigger area */
.close-trigger {
    position: fixed;
    bottom: -5px;
    right: 3px;
    width: 80px;
    height: 80px;
    z-index: 1001;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.close-trigger.visible {
    opacity: 1;
}

.close-trigger::before {
    content: "×";
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    color: #000000;
    font-size: 30px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.close-trigger:hover::before {
    color: #000000;
}

/* Header styles */
header {
    flex: 0 0 auto;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main content styles */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-content,
.header-content,
.footer-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Override transitions for instant hiding when page closes */
body:not(.page-open) .main-content,
body:not(.page-open) .header-content,
body:not(.page-open) .footer-content {
    transition: opacity 0s, visibility 0s, background-color 0s, padding 0s, margin 0s, transform 0s;
}

.main-content h2 {
    color: #000000;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: none;
    animation: none;
}

/* Footer styles */
footer {
    flex: 0 0 auto;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Styles when page is open */
body.page-open {
    background-color: #ffffff;
    transition: background-color 0.1s ease 2.5s;
}

body.page-open header {
    opacity: 1;
    visibility: visible;
}

body.page-open main {
    opacity: 1;
    visibility: visible;
}

body.page-open footer {
    opacity: 1;
    visibility: visible;
}

body.page-open .header-content,
body.page-open .main-content,
body.page-open .footer-content {
    background-color: #ffffff;
    padding: 10px 30px;
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 0, 0, 0.1);
    display: inline-block;
    margin: 20px;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: all 0.1s ease 2.0s; /* content reveals at 2.0s */
}

body.page-open .main-content h2 {
    color: #000000;
    margin: 0;
}

/* Reset footer links to appear unvisited */
footer a:link,
footer a:visited {
    color: #000000;
    text-decoration: underline;
}

footer a:hover {
    text-decoration: underline;
}