:root {
    /* Light Mode variables */
    --pill-border-color: #222;
    --pill-text-color: #222;
    --pill-hover-bg: rgba(0, 0, 0, 0.05);
    --pill-hover-text-color: #222;
    --pill-active-bg: #222;
    --pill-active-text-color: #fff;
    --focus-outline-color: #06f; /* Accent color */
    --background-color-light: #fff;
    --text-color-light: #000;
    --footer-line-color: #ccc;

    /* General variables */
    --title-font-weight: 630;
    --tagline-font-weight: 400;
    --menu-font-weight: 500;
    --footer-font-weight: 400;
    --title-font-size: 2rem; /* Adjust for desktop */
    --tagline-font-size: 1rem; /* Adjust for desktop */
    --menu-font-size: 1rem; /* Menu font size */
    --footer-font-size: 0.875rem; /* Footer font size */
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Mode variables */
        --favicon-dark: url("/landin_logo_v2_dark.ico");
        --pill-border-color: #ddd;
        --pill-text-color: #ddd;
        --pill-hover-bg: rgba(255, 255, 255, 0.1);
        --pill-hover-text-color: #fff;
        --pill-active-bg: #ddd;
        --pill-active-text-color: #000;
        --focus-outline-color: #ff6; /* Accent color */
        --background-color-light: #000; /* Background for dark mode */
        --text-color-light: #fff;    /* Text color for dark mode */
        --footer-line-color: #444;  /* Footer line for dark mode */
    }
}

body {
    margin: 0;
    font-family: "Nunito Sans", serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--background-color-light);
    color: var(--text-color-light);
    opacity: 1;
    transition: opacity 0.3s ease-in-out; /* Smooth transition for page loads */
}

body.is-loading {
    opacity: 0;
}

header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    padding-left: 2rem; /* Align text with logo */
}

.logo {
    width: 100px;
    height: auto;
    object-fit: contain;
}

@media (prefers-color-scheme: dark) {
    .logo {
        content: url("/landin_logo_v2_dark.webp");
    }
}

.title-link {
    text-decoration: none;
    color: inherit;
}

.title {
    font-weight: var(--title-font-weight);
    font-size: var(--title-font-size);
    margin: 0.3rem 0 0.2rem; /* Reduce spacing with logo */
}

.tagline-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.tagline {
    font-weight: var(--tagline-font-weight);
    font-size: var(--tagline-font-size);
    margin: 0;
    padding-bottom: 0.5rem; /* Adjusted for mobile */
}

.nav-link {
    display: inline-block;
    padding: 0.5em 1em;
    border: 2px solid var(--pill-border-color);
    border-radius: 9999px; /* Pill shape */
    background-color: transparent;
    color: var(--pill-text-color);
    text-decoration: none;
    cursor: pointer;

    /* Animate background, color, and transform */
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.1s ease;
}

/* Hover/Focus State */
.nav-link:hover,
.nav-link:focus {
    background-color: var(--pill-hover-bg);
    color: var(--pill-hover-text-color);
}

/* Focus Ring */
.nav-link:focus {
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 4px; /* Offset so ring doesn’t overlap border */
}

/* Active Link */
.nav-link--active {
    background-color: var(--pill-active-bg);
    color: var(--pill-active-text-color);
    border-color: var(--pill-active-bg);
}

/* Pressed State */
.nav-link:active {
    transform: scale(0.96);
}

.nav-link.is-clicked {
    transform: scale(0.96);
}

.menu {
    display: flex;
    gap: 1rem;
    font-weight: var(--menu-font-weight);
    font-size: var(--menu-font-size);
    margin-top: 0;
    justify-content: flex-end;
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: var(--background-color-light);
    color: var(--text-color-light);
    border-top: 1px solid var(--footer-line-color);
    font-size: var(--footer-font-size);
    font-weight: var(--footer-font-weight);
}

.footer-menu {
    display: flex;
    gap: 1rem;
    justify-content: flex-start; /* Always left-align */
    padding-left: 2rem; /* Align with tagline/body text */
}

.footer-menu-item {
    text-decoration: underline;
    color: inherit; /* Ensure links appear consistent and not styled as hyperlinks */
}

main {
    padding: 0 2rem; /* Reinstate padding for content */
    padding-bottom: 2rem; /* Add padding to the bottom of the body */
}

.back-button {
    display: block;
    margin: 1rem 0; /* Reinstate padding for back button */
    font-family: "Nunito Sans", sans-serif;
    font-size: 1.25rem;
    text-decoration: none;
    color: inherit;
}

@media (max-width: 768px) {
    header {
        align-items: center;
        text-align: center;
        padding-left: 1rem; /* Reset padding for mobile */
    }

    .tagline-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .menu {
        flex-direction: row;
        justify-content: center;
        margin-top: 1rem; /* Increased padding for mobile */
    }

    footer {
        justify-content: flex-start; /* Left-align for mobile as well */
    }
}
