/* Global styles for body and layout refinements */
:root {
    color-scheme: light;
    --section-padding-y: clamp(3rem, 5vw, 5.5rem);
    --section-padding-x: clamp(1.5rem, 5vw, 3.5rem);
    --section-gap: clamp(2.5rem, 4.5vw, 4rem);
    --single-section-padding-y: clamp(1.5rem, 3vw, 2.5rem);
    --nav-height: 5.5rem;
    --footer-height: 5rem;
}

html,
body {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
    padding-bottom: var(--section-gap);
}

#main-content > [data-section] > section {
    padding-inline: var(--section-padding-x) !important;
    padding-block: var(--section-padding-y) !important;
}

#main-content > [data-section="hero"] > section {
    padding-inline: 0 !important;
    padding-block: 0 !important;
}

body:not([data-page="home"]) #main-content {
    gap: clamp(2rem, 4vw, 3rem);
    padding-bottom: clamp(1rem, 2.5vw, 1.5rem);
    min-height: calc(100vh - var(--nav-height) - var(--footer-height));
    justify-content: center;
}

body:not([data-page="home"]) #main-content > [data-section]:only-child {
    flex: 1;
    display: flex;
}

body:not([data-page="home"]) #main-content > [data-section]:only-child > section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: var(--single-section-padding-y) !important;
}

#footer-container {
    margin-top: auto;
}

.font-nav {
    font-family: "Fira Sans", sans-serif;
}

.font-cairo {
    font-family: "Cairo", sans-serif;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 9999px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.82);
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.nav-link:hover {
    color: #fcb044 !important;
    background-color: rgba(240, 192, 96, 0.12);
}

.nav-link.text-accent-light {
    background-color: #c08f37;
    color: #141e27 !important;
    box-shadow: 0 12px 24px rgba(192, 143, 55, 0.35);
}

/* Utility class to apply tinted header background after scroll */
.header-scrolled {
    background: rgba(20, 30, 39, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Mobile menu smoother transitions */
#mobile-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.28s ease;
}

#mobile-menu:not(.hidden) {
    /* allow the menu to grow and scroll if content is taller than the viewport */
    max-height: 90vh;
    opacity: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Project cards hover emphasis */
#projects .group:hover img {
    transform: scale(1.05);
}

#projects .group:hover span {
    color: #fcb044;
}

/* Section fallback styling */
.section-error {
    background: rgba(255, 255, 255, 0.9);
    border: 1px dashed rgba(20, 30, 39, 0.2);
    border-radius: 1rem;
    margin: 3rem auto;
    max-width: 60rem;
    padding: 3rem 2rem;
    text-align: center;
}

.section-error p {
    color: #141e27;
    font-size: 1.125rem;
    line-height: 1.8;
}
