body {
    background-color: white;
    color: black;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: calc(1vw + 1vh);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100%;
    overflow: hidden;
}
body.dark-mode {
    background-color: black;
    color: white;
}
body.dark-mode nav {
    background-color: black;
}
body.dark-mode .nav-toggle {
    color: white;
}
body.dark-mode nav .left ul li a {
    color: white;
}
body.dark-mode nav .right svg {
    color: white;
}
body.dark-mode #icon-sun {
    display: inline;
}
body.dark-mode #icon-moon {
    display: none;
}
body.dark-mode nav .left .logo {
    filter: brightness(0) invert(1);
}
body.dark-mode p.about-text {
    color: white;
}
body.dark-mode .tab:link, body.dark-mode .tab:visited {
    color: white;
    text-decoration: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 0.75em;
}
body.dark-mode .tab:hover, body.dark-mode .tab:active, body.dark-mode .tab:focus {
    color: white;
    text-decoration: none;
    text-shadow: 0 0 10px silver, 0 0 25px silver;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 0.75em;
}

nav {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 300;
    padding: calc(0.5em + env(safe-area-inset-top)) 0.5em 0.5em 0.5em;
}
nav .left {
    display: flex;
    align-items: center;
}
nav .left .logo {
    display: block;
    width: clamp(20px, 1em, 40px);
    height: clamp(20px, 1em, 40px);
}
nav .left ul {
    list-style: none;
    margin: 0;
    margin-left: 2em;
    padding: 0;
    display: flex;
    gap: 2em;
    font-size: clamp(10px, 0.5em, 40px);
}
nav .left ul li:hover {
    cursor: pointer;
    text-shadow: 0 0 8px silver, 0 0 12px silver;
}
nav .left ul li a {
    color: black;
    text-decoration: none;
}
nav .left ul li a:visited {
    color: black;
}
nav .right {
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: red;
    font-size: clamp(15px, 0.7em, 40px);
    margin-left: auto;
    margin-right: 1em;
}
nav .right .heart,
nav .right .heart:visited,
nav .right .heart:hover,
nav .right .heart:active {
    position: relative;
    text-decoration: none;
    color: red;
}
nav .right .heart::after {
    content: "Buy me a coffee!";
    position: absolute;
    top: 120%;
    right: 50%;
    transform: translateX(50%);
    background: white;
    color: black;
    font-size: 0.65em;
    padding: 0.3em 0.6em;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
body.dark-mode nav .right .heart::after {
    background: black;
    color: white;
    text-shadow: 0 0 8px rgb(255, 149, 149), 0 0 12px rgb(255, 149, 149);
}
@media (hover: hover) {
    nav .right .heart:hover,
    nav .right .heart:hover > * {
        cursor: pointer;
        text-shadow: 0 0 8px red, 0 0 12px red;
    }
    nav .right .heart:hover::after {
        opacity: 1;
    }
}
nav .right .heart.show-hint {
    text-shadow: 0 0 8px red, 0 0 12px red;
}
/* Allow JS to force-show the tooltip */
nav .right .heart.show-hint::after {
    opacity: 1;
}

nav .right button {
    border: none;
    background: transparent;
    cursor: pointer;
}
nav .right svg {
    width: clamp(20px, 1.4vw, 40px);
    height: clamp(20px, 1.4vw, 40px);
    color: black;
}

#icon-sun {
    display: none;
}
#icon-moon {
    display: inline;
}

.about-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: calc(100vh - 3.8rem); /* 3.8rem is nav height */
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

p.about-text {
    display: block;
    width: 30%;
    margin-left: 35%;
    margin-top: 2em;
    line-height: 1.6;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 0.75em;
    font-weight: 300;
    color: black;
}

a#radio_pulsars:link {
    color: #007aff;
    text-decoration: none;
}

a#radio_pulsars:visited {
    color: #007aff;
    text-decoration: none;
}

a#radio_pulsars:hover {
    font-weight: 400;
}

a#radio_pulsars:active {
    font-weight: 400;
}

a#radio_pulsars:focus {
    font-weight: 400;
    text-decoration: none;
}

a#hz_sky {
    color: rgb(255, 127, 0);
}

a#chickchickgo:link {
    color: #2aaa00;
    text-decoration: none;
}

a#chickchickgo:visited {
    color: #2aaa00;
    text-decoration: none;
}

a#chickchickgo:hover {
    font-weight: 400;
}

a#chickchickgo:active {
    font-weight: 400;
}

a#chickchickgo:focus {
    font-weight: 400;
    text-decoration: none;
}

.tab:link,
.tab:visited {
    color: black;
    text-decoration: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 0.75em;
}

.tab:hover,
.tab:active,
.tab:focus {
    color: black;
    text-decoration: none;
    text-shadow: 0 0 6px silver, 0 0 10px silver;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 0.75em;
}

a#contact_me {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 0.75em;
    font-weight: 400;
    color: goldenrod;
}

.pulsar-video-container {
    width: 30%;
    margin-left: 35%;
    margin-top: 0em;
    margin-bottom: 0em;
}

.pulsar-video {
    width: 100%;
    height: 18vw;
    max-height: 320px;
    border-radius: 0px;
}

/* Hamburger menu for narrow screens */
.nav-toggle {
    display: none;
    position: relative;
    left: 10%;
    width: 16px;
    height: 12px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0.3em;
    color: black;
}
.nav-toggle span {
    position: absolute;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform 0.3s ease, top 0.3s ease; opacity: 0.3s ease;
}
.nav-toggle span:nth-child(1) {
    top: 0;
}
.nav-toggle span:nth-child(2) {
    top: 6px;
}
.nav-toggle span:nth-child(3) {
    top: 12px;
}
nav.open .nav-toggle span:nth-child(1) {
    top: 9px;
    transform: rotate(45deg);
}
nav.open .nav-toggle span:nth-child(2) {
    opacity: 0;
}
nav.open .nav-toggle span:nth-child(3) {
    top: 9px;
    transform: rotate(-45deg)
}

@media (max-width: 700px) {
    nav {
        flex-wrap: wrap;
        position: relative;
    }

    nav .left .logo {
        width: 3.5em;
        height: 3.5em;
        margin-left: 1em;
    }

    .nav-toggle {
        display: block;
    }

    nav .left ul {
        flex-direction: column;
        gap: 1rem;
        width: 20%;
        max-height: 0;
        overflow: hidden;
        background: transparent;
        background-color: rgba(0, 0, 0, 0.0);
        border-radius: 0 0 0 0;
        backdrop-filter: blur(6px);
        padding: 1rem 0;
        padding-left: 1.2rem;
        box-sizing: border-box;
        font-size: 1em;
        position: fixed;
        top: 3.8rem; /* sit right below nav */
        left: 0;
        margin-left: 7.5%;
        opacity: 0;
        transition: max-height 0.5s ease, opacity 0.5s ease;
    }

    /* Show menu when nav is toggled */
    nav.open .left ul {
        max-height: 300px;
        padding: 1rem 0 1rem 1.1rem;
        opacity: 1;
    }

    nav .left ul li a {
        display: block;
        padding: 0rem 0rem;
    }

    nav .left ul li p.link-info {
        position: fixed;
        top: 30%;
        left: 50%;
        transform: translateX(-50%);
        width: 80%;
        height: auto;
        font-size: 1.2em;
    }

    nav .right {
        font-size: 1.9em;
        margin: 0.3em;
    }

    nav .right svg {
        width: 7vw;
        height: 7vw;
    }

    p.about-text {
        display: block;
        width: 70%;
        margin-left: 15%;
        font-size: 1.2em;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    }

    .pulsar-video-container {
        width: 70%;
        margin-left: 15%;
        margin-top: 0em;
        margin-bottom: 0em;
    }

    .pulsar-video {
        width: 100%;
        height: 40vw;
        max-height: 360px;
        border-radius: 0px;
    }
}

@media (hover: none) and (pointer: coarse) {
    nav .right .heart::after {
        content: "Double tap to Buy me a coffee!";
        right: 30%;
        transform: translateX(30%);
        font-size: 0.55em;
    }
}
