:root {
    color-scheme: light dark;
}

html {
    scrollbar-gutter: stable;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.55em;
    font-size: 1.15em;
    margin: 0;
    min-height: 100%;
    background-color: light-dark(white, #1a1a1a);
    color: light-dark(black, #e0e0e0);
}

h1, h2, h3 {
    font-weight: 550;
}

h1 {
    font-size: 1.6em;
}

h2 {
    font-size: 1.4em;
    margin-top: 1.4em;
    
}

h3 {
    font-size: 1em;
}

pre {
    background: light-dark(#f4f4f4, #2a2a2a);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    color: light-dark(black, #e0e0e0);
}

code {
    background: light-dark(#f4f4f4, #2a2a2a);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: light-dark(black, #e0e0e0);
}

pre code {
    padding: 0;
    color: inherit;
}

blockquote {
    background: light-dark(#EEE, #2a2a2a);
    padding: 0.8em;
    margin: 1em 0;
    font-weight: 350;
}

hr {
    border: none; border-bottom: dashed 1px light-dark(#222, #eee); margin: 30px 0 0 0;
}

a {
    color: light-dark(#0070f3, #4db8ff);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: light-dark(#0070f3, #4db8ff);
}

.social-links a:hover {
    text-decoration: none;
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 10px;
}

header {
    margin-bottom: 50px;
    border-bottom: 1px solid light-dark(#aaa, #444);
    padding: 20px;
    background-color: light-dark(#EEE, #2a2a2a);
    text-align: center;

    #site-title {
        a {
            text-decoration: none;
            color: light-dark(#000, #ddd);
            font-weight: bold;
            font-size: 1.7em;
        }
        margin: 0 0 5px 0;
    }

    #site-nav {
        margin: 15px 0 0 0;
        padding: 0 0 2px 0;
        line-height: 1em;

        ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        li {
            display: inline-block;
        }

        a {
            font-size: 1.1em;
            margin-right: 20px;
            text-decoration: none;
        }

        @media (max-width: 600px) {
            a {
                font-size: 0.9em;
                margin-right: 10px;
            }
        }

        a:hover {
            color: coral;
        }
        a.active {
            color: light-dark(darkblue, #9bd6f8);
        }

        li::after {
            display: block;
            content: attr(title);
            font-weight: bold;
            height: 1px;
            color: transparent;
            overflow: hidden;
            visibility: hidden;
          }
    }
    
}

footer {
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid light-dark(#aaa, #444);
    background-color: light-dark(#EEE, #2a2a2a);
    padding: 25px;

    p {
        margin: 0 0 20px 0;
    }

    svg {
        padding: 0 5px;
    }
}


/*--- ABOUT ---*/

#headshot {
    padding: 10px 0 0 20px;
    width: 160px;
    font-size: 0.7em;
    line-height: normal;
    color: light-dark(#555, #aaa);
    float: right;

    img {
        border-radius: 25px;
        width: 150px;
        height: 150px;
        object-fit: cover;
        transition: all 0.3s ease-in-out;
        cursor: pointer;
    }

    p {
        margin: 0;
        text-align: center;
    }
}



/*--- POST ---*/

main#post {
    margin-top: 40px;
}

#post-header {
    margin: 40px 0 30px 0;

    a {
        color: light-dark(#000, #FFF);
    }
}

h1.post-title {
    margin: 0 0 10px 0;
    color: light-dark(#000, #FFF);

    a:hover {
        text-decoration: underline;
    }
}

p#date {
    margin: 0 0 5px 0;
    padding: 0;
    font-weight: 500;
    color: light-dark(#777, #999);
    font-size: 1em;
}

#writing {
    article {
        margin-bottom: 70px;
    }

    #post-footer {
        margin: 5px 0 0 0;
        font-size: 0.9em;
        font-style: italic;
    }
}


/*--- DARK MODE ---*/

/* Dark mode toggle button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: light-dark(#AAA, #333);
    border: 1px dashed light-dark(#555, #AAA);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
}

.theme-toggle:hover {
    border: 1px dashed coral;
}


/*--- IMAGE MODAL ---*/

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    animation: scaleIn 0.3s ease-in-out;
}

.modal-image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.close-button {
    position: absolute;
    top: -40px;
    right: -10px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.3s ease;
}

.close-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


/*--- BLOG POST COMPONENTS ---*/

/* Spoiler text that can be clicked to reveal */
.spoiler {
    background-color: light-dark(#333, #555);
    color: light-dark(#333, #555);
    cursor: pointer;
    border-radius: 3px;
    display: inline;
    user-select: none;
    transition: all 0.3s ease;
}

.spoiler:hover {
    background-color: light-dark(#444, #666);
}

.spoiler.revealed {
    background-color: transparent;
    color: inherit;
    cursor: auto;
    user-select: text;
}

/* Standout quotes with better dark mode support */
.standout-quote {
    font-size: 1.3em;
    font-weight: 500;
    color: light-dark(#2c3e50, #a8c7e8);
    border-left: 4px solid light-dark(#3498db, #4db8ff);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    background: light-dark(rgba(52, 152, 219, 0.05), rgba(77, 184, 255, 0.05));
    padding: 15px 15px 15px 20px;
    border-radius: 0 5px 5px 0;
}

/* Game images in blog posts */
.game-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
}

/* Main/hero image floated to the right */
.main-image {
    float: right;
    margin: 0 0 20px 20px;
    max-width: 400px;
}

@media (max-width: 600px) {
    .main-image {
        float: none;
        margin: 20px auto;
        display: block;
        max-width: 100%;
    }

}

