:root {
    --typewriter-font: Courier, monospace;
    --typewriter-paper-color: #F5F5F5;
    --font-size: 1rem; /* Base font size */
    --padding-main: 7rem; /* Main padding */
}


body {
    font-family: var(--typewriter-font);
    margin: 0;
    padding: 0;
    background-color: var(--typewriter-paper-color);
    text-align: left;
    font-size: var(--font-size); /* Use rem for font size */
}

header {
    padding: 0 3rem; /* Use rem for padding */
    margin-top: 1.7rem; /* Use rem for margin */
    margin-bottom: 4.5rem;
    background-color: #F5F5F5;
    color: black;
    text-align: left;
    font-size: var(--font-size); /* Use rem for font size */
}

.header-border {
    border-top: 0.125rem dashed #000; /* Use rem for border */
    border-bottom: 0.125rem dashed #000; /* Use rem for border */
}

h1, h2 {
    font-family: Courier, monospace;
    font-size: var(--font-size); /* Use rem for font size */
    text-align: center;
    font-weight: 100;
    padding-bottom: 0.625rem; /* Use rem for padding */
    line-height: 1.2; /* Adjust as needed */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Aligns children vertically in the center */
    padding: 0.625rem 1.25rem; /* Use rem for padding */
}

.typewriter-link {
    text-decoration: none; /* Removes underline */
    color: inherit; /* Inherits the text color from parent elements */
}

.right-menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.menu-item {
    margin-right: 1.25rem; /* Use rem for margin */
}

/* Style the links in the right menu */
.right-menu .menu-item a {
    text-decoration: none; /* Remove underline */
    color: inherit; /* Inherit text color from parent */
}

/* Style link hover state */
.right-menu .menu-item a:hover {
    color: rgba(0, 0, 0, 0.5); /* Black with 50% opacity on hover */
}

/* Style link click state */
.right-menu .menu-item a:active {
    color: #8B0000; /* Red color when clicked */
}

main {
    max-width: 66rem;
    margin: auto;
    margin-top: 3rem;
    justify-content: center;
    align-items: center;
    align-content: center;
}

p {
    font-size: var(--font-size); /* Apply font size variable */
    line-height: 1.5;
    margin-bottom: 1.25rem; /* Use rem for margin */
    max-width: 40rem; /* Use rem for maximum width */
    text-align: left; /* Center-align paragraphs within the main content */
}


.work-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem; /* Add spacing between cards */
}


.work-card {
    /* ... Other styles ... */
    position: relative;
    flex-basis: calc(50% - 1rem); /* Set flex-basis to half the width minus the gap */
    overflow: hidden;
}

.work-card img {
    max-width: 100%; /* Make the images responsive */
    height: auto; /* Maintain the aspect ratio */
    display: block; /* Remove any extra spacing below the images */
}

/* CSS for the CV image to ensure it is centered and responsive */
.cv {
    max-width: 75%; /* Adjust this as needed to control the size */
    height: auto; /* Maintains the aspect ratio */
}

.card-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.work-card:hover .card-title {
    opacity: 1;
}

.card-title h1 {
    /* ... Other styles ... */
    color: white;
    margin: 0;
    padding: 1rem; /* Use rem for padding */
    text-align: center;
}

ul {
    margin-left: 1.25rem; /* Use rem for margin */
    font-size: var(--font-size); /* Use rem for font size */
}

footer {
    background-color: #F5F5F5;
    color: rgb(0, 0, 0);
    text-align: center; /* Center-align the text horizontally */
    padding: 0.625rem; /* Use rem for padding */
    margin-top: 1.875rem; /* Use rem for margin */
    display: flex;
    justify-content: center; /* Center the content horizontally */
    align-items: center; /* Center the content vertically */
}

.cv{
    max-width: 75%; /* Kontrollerer maksimal bredde av CV-en for å unngå at den blir for stor */
    height: auto; /* Opprettholder bildets aspekt ratio */
    display: block; /* Sørger for at bildet er et blokkelement */
    margin: 0 auto; /* Sentrerer bildet horisontalt */
}


.typewriter {
    line-height: 1; /* Adjust this value as needed */
    padding-top: 0; /* Adjust top padding */
    padding-bottom: 0; /* Adjust bottom padding */
    display: inline-block; /* Change display to inline-block */
    vertical-align: middle; /* Align vertically with the middle */
    margin-top: 0; /* Adjust or remove as needed */
    margin-bottom: 0; /* Adjust or remove as needed */
    overflow: hidden;
    border-right: .10em solid rgb(0, 0, 0); /* The typewriter cursor */
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .15em;
    animation: typing-and-blink 4.5s steps(14, end) forwards; /* 'forwards' keeps the final state */
}

.typewriter, .right-menu a {
    font-size: 1rem; /* Ensure consistent sizing */
}



/* The combined typing and blinking cursor effect */
@keyframes typing-and-blink {
    0% { width: 0; border-right: .10em solid rgb(0, 0, 0); }
    50% { width: 100%; border-right: .10em solid rgb(0, 0, 0); }
    75% { width: 100%; border-right: .10em solid rgb(0, 0, 0); }
    100% { width: 100%; border-right: transparent; } /* Hide cursor at the end */
}

/* The blinking cursor effect */
@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: rgb(0, 0, 0); }
}

/* Media query for screens smaller than 768px */
@media (max-width: 768px) {
    :root {
        --font-size: 0.9rem; /* Smaller base font size for mobile */
        --padding-main: 1rem; /* Smaller padding for mobile */
    }

    header, .header-border, main, footer {
        padding: var(--padding-main); /* Apply smaller padding */
    }

    header {
        /* Increase padding for the header on mobile */
        padding-top: 0.5rem; /* Increase top padding */
        padding-bottom: 0.5rem; /* Increase bottom padding */
    }

    .work-card {
        flex-basis: 100%; /* Full width for cards on smaller screens */
    }

    h1, h2 {
        font-size: 1.2rem; /* Slightly larger font size for headings */
    }

    nav {
        flex-direction: column;
        padding: 1rem 0; /* Reduce padding */
    }

    .left-menu, .right-menu {
        /* Optional: Adjust margin for these elements if needed */
        margin-bottom: 1rem; /* Increase bottom margin */
    }

    .right-menu {
        flex-direction: column;
        padding: 0; /* Remove additional padding */
    }

    .menu-item {
        margin-bottom: 1rem; /* Add space between menu items */
    }

    .menu-item a {
        padding: 1rem; /* Increase padding for easier touch */
    }

    .work-grid {
        gap: 0.5rem; /* Reduce gap between items */
    }

    .typewriter {
        font-size: 1rem; /* Adjust typewriter font size */
    }

    .typewriter-link, .right-menu a {
        font-size: 0.9rem; /* Smaller font size for links */
    }

    .about-flex, .image-section, .text-section, .video-section {
        padding: 0; /* Remove padding for these sections */
    }

    .cv {
        max-width: 100%; /* Allows the image to scale down on smaller screens */
    }
    .image-section {
        height: auto; /* Adjusts the height on smaller screens to be more responsive */
    }

}