:root {
    --color-bg-dark: #000000;
    --color-accent: #559955;
    --color-nav-text: #808080;
    --color-text: #cccc99;
    --header-height: 130px;
}

body {
    margin: 0;
    min-height: 100vh;
    background-image: linear-gradient(to bottom right, black, green);
    background-attachment: fixed;
    color: var(--color-text);
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    min-height: var(--header-height);

    /* floor, not a hard cap */
    height: auto;
    z-index: 1;
    background-color: var(--color-bg-dark);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas: "logo title"
    "nav   nav";
}

.title-content {
    grid-area: title;
    display: flex;
    align-items: var(--color-accent);
}

header h1 {
    margin: 0;
    padding: 5px;
    color: var(--color-accent);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    text-decoration: none;
}

header h1:hover {
    text-decoration: underline;
}

.logo {
    grid-area: logo;
    align-self: start;
    justify-self: start;
    width: clamp(80px, 10vw, 100px);
    height: clamp(80px, 10vw, 100px);
    background-color: var(--color-secondary);
    padding: 0.2vw;
}

.logo img {
    height: 100%;
    width: 100%;
}

nav {
    grid-area: nav;
    align-self: end;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-color: var(--color-bg-dark);
    color: var(--color-nav-text);
    width: 100%;
}

.navbutton {
    flex: 1 1 auto;
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.25rem);
    background-color: var(--color-bg-dark);
    padding: 0.5rem 1rem;
    min-width: 80px;
}

.navbutton:hover {
    background-color: #002000;
}

button {
    height: 50px;
    width: 150px;
}

/* MAIN: mobile-first full width, no fixed 75% until larger screens */
main {
    position: relative;
    z-index: 0;
    width: 100%;
    padding: 1rem 5%;
    margin-top: var(--header-height);
}

/* Image flows inline on mobile instead of absolutely overlapping content */
.image1 {
    width: clamp(150px, 60vw, 270px);
    margin: 0 auto 1rem;
    top: var(--header-height);
    position: relative;
}

.image1 img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* TABLET AND UP: restore side-by-side layout */
@media (min-width: 768px) {
    :root {
        --header-height: 130px;

        /* nav fits on 1 row once there's more width */
    }

    main {
        width: 75%;
        top: 20%;
        position: absolute;
        margin-top: var(--header-height);
    }

    .image1 {
        position: fixed;
        top: var(--header-height);
        right: 0;
        width: clamp(180px, 20vw, 360px);
        margin: 0;
    }
}