* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Navigation */
nav {
    background: #8f0002;
    padding: 31px 80px 31px 99px;
    display: flex; /* Add this */
    align-items: center; /* Add this */
    justify-content: space-between; /* Add this */
    z-index: 100;
    position: sticky; /* Add this to establish stacking context */
}

nav h1 {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(20px, 2.5vw, 30px); /* Responsive between 20px-30px */
    font-weight: 600;
    line-height: 1.5;
    color: #ece3d8;
    margin-bottom: 0;
}

nav ul {
    display: flex; /* Change from inline-block to flex */
    list-style: none;
    gap: 20px; /* Add spacing between links */
    margin: 0; /* Remove default margin */
}

nav a {
    text-decoration: none;
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(14px, 1.8vw, 20px); /* Responsive between 14px-20px */
    font-weight: 200;
    line-height: 1.5;
    color: #ece3d8;
    white-space: nowrap; /* Prevents text wrapping */
}

nav a:hover {
    color: #ffffff;
}

.nav-button {
    background-color: #feaaa7 !important;
    color: #d8333b !important;
    padding: clamp(8px, 1vw, 10px) clamp(15px, 2vw, 20px); /* Responsive padding */
    border-radius: 5px;
    border: 2px solid #feaaa7;
    transition: all 0.3s ease;
    font-weight: 400;
    font-size: clamp(14px, 1.6vw, 18px); /* Responsive button text */
}

.nav-button:hover {
    background-color: transparent !important;
    color: #ece3d8 !important;
    border: 2px solid #ece3d8;
}

/* Framed sections */
.framed-section {
    border: 3px solid #8f0002;
    border-radius: 10px;
    margin: 2rem auto;
    padding: 2rem;
    max-width: 1200px;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Section styling */
section {
    margin-bottom: 2rem;
}

section h1 {
    color: #8f0002;
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(60px, 25vw, 325px); /* Responsive from 60px to 325px */
    font-weight: 800;
    line-height: 1;
    letter-spacing: clamp(-1px, -0.25vw, -3.25px);
    text-align: center;
    margin-bottom: -2rem;
    margin-top: 8rem;
    position: relative;
    z-index: 10; /* Main header on top */
}

/* Background headers - all need the same styling as h1 */
.header-bg-1,
.header-bg-2,
.header-bg-3,
.header-bg-4,
.header-bg-5,
.header-bg-6,
.header-bg-7,
.header-bg-8,
.header-bg-9,
.header-bg-10 {
    position: absolute; /* Changed from fixed to absolute */
    color: #feaaa7;
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(60px, 25vw, 325px); /* Responsive from 60px to 325px */
    font-weight: 800;
    line-height: 1;
    letter-spacing: clamp(-1px, -0.25vw, -3.25px);
    text-align: center;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none; /* Prevents interference with clicking */
    width: 100%; /* Add this */
    left: 0; /* Add this */
    right: 0; /* Add this */
    white-space: nowrap; /* Prevents text wrapping */
}

/* Cascade  one shifts down */
.header-bg-1 {
    top: -254px; 
}

.header-bg-2 {
    top: -168px; 
}

.header-bg-3 {
    top: -82px; 
}

.header-bg-4 {
    top: 90px; 
}

.header-bg-5 {
    top: 176px; 
}

.header-bg-6 {
    top: 262px; 
}

.header-bg-7 {
    top: 348px; 
}

.header-bg-8 {
    top: 434px; 
}

.header-bg-9 {
    top: 520px; 
}

.header-bg-10 {
    top: 606px; 
}

/* Make sure the section container can handle absolute positioning */
#home {
    position: relative;
}

section h2 {
    color: #d8333b;
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(30px, 10vw, 125px); /* Responsive from 30px to 125px */
    font-weight: 500;
    line-height: 1;
    letter-spacing: clamp(3px, 1.2vw, 15px);
    text-align: center;
    margin-bottom: .5rem;
    margin-top: 2rem;
    position: relative; /*maybe not needed*/
    z-index: 1; /* Ensure h2 is above background headers */
}

section p {
    color: #8e0001;
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(16px, 1.8vw, 22px); /* Responsive from 16px to 22px */
    font-weight: 200;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 10rem;
    position: relative;
    z-index: 1; /* Ensure p is above background headers */
}

section p.last {
    margin-bottom: 10rem; /* Extra space before projects */
}

#projects {
    background-color: #8f0002;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 50px 50px 0 0; /* Add rounded top corners */
    padding: 10rem 2rem; /* Add some padding for better spacing */
    margin-top: 2rem; /* Add margin to separate from content above */
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

/* Projects container */
.projects-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

/* Main project list styling (center) with links */
.project-list-center p {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(20px, 12vw, 135px);
    font-weight: 900;
    line-height: .95;
    letter-spacing: clamp(-1px, -0.24vw, -2.98px);
    text-shadow: #ece3d8 6px 6px;
    margin-bottom: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.project-list-center p a {
    color: #feaaa7; /* Your accent color */
    text-decoration: none; /* Remove underline */
    display: block;
    transition: all 0.3s ease;
}

.project-list-center p a:hover {
    color: #d8333b; /* Darker color on hover */
    text-shadow: #feaaa7 6px 6px;
    transform: scale(1.05);
}

.project-list-center p a:visited {
    color: #feaaa7; /* Keep same color for visited links */
}

.project-list-center p a:focus {
    color: #feaaa7; /* Keep same color when focused */
    outline: none;
}

.project-list-center p:hover {
    transform: scale(1.05);
    margin-top: 50px;
    margin-bottom: 50px;
}

.project-list-center p:hover a {
    color: #d8333b;
    text-shadow: #feaaa7 6px 6px;
}

/* Side project list styling - 80% opacity, no hover */
.project-list-left p,
.project-list-right p {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(20px, 12vw, 135px);
    font-weight: 900;
    line-height: .95;
    letter-spacing: clamp(-1px, -0.24vw, -2.98px);
    text-shadow: #ece3d8 6px 6px;
    margin-bottom: 0.75rem;
    color: #feaaa7;
    text-align: center;
    white-space: nowrap;
    opacity: 0.8;
    pointer-events: none;
}

/* Ensure center list is on top */
.project-list-center {
    position: relative;
    z-index: 10;
}

/* Footer styling */
footer {
    background-color: #8f0002;
    padding: 31px 80px 31px 99px;
    display: flex; /* Add this line */
    align-items: center;
    text-align: left;
    justify-content: space-between;
}

.footer-left h1 {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(20px, 2.5vw, 30px); /* Responsive from 20px to 30px */
    font-weight: 400;
    line-height: 1.5;
    color: #ece3d8;

    margin: 0;
}

.footer-left h2 {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(16px, 2vw, 25px); /* Responsive from 16px to 25px */
    font-weight: 200;
    line-height: 1.5;
    color: #ece3d8;
    margin: 0.5rem 0;
}
.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.footer-right p {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(16px, 2vw, 25px); /* Responsive from 16px to 25px */
    font-weight: 200;
    line-height: 1.5;
    color: #ece3d8;
    margin: 0.5rem 0;
}

.footer-right a {
    color: #ece3d8; /* Same as other footer text */
    text-decoration: none; /* Remove blue underline */
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(16px, 2vw, 25px);
    font-weight: 200;
    transition: all 0.3s ease;
}

.footer-right a:hover {
    color: #feaaa7; /* Your accent color on hover */
    text-decoration: none;
}


/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #8f0002;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: #ece3d8;
    max-width: 400px;
    width: 90%;
}

.loading-name p {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    margin: 0;
    line-height: 0.9;
    color: #ece3d8;
    animation: fadeInUp 1s ease 0.5s both;
}

.loading-subtitle {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 200;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin: 2rem 0;
    color: #ece3d8;
    animation: fadeInUp 1s ease 1s both;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background-color: rgba(236, 227, 216, 0.3);
    border-radius: 2px;
    margin: 2rem auto;
    overflow: hidden;
    animation: fadeInUp 1s ease 1.5s both;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background-color: #ece3d8;
    border-radius: 2px;
    transition: width 2s ease;
}

.loading-text {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    margin: 1rem 0;
    color: #ece3d8;
    animation: pulse 2s infinite;
}

.loading-button {
    background: transparent;
    border: 2px solid #ece3d8;
    color: #ece3d8;
    padding: 10px 20px;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 25px;
    margin-top: 1rem;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 2s both;
}

.loading-button:hover {
    background-color: #ece3d8;
    color: #8f0002;
    transform: translateY(-2px);
}

/* Main content hidden state */
.main-content.hidden {
    display: none !important;
}

.main-content {
    display: block;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease 0.3s;
}

/* Fade-out transition */
.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* Loading Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .loading-bar {
        width: 200px;
    }
    
    .loading-name p {
        font-size: 2.5rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
        letter-spacing: 3px;
    }
}