/* Custom Properties for Colors (Easier to manage) */
:root {
    --color-dark: #5A827E;   /* Dark Teal */
    --color-medium: #84AE92; /* Medium Green */
    --color-light: #B9D4AA;  /* Light Green */
    --color-accent: #FAFFCA; /* Very Light Yellow / Cream */
    --text-color-dark: #333;
    --text-color-light: #FAFFCA;
}

/* General Body Styles */
body {
    font-family: 'Open Sans', 'Segoe UI', sans-serif; /* Modern, readable font */
    margin: 0;
    padding: 0;
    background-color: var(--color-accent); /* Lightest background */
    color: var(--text-color-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

/* Scrollbar Styling (Modern Touch) */
body::-webkit-scrollbar {
    width: 8px;
}
body::-webkit-scrollbar-track {
    background: var(--color-light);
}
body::-webkit-scrollbar-thumb {
    background: var(--color-medium);
    border-radius: 10px;
}
body::-webkit-scrollbar-thumb:hover {
    background: var(--color-dark);
}

/* Header Styles */
header {
    background-color: var(--color-dark);
    color: var(--text-color-light);
    padding: 2.5rem 2rem; /* Increased padding */
    text-align: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25); /* Stronger shadow */
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 100%); /* Subtle slanted bottom edge */
    animation: header-fade-in 1s ease-out forwards;
}

/* Header background gradient overlay for subtle depth */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(132, 174, 146, 0.3) 0%, rgba(90, 130, 126, 0.3) 100%);
    opacity: 0; /* Will animate in with JS */
    transition: opacity 0.5s ease;
}

header.loaded::before {
    opacity: 1;
}

header div {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem; /* Space between links */
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    position: relative; /* Ensure z-index for content above pseudo-element */
    z-index: 1;
}

header span {
    font-weight: 600; /* Semi-bold */
    font-size: 1.4em; /* Larger */
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: pop-in 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
    opacity: 0;
    transform: scale(0.8);
}

header h1 {
    margin: 0;
    font-size: 3.5em; /* Larger, more impactful */
    letter-spacing: 0.08em;
    font-weight: 700; /* Bold */
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
    animation: text-reveal 1.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

header pre {
    background-color: rgba(185, 212, 170, 0.8); /* B9D4AA with transparency */
    color: var(--text-color-dark);
    padding: 1rem 2rem;
    border-radius: 10px; /* Softer corners */
    font-family: 'Fira Code', 'Courier New', monospace; /* Monospaced font for code-like feel */
    white-space: pre-wrap;
    margin: 1.5rem auto;
    max-width: 700px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.15); /* Deeper inset shadow */
    position: relative;
    z-index: 1;
    animation: fade-in-left 1.2s ease-out forwards;
    opacity: 0;
    transform: translateX(-50px);
}

/* Navigation Links */
.a1 {
    color: var(--text-color-light);
    text-decoration: none;
    font-weight: 600;
    padding: 0.7rem 1.2rem;
    border-radius: 30px; /* Pill shape for modern look */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: 2px solid transparent; /* For hover effect */
}

.a1:hover {
    background-color: var(--color-medium); /* Lighter green on hover */
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* More pronounced shadow on hover */
    border-color: var(--color-light); /* Subtle border on hover */
}

/* Main Content Styles */
main {
    flex-grow: 1;
    padding: 3rem 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem; /* Consistent spacing */
    flex-wrap: wrap;
}

article {
    background-color: var(--color-light);
    padding: 2.5rem; /* Increased padding */
    border-radius: 15px; /* More rounded */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); /* Deeper shadow */
    max-width: 800px;
    text-align: center;
    position: relative;
    overflow: hidden; /* For pseudo-elements */
    animation: scale-in-fade 1.5s ease-out forwards;
    opacity: 0;
    transform: scale(0.9);
}

/* Subtle background pattern/texture for article */
article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--color-medium) 1px, transparent 1px);
    background-size: 15px 15px;
    opacity: 0.1;
    z-index: 0;
}

article p:first-of-type {
    font-size: 2.2em; /* Larger heading */
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

article p:last-of-type {
    font-size: 1.15em;
    color: var(--text-color-dark);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

/* Buttons */
button {
    background-color: var(--color-medium);
    color: var(--text-color-light);
    border: none;
    padding: 1rem 2rem;
    margin: 0.8rem; /* Consistent margin */
    border-radius: 30px; /* Pill shape */
    cursor: pointer;
    font-size: 1.15em;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15); /* Deeper shadow */
    position: relative;
    overflow: hidden;
    z-index: 1;
    animation: button-pop 0.6s ease-out forwards;
    animation-delay: var(--button-delay, 0s); /* For staggered animation */
    opacity: 0;
    transform: translateY(20px);
}

button a {
    color: var(--text-color-light);
    text-decoration: none;
    display: block; /* Make the whole button clickable area */
}

button:hover {
    background-color: var(--color-dark); /* Darker green on hover */
    transform: translateY(-5px) scale(1.03); /* More pronounced lift */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Button hover ripple effect */
button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
    z-index: -1;
}

button:hover::after {
    transform: translate(-50%, -50%) scale(15);
    opacity: 1;
}


/* Footer Styles */
footer {
    background-color: var(--color-dark);
    color: var(--text-color-light);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.25);
    font-size: 0.9em;
    clip-path: polygon(0 10%, 100% 0, 100% 100%, 0% 100%); /* Subtle slanted top edge */
    animation: footer-fade-in 1s ease-out forwards;
}


/* Keyframe Animations */

@keyframes header-fade-in {
    0% { opacity: 0; transform: translateY(-50px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes text-reveal {
    0% { opacity: 0; transform: translateY(20px); letter-spacing: 0.2em; }
    100% { opacity: 1; transform: translateY(0); letter-spacing: 0.08em; }
}

@keyframes pop-in {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fade-in-left {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes scale-in-fade {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes button-pop {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes footer-fade-in {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}


/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 2rem 1.5rem;
    }

    header div {
        flex-direction: column;
        gap: 0.8rem;
    }

    header h1 {
        font-size: 2.5em;
    }

    header pre {
        padding: 0.8rem 1.2rem;
        font-size: 0.9em;
    }

    main {
        padding: 2rem 1rem;
    }

    article {
        padding: 1.5rem;
        border-radius: 10px;
    }

    article p:first-of-type {
        font-size: 1.8em;
    }

    button {
        padding: 0.8rem 1.5rem;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    header {
        clip-path: polygon(0 0, 100% 0, 100% 95%, 0% 100%);
    }
    header h1 {
        font-size: 2em;
    }
    header pre {
        font-size: 0.75em;
    }
    header span {
        font-size: 1.1em;
    }
    .a1 {
        padding: 0.6rem 1rem;
        font-size: 0.9em;
    }
    button {
        width: calc(100% - 1.6rem); /* Account for margin */
        margin-left: 0.8rem;
        margin-right: 0.8rem;
    }
    footer {
        clip-path: polygon(0 5%, 100% 0, 100% 100%, 0% 100%);
    }
}