/*###################################
#####################################
##### DESKTOP STYLING (DEFAULT) #####
#####################################
###################################*/

/* slight browser overrides */
html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid #4c9ffe;
    outline-offset: 4px;
    border-radius: 5px;
}

/* general color scheme */
:root {
    --bg: #f3f4f6;
    --text: #1f2937;
    --card: #ffffff;
    --accent: #1e3a8a;

    --border: #e5e7eb;
    --nav-bg: #f3f4f6;
    --section-alt: #ffffff;

    --overlay: rgba(0, 0, 0, 0.6);
    --modal-bg: #ffffff;

    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.25);

    --top-arrow-bg: #1f2937;
}

.dark-mode {
    --bg: #121212;
    --text: #e5e7eb;
    --card: #1e1e1e;
    --accent: #3b82f6;

    --border: #334155;
    --nav-bg: #121212;
    --section-alt: #1e1e1e;

    --overlay: rgba(0, 0, 0, 0.75);
    --modal-bg: #1e1e1e;

    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-strong: rgba(0, 0, 0, 0.7);

    --top-arrow-bg: #334155;
}

.dark-mode .invertible {
    filter: invert(1);
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-family: 'Open Sans', 'Noto Sans', Helvetica, sans-serif;
}

section:nth-of-type(even) {
    background-color: var(--section-alt);
}

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

/* image reactivity */
img {
    transition: transform 0.2s ease;
}

img:hover:not(#modal-img):not(#theme-icon) {
    transform: scale(1.1) translateY(-5px);
    opacity: 0.85;
}

button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
}

.skip-link {
    position: absolute;
    top: 60px;
    left: 1rem;

    transform: translateY(-120%);
    opacity: 0;

    background: #1e3a8a;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;

    text-decoration: none;
    font-weight: 600;

    transition: transform 0.35s ease-out, opacity 0.25s ease-out;
    z-index: 1001;
}

.skip-link:focus {
    transform: translateY(10%);
    opacity: 1;
}

/* navigation header */
header {
    position: sticky;
    top: 0;
    background: var(--nav-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    z-index: 1000;
}

.nav-header {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    font-family: 'Noto Sans', Helvetica, sans-serif;
    font-weight: 600;
    position: sticky;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text);
    position: relative;
    transition: all 0.25s ease;
}

.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    width: 25px;
    height: 3px;
    background: var(--text);
    left: 0;
    transition: all 0.25s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    padding: 0.5rem 1rem;
    transition: background 0.3s, color 0.3s;
    white-space: nowrap;
}

.nav-links a:hover, .nav-links a:focus-visible {
    background-color: color-mix(in srgb, var(--accent) 15%, transparent);
    border-radius: 5px;
}

.nav-links a.active {
    background-color: #1e3a8a;
    color: #ffffff;
    border-radius: 5px;
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
}

/* light/dark mode */
#theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

#theme-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.dark-mode #theme-icon{
    transform: rotate(180deg);
}

body, header, .modal-content, .project-card {
    transition: background 0.3s ease, color 0.3s ease;
}

/* nature image for hero + visibility fixes */
#intro {
    position: relative;
    background-image: url('../img/other/walkway.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    text-align: center;
    padding: 120px 16px 80px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#intro::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.25);
    z-index: 0;
}

#intro .container {
    position: relative;
    z-index: 1;
}

#intro h1, #intro h2, #intro h3 {
    color: white;
    margin: 8px 0;
}

/* general spacing */
section:not(#intro) {
    padding: 32px 16px;
}

/* letting the body text breathe a little */
.container {
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 24px;
}

/* center headers */
.container > h1, .container > h2, .container > h3{
    text-align: center;
}

/* experience section */
.job {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 32px;
}

/* making the logos play nice */
.job-logo {
    width: 110px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.job-logo img {
    max-width: 100%;
    max-height: 48px;
    height: auto;
}

/* work dates on same line as employer name */
.job-info {
    flex: 1;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.job-date {
    margin: 0;
    font-size: 0.9rem;
}

.job-info p {
    margin: 4px 0;
}

/* grc logo min 97 px, per their site */
.job img[src*="GRC_Logo"] {
    min-width: 100px;
    width: auto;
}

/* container for tech logos */
#tools .tech-logos {
    padding: 16px 0;
}

.logo-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px 0 36px 0;
    position: relative;
    list-style: none;
}

/* divider line between rows */
.logo-row:not(:last-child)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: var(--border);
}

/* colorize animation on hover */
#tools .tech-logos img {
    width: 50px;
    height: auto;
    filter: grayscale(100%) opacity(0.85);
    transition: filter 0.2s ease, transform 0.2s ease;
}

#tools .tech-logos img:hover {
    filter: grayscale(0%) opacity(1);
    transform: translateY(-5px);
}

/* i don't own the logos */
.disclaimer {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* project cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 300px);
    gap: 24px;
    margin-top: 32px;
    justify-content: center;
}

.project-card {
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px var(--shadow-strong);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* hover animation */
.project-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-overlay h3 {
    color: white;
    font-size: 1.3rem;
    text-align: center;
    padding: 0 10px;
}

.project-card:hover img, .project-card:focus-visible img {
    transform: scale(1.1);
}

.project-card:hover .project-overlay, .project-card:focus-visible .project-overlay {
    opacity: 1;
}

/* "View More"/"View Less" button */
.hidden-project {
    display: none;
}

.more-btn {
    margin: 24px auto 0;
    display: block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    background: #1e3a8a;
    color: white;
    cursor: pointer;
}

/* background dimming + modal window toggle */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1000;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* modal window */
.modal-content {
    background: var(--modal-bg);
    width: min(90%, 700px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 40px var(--shadow-strong);
}

.modal-content img {
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 16px auto;
    border-radius: 8px;
}

.modal-tools {
    margin-top: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-tools h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--accent);
}

.modal-tools-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 300px;
}

.modal-tools-row img {
    width: 40px;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

.modal-tools-row img:hover {
    transform: translateY(-3px);
}

.modal-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    justify-content: center;
}

.modal-link img {
    max-width: 50px;
    height: auto;
    display: block;
    transition: 0.2s ease, opacity 0.2s ease;
}

.close-btn {
    position: absolute;
    top: 0px;
    right: 6px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.close-btn:hover, .close-btn:focus-visible {
    opacity: 0.85;
    scale: 1.1;
}

/* footer images */
footer {
    padding: 32px 16px;
    background-color: var(--section-alt);
    text-align: center;
}

footer img {
    width: 50px;
    height: auto;
    margin: 0 8px;
}

/* scroll to top */
#top-arrow {
    /* sticky */
    position: fixed;
    bottom: 24px;
    right: 24px;

    width: 44px;
    height: 44px;

    /* correct spot */
    display: flex;
    align-items: center;
    justify-content: center;

    text-decoration: none;
    font-size: 1.2rem;

    background: var(--top-arrow-bg);
    color: white;
    border-radius: 50%;

    /* visibility */
    opacity: 0;
    pointer-events: none;

    /* shading */
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#top-arrow:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

/*####################################
######################################
############ TOUCHSCREENS ############
######################################
####################################*/
@media (hover: none) {
    /* disable all hover effects */
    img:hover:not(#modal-img),
    #tools .tech-logos img:hover,
    .project-card:hover,
    .project-card:hover img,
    #top-arrow:hover {
        transform: none;
    }

    /* remove grayscale-to-color animation */
    #tools .tech-logos img {
        filter: none;
        opacity: 1;
        transform: none;
    }

    /* touch-friendly card overlay */
    .project-overlay {
        inset: auto 0 0 0;
        height: auto;
        opacity: 1;

        display: flex;
        align-items: center;
        justify-content: center;

        padding: 12px 10px;

        background: rgba(0, 0, 0, 0.75);
        z-index: 1;
    }

    .project-overlay h3 {
        font-size: 1.1rem;
        margin: 0;
        text-align: center;
    }

    .close-btn {
        display: none;
    }
}

/*####################################
######################################
########### TABLET STYLING ###########
######################################
####################################*/
@media (max-width: 1200px) and (min-width: 768px) {
    /* re-size text */
    body {
        font-size: 1.15rem;
    }
    
    /* re-size employer logos */
    .job-logo {
        width: 140px;
    }

    .job-logo img {
        max-height: 64px;
    }

    #tools .tech-logos img {
        width: 64px;
    }
    
    /* re-size iconography*/
    .modal-link {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 56px;
        height: 56px;
    }

    .modal-link img {
        max-width: 50px;
    }

    footer a {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 56px;
        height: 56px;
    }

    footer img {
        width: 50px;
    }

    #top-arrow {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }
}

/*####################################
######################################
########### MOBILE STYLING ###########
######################################
####################################*/
@media (max-width: 767px) {
    /* re-size text */
    body {
        line-height: 1.7;
    }

    /* re-size employer logos */
    .job {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .job-logo {
        width: 160px;
        margin-bottom: 12px;
    }

    .job-date {
        text-align: center;
    }

    /* employer & work dates on separate lines */
    .job-header {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    #tools .tech-logos img {
        width: 72px;
    }
}

/*####################################
######################################
################ BOTH ################
######################################
####################################*/
@media (max-width: 1200px) {
    /* hamburger menu */
    .nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        padding: 1rem;

        flex-direction: column;

        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;

        transition: transform 0.25s ease-out, opacity 0.2s ease-out;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-actions {
        margin-left: auto;
    }
}