:root {
    --bg: #252221;
    /* black (nvim bg) */
    --fg: #cdc0ad;
    /* white */
    --accent: #c65f5f;
    /* red */
    --subtle: #322f2e;
    /* line (for lines like vertsplit) */
    --mode-bg: #8ca589;
    /* green */
    --mode-fg: #252221;
    /* black for contrast */
    --line-col-bg: #7d92a2;
    /* blue */
    --line-col-fg: #cdc0ad;
    /* white for contrast */
}

body,
html {
    margin: 0;
    padding: 0;
    font-family: monospace;
    background-color: var(--bg);
    color: var(--fg);
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 0;
}

html {
    overflow-y: visible;
}

#content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 2;
}

header {
    margin-bottom: 30px;
}

header p {
    margin: -5px;
}

h1,
a {
    color: var(--accent);
}

/* Homepage cursor animation */
/* ---------------------------------------------------------- */

.cursor {
    display: inline-block;
    width: 1ch;
    text-align: center;
    animation: blink 1s step-start infinite;
    margin-left: -4px;
}

@keyframes blink {
    50% {
        opacity: 0;
        /* Makes the cursor disappear */
    }
}

/* Styling for blog */
/* ---------------------------------------------------------- */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 4;
}

.modal-content {
    position: relative;
    background-color: var(--bg);
    margin: 5vh auto;
    padding: 20px;
    width: 90%;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
    color: var(--fg);
    z-index: 5;
}

.close-button {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: var(--accent);
    transition: color 0.2s;
}

.close-button:hover {
    color: var(--fg);
}

#loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--subtle);
    border-top: 4px solid var(--line-col-bg);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Markdown content styles */
#markdown-content {
    line-height: 1.6;
    color: var(--fg);
}

#markdown-content h1 {
    font-size: 2em;
    margin: 0.67em 0;
    color: var(--accent);
}

#markdown-content h2 {
    font-size: 1.5em;
    margin: 0.75em 0;
    color: var(--accent);
}

#markdown-content h3 {
    font-size: 1.17em;
    margin: 0.83em 0;
    color: var(--accent);
}

#markdown-content h4 {
    margin: 1.12em 0;
    color: var(--accent);
}

#markdown-content h5 {
    font-size: 0.83em;
    margin: 1.5em 0;
    color: var(--accent);
}

#markdown-content h6 {
    font-size: 0.75em;
    margin: 1.67em 0;
    color: var(--accent);
}

#markdown-content code {
    background-color: var(--subtle);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    color: var(--fg);
}

#markdown-content pre {
    background-color: var(--subtle);
    padding: 1em;
    overflow-x: auto;
    border-radius: 4px;
    color: var(--fg);
}

#markdown-content blockquote {
    margin: 0;
    padding-left: 1em;
    border-left: 4px solid var(--line-col-bg);
    color: var(--fg);
}

#markdown-content img {
    max-width: 100%;
    height: auto;
}
/* ---------------------------------------------------------- */

/* Styling for the mobile return button */
/* ---------------------------------------------------------- */

#mobile-return {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    font-size: 24px;
    color: var(--accent);
    z-index: 2;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    line-height: 1;
}

#mobile-return:focus {
    outline: none;
}

#mobile-return::after {
    content: '';
    position: absolute;
    cursor: pointer;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

#mobile-return:focus::after,
#mobile-return:hover::after {
    transform: scaleX(1);
}

@media (max-width: 768px) {
    #mobile-return {
        display: block;
    }
}

/* Styling for the navigation section */
/* ---------------------------------------------------------- */

nav ul {
    list-style-type: none;
    padding: 0;
    text-align: center;
}

nav ul li {
    margin-bottom: 10px;
}

/* Styling for the status bar */
/* ---------------------------------------------------------- */

#status-bar {
    background-color: var(--subtle);
    color: var(--fg);
    padding: 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
}

.left-section,
.right-section {
    display: flex;
    align-items: center;
}

#status-bar span {
    padding: 2px 8px;
}

.mode-block {
    background-color: var(--mode-bg);
    color: var(--mode-fg);
    font-weight: bold;
}

.line-col-block {
    background-color: var(--line-col-bg);
    color: var(--line-col-fg);
    font-weight: bold;
}

/* ---------------------------------------------------------- */

/* Styling for the links / commands */
/* ---------------------------------------------------------- */
a,
.command {
    color: var(--accent);
    text-decoration: none;
    /* Remove default underline */
    position: relative;
    /* For custom underline effect */
    cursor: pointer;
    /* Change cursor to indicate clickable */
}

/* Custom underline effect on hover */
a::after,
.command::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

a:hover::after,
.command:hover::after {
    transform: scaleX(1);
}

/* Always show underline for keyboard navigation */
a:focus,
.command:focus {
    outline: none;
    /* Remove default focus outline */
}

a:focus::after,
.command:focus::after {
    transform: scaleX(1);
}

.command {
    display: inline-block;
}

/* ---------------------------------------------- */

/* Styling for the main content */
/* ---------------------------------------------- */
#main-content ul {
    list-style-type: none;
    padding: 0;
}

#main-content ul li {
    margin-bottom: 10px;
}

#main-content a {
    color: var(--accent);
    text-decoration: none;
    position: relative;
}

#main-content a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

#main-content a:hover::after,
#main-content a:focus::after {
    transform: scaleX(1);
}

/* --------------------------------------------------- */

/* Styling for the command input */
/* --------------------------------------------------- */
#command-input {
    position: fixed;
    bottom: 18px;
    left: 0;
    right: 0;
    background-color: var(--bg);
    padding: 5px;
    display: flex;
    align-items: center;
    z-index: 2;
}

#command-input span {
    color: var(--accent);
    margin-right: 5px;
}

#command-input input {
    background-color: var(--bg);
    color: var(--fg);
    border: none;
    outline: none;
    flex-grow: 1;
    font-family: monospace;
}

/* ----------------------------------------------- */

/* Styles for about me section */
/* ----------------------------------------------- */
.about-content,
.projects-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

/* About page styles */
.about-content h3 {
    color: var(--accent);
    margin-top: 20px;
}

.about-content ul {
    list-style-type: none;
    padding-left: 20px;
}

.about-content ul li::before {
    content: "•";
    color: var(--accent);
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.about-content .about-list {
    margin-top: 5px;
    margin-left: 2em;
    margin-bottom: 2px;
}

.about-content li {
    margin-top: 10px;
    margin-left: 1em;
    margin-bottom: 5px;
}

/* Inline "command" links in about me section next to other text instead of on a new line. This should override the command */
.about-content a.command {
    display: inline;
}

/* ---------------------------------------------------- */

/* Blog page styles */
/* ---------------------------------------------------- */

.blog-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.post-meta {
    font-size: 0.9em;
    color: var(--fg);
    opacity: 0.7;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: var(--accent);
    text-decoration: none;
    position: relative;
}

.read-more::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.read-more:hover::after {
    transform: scaleX(1);
}

/* ---------------------------------------------------- */

/* Shared styles for projects and jobs */
/* ---------------------------------------------------- */
.content-card {
    margin-bottom: 30px;
    border: 1px solid var(--subtle);
    border-radius: 5px;
    padding: 20px;
    background-color: rgba(37, 34, 33, 0.5);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.content-card:hover {
    background-color: rgba(37, 34, 33, 0.8);
    border-color: var(--accent);
}

.content-card h3 {
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 5px;
}

.content-card h4 {
    color: var(--fg);
    margin-top: 0;
    margin-bottom: 5px;
}

.content-card p {
    margin: 10px 0;
}

.content-card a {
    color: var(--accent);
    text-decoration: none;
    position: relative;
}

.content-card a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.content-card a:hover::after {
    transform: scaleX(1);
}

/* ---------------------------------------------------- */

/* Specific styles for jobs */
/* ---------------------------------------------------- */
.job .job-duration {
    font-style: italic;
    color: var(--fg);
    opacity: 0.7;
    margin-bottom: 10px;
}

.job>ul:not(.related-skills ul) {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 15px;
}

.job>ul:not(.related-skills ul) li {
    margin-top: 10px;
    margin-bottom: 5px;
    position: relative;
    padding-left: 20px;
}

.job>ul:not(.related-skills ul) li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: 0;
}

/* ---------------------------------------------------- */

/* Related Skills Styles */
/* ---------------------------------------------------- */
.related-skills {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--subtle);
}

.related-skills h5 {
    color: var(--accent);
    margin-bottom: 10px;
}

.related-skills ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-left: 0;
}

.related-skills ul li {
    background-color: var(--subtle);
    color: var(--fg);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
}

.related-skills ul li::before {
    content: none;
}

/* ---------------------------------------------------- */

/* Style adjustments for mobile devices */
@media (max-width: 768px) {

    .about-content,
    .blog-content,
    .work-experience,
    .job,
    .related-skills,
    .projects-content {
        padding: 10px;
    }

    .project {
        padding: 15px;
    }

    #status-bar {
        display: none;
        font-size: 3pt;
    }

    /*#status-bar span {*/
    /*    padding: 2px 5px;*/
    /*    font-size: 2pt;*/
    /*}*/

    #content {
        padding: 20px;
    }
}
