/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined&display=swap');
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    src: local('Poppins Regular'), local('Poppins-Regular'), url('https://fonts.gstatic.com/s/poppins/v15/pxiEyp8kv8JHgFVrJJfecg.woff2') format('woff2');
    font-display: swap;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    color: white;
    font-family: 'Poppins', 'Arial', 'Helvetica', sans-serif;
    font-weight: 400;
    font-style: normal;
    text-wrap: pretty;
}

/* Text Styling */
strong, h1, a { font-weight: 600; }
a { text-decoration: none; }
a, #bio, .pageLink > span { color: #e8e6e3; }
a:hover, a:focus {
    border-bottom: 2px solid #c3c4c4;
    transform: scale(1.05);
    transition: all 0.1s;
}

/* Margins */
#page_2 > * > p, h2 { margin-bottom: 0.5rem; }
ol { padding-left: 0rem; }
ul > li, ol > li { list-style-type: none; }
ol > li { margin-bottom: 0.25rem; }

/* Scroll Snap */
html {
    scroll-behavior: smooth !important;
    @media (min-width: 768px) { scroll-snap-type: y mandatory; }
}

/* Layout */
body { max-width: 100vw; min-height: 100svh; }
main { display: flex; flex-direction: column; }

header {
    display: flex;
    justify-content: center;
    padding: 0 !important;

    nav {
        padding-inline: 1em;
        top: 2em;
        position: fixed;
        @media (max-width: 768px) { position: absolute; top: 5em; }
        @media (max-width: 400px) { top: 1em !important; }
        &.cssdemo {
            top: 1rem;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            @media (max-width: 992px) {
                top: 1rem;
                right: 1rem;
                left: auto;
                transform: none;
            }
            .menu-icon {
                background: transparent;
                font-size: 1.5rem;
                border: 1px solid #e8e6e3;
                border-radius: 0.5rem;
                padding: 0.5rem 1.5rem;
                cursor: pointer;
                z-index: 10;
                @media (max-width: 768px) { display: block; }
            }
            ul {
                display: none;
                opacity: 0;
                transition: opacity 0.3s ease-in-out, background 0.3s ease-in-out;
                background: rgba(28, 30, 31, 0.9); /* Background added here */
                border-radius: 0.5rem;
                padding: 1rem;
                z-index: 10;
                @media (max-width: 768px) {
                    position: fixed;
                    top: 3rem;
                    right: 1rem;
                    width: auto;
                }
            }
            &:focus-within ul,
            .menu-icon:focus + ul,
            ul:hover {
                display: flex;
                flex-direction: column;
                opacity: 1;
                visibility: visible;
            }
        }
    }

    nav:not(.cssdemo) ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2em;
    }
}

/* Styling for links that have icons */
.iconlink { display: flex; gap: 0.25em; }

/* Remove page padding when on mobile */
main > section:not(:first-of-type) {
    @media (max-width: 768px) { padding-top: 3em; height: 100%; }
}

/* Page Layout */
main > section {
    padding: 6em 1rem 1rem 1rem;
    height: calc(100svh - 4em);
    scroll-snap-align: start;
    margin: 0;
    background: #1c1e1f;
}
#page-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    &:not(.no-bg) { background: linear-gradient(0deg, #1c1e1f 50%, #181a1b 50%); }
}
main > section:last-of-type { height: 100%; }
footer {
    padding: 0em 1em;
    min-height: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #131415;
    color: #555555;
    gap: 3vw;
    text-align: center;
    @media (max-width: 768px) { padding: 1rem; }
}
#bio {
    margin: 1rem;
    max-width: 40rem;
    text-align: center;
    font-size: 0.9rem;
}
.portrait > img {
    width: 25rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    border: 0.5rem solid #847a6c;
    @media (max-width: 768px) { max-width: 15rem; margin-bottom: 0.5rem; }
    @media (max-height: 600px) { max-width: 10rem; margin-bottom: 0.5rem; }
}
.pageLink {
    display: flex;
    flex-direction: column;
    align-items: center;
    span { font-weight: 100; font-size: 2rem; }
}

/* Non-main page CSS grid */
.container {
    display: grid;
    --padding-inline: 1rem;
    --content-max-width: 100ch;
    --breakout-max-width: 125ch;
    --breakout-size: calc((var(--breakout-max-width) - var(--content-max-width)) / 2);
    @media (min-width: 769px) {
        grid-template-columns: [full-width-start] minmax(var(--padding-inline), 1fr) [breakout-start] minmax(0, var(--breakout-size)) [content-start] min(100% - (var(--padding-inline) * 2), var(--content-max-width)) [content-end] minmax(0, var(--breakout-size)) [breakout-end] minmax(var(--padding-inline), 1fr) [full-width-end];
    }
}
.container > .breakout { grid-column: breakout; }
.container > .full-width { grid-column: full-width; }
.container > * { grid-column: content; }
#hobbies { width: 30rem; max-height: 30rem; }

/* Utility classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.center-y { justify-content: center; }
.center-x { align-items: center; }
#page_4 > .flex { gap: 1rem; }

/* Code Snippet Styling */
#codesnap {
    width: 100%;
    height: auto;
    border-radius: 0.4rem;
    filter: saturate(1.75);
    margin-bottom: 1rem;
}
#links { gap: 3rem; justify-content: center; flex-wrap: wrap; }
p:not(footer > p) { margin-bottom: 1rem; }

/* Screen reader only, hidden from view */
.sr-only {
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
}

/* 2 by 2 grid */
#twobytwogrid {
    display: grid;
    grid-template: repeat(2, 1fr) / repeat(2, 1fr);
}
#page_jump > div > a, .button {
    padding: 0.5rem 1rem;
    border: 1px solid #e8e6e3;
    border-radius: 0.7rem;
}
nav:not(.cssdemo) li:has(> .currentpage) { @media (min-width: 769px) { border-bottom: 1px solid #c3c4c4; } }
.material-symbols-outlined { font-size: 1.4rem; }

/* Mobile-first styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background: #fff;
    color: #333;
}
header {
    text-align: center;
    padding: 1em 0;
    background: #f4f4f4;
    animation: fadeIn 1s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
header h1, header h2 { margin: 0.5em 0; animation: fadeIn 1s ease-in-out; }

/* Qualifications Page Specific Styles */
.qualifications main {
    background: #1c1e1f;
    color: #e8e6e3;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qualifications main h2 {
    color: #e8e6e3;
    margin-bottom: 1rem;
    text-align: center;
}

.qualifications main table {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
    margin: 2rem 0;
    background: #181a1b;
    color: #e8e6e3;
}

.qualifications main th, .qualifications main td {
    border: 1px solid #333;
    padding: 1rem;
    text-align: left;
}

.qualifications main th {
    background: #333;
    font-weight: 600;
}

.qualifications main tr:nth-child(even) {
    background: #1c1e1f;
}

.qualifications main ul, .qualifications main ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    max-width: 800px;
    width: 100%;
}

.qualifications main li {
    margin: 0.5rem 0;
}

.qualifications main footer {
    background: #181a1b;
    color: #e8e6e3;
    padding: 1rem;
    text-align: center;
    margin-top: 2rem;
}

/* Image styling */
.qualifications main img {
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.qualifications header {
    background: #181a1b;
}

.qualifications h2:first-of-type {
    opacity: 0;
}