/* ==========================================================================
   TABLE OF CONTENTS
   ==========================================================================
   1. Variables (:root)
   2. Reset & Base Styles
   3. Typography
   4. Layout & Global Elements
   5. Components
      - Navigation & Hero
      - Education
      - Certifications
      - Projects
      - Modals
      - Tables
   6. Utilities
   7. Animations
   8. Media Queries (Responsive)
   9. Print Styles
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES
   ========================================================================== */
:root {
    /* Colors */
    --color-obsidian-900: #121412;
    --color-obsidian-900-overlay: #121412f2;
    --color-charcoal-950: #050605;

    --color-sage-500: #a3be8c;
    --color-sage-500-40: #a3be8c66;
    --color-sage-500-20: #a3be8c33;
    --color-olive-600: #607550;

    --color-ice-50: #e5e9f0;
    --color-silver-200: #c0c5ce;
    --color-slate-300: #8f9fa8;
    --color-gray-500: #666666;

    --color-black: #000000;
    --color-black-20: #00000033;
    --color-black-80: #000000cc;

    --color-white: #ffffff;
    --color-white-15: #ffffff26;

    /* Fonts */
    --font-header: VT323, monospace;
    --font-main: 'Fira Code', monospace;

    /* Effects */
    --shadow-glow-sage: 0 0 8px var(--color-sage-500-40);
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--color-obsidian-900);
    color: var(--color-sage-500);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 0;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1,
h2,
h3 {
    font-family: var(--font-header);
    font-weight: 400;
    text-shadow: var(--shadow-glow-sage);
    text-transform: uppercase;
}

h1,
h3 {
    color: var(--color-ice-50);
    margin-bottom: .5rem;
    margin-top: auto;
}

h1 {
    font-size: 3.5rem;
    line-height: 1;
}

h2 {
    border-bottom: 2px solid var(--color-olive-600);
    color: var(--color-sage-500);
    font-size: 2rem;
    margin-top: 3rem;
    padding-bottom: .5rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    color: var(--color-silver-200);
    font-size: 1rem;
    margin: 1.25rem 0;
}

a {
    color: var(--color-sage-500);
    text-decoration: none;
    transition: all .3s ease;
}

a:hover {
    background-color: var(--color-sage-500-20);
    box-shadow: var(--shadow-glow-sage);
    color: var(--color-ice-50);
}

/* ==========================================================================
   4. LAYOUT & GLOBAL ELEMENTS
   ========================================================================== */
.container {
    margin: 0 auto;
    max-width: 900px;
    padding: 5rem 2rem 2rem;
    position: relative;
    z-index: 1;
}

.bg-image {
    background-image: url(../images/background/marita-kavelashvili-ugnrXk1129g-unsplash.jpg);
    background-position: center;
    background-size: cover;
    filter: blur(6px) brightness(.3) grayscale(40%);
    height: 100vh;
    left: 0;
    position: fixed;
    top: 0;
    transform: scale(1.1);
    width: 100vw;
    z-index: -1;
}

header {
    padding: 2.5rem 0 1.5rem;
}

footer {
    border-top: 1px solid var(--color-olive-600);
    color: var(--color-ice-50);
    font-size: .8rem;
    margin-top: 4rem;
    opacity: .7;
    padding-top: 2rem;
    text-align: center;
}

footer * {
    font-size: inherit;
}

/* ==========================================================================
   5. COMPONENTS
   ========================================================================== */

/* Navigation & Hero
   -------------------------------------------------- */
.hero-panel,
.top-nav {
    display: flex;
    justify-content: center;
}

.top-nav {
    background: var(--color-charcoal-950);
    border-bottom: 2px solid var(--color-olive-600);
    box-shadow: 0 4px 12px var(--color-black-80);
    color: var(--color-ice-50);
    flex-wrap: wrap;
    font-size: .9rem;
    gap: 1rem;
    left: 0;
    padding: .9rem 1.5rem;
    position: fixed;
    right: 0;
    text-transform: uppercase;
    top: 0;
    width: 100%;
    z-index: 100;
}

.top-nav a {
    border-bottom: none;
    letter-spacing: .05em;
    padding-bottom: .1rem;
}

.top-nav a:focus,
.top-nav a:hover {
    text-shadow: var(--shadow-glow-sage);
}

/* Mobile Hamburger Menu (Structure) */
#mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
}

/* Education
   -------------------------------------------------- */
.education-card {
    border-left: 2px solid var(--color-olive-600);
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.education-meta {
    color: var(--color-slate-300);
    font-family: var(--font-main);
    font-size: .9rem;
    margin-bottom: 1rem;
}

.edu-achievements {
    color: var(--color-silver-200);
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.edu-dropdown-toggle {
    align-items: center;
    background: 0 0;
    border: 0;
    border-radius: .35rem;
    color: inherit;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: .5rem;
    padding: .05rem .8rem;
    text-align: left;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
    width: 100%;
}

.edu-dropdown-toggle:focus-visible,
.edu-dropdown-toggle:hover {
    background: var(--color-sage-500-20);
    box-shadow: inset 0 0 0 1px var(--color-sage-500-40);
    color: var(--color-ice-50);
    outline: 0;
}

.dropdown-arrow {
    display: inline-flex;
    font-size: 1.5rem;
    transition: transform .2s ease;
}

.edu-dropdown.open .dropdown-arrow {
    transform: rotate(90deg);
}

.edu-dropdown-panel {
    color: var(--color-ice-50);
    margin-left: 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.edu-dropdown.open .edu-dropdown-panel {
    padding-bottom: .5rem;
}

/* Certifications
   -------------------------------------------------- */
.certs-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.cert-badge {
    width: 200px;
    height: 200px;
}

.cert-tag {
    background: var(--color-black-20);
    border: 1px solid var(--color-olive-600);
    color: var(--color-ice-50);
    font-size: .9rem;
    padding: .25rem .75rem;
    transition: .2s;
}

.cert-tag:hover {
    background: var(--color-sage-500-20);
    border-color: var(--color-sage-500);
    cursor: default;
}

/* Projects
   -------------------------------------------------- */
.projects-grid {
    display: grid;
    gap: 1.5rem;
}

.project-card {
    background: var(--color-black-20);
    border: 1px solid var(--color-olive-600);
    padding: 1.5rem;
    transition: .2s;
}

.project-image {
    background: var(--color-charcoal-950);
    border: 1px solid var(--color-olive-600);
    border-radius: .45rem;
    box-shadow: 0 6px 18px var(--color-black-80), 0 0 20px var(--color-sage-500-20);
    display: block;
    height: auto;
    margin: 1rem auto;
    max-width: 460px;
    padding: .15rem;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    width: 100%;
}

.project-image:hover {
    border-color: var(--color-sage-500);
    box-shadow: 0 12px 28px var(--color-black), 0 0 30px var(--color-sage-500-20);
    transform: translateY(-4px) scale(1.01);
}

.project-image-caption {
    color: var(--color-ice-50);
    font-size: .75rem;
    letter-spacing: .05em;
    margin-top: .5rem;
    opacity: .75;
    text-align: center;
    text-transform: uppercase;
}

/* Modals
   -------------------------------------------------- */
.image-modal {
    align-items: center;
    background: var(--color-black-80);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 2rem;
    pointer-events: none;
    position: fixed;
    transition: opacity .2s ease;
    z-index: 1000;
}

.image-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.image-modal img {
    border-radius: .35rem;
    box-shadow: 0 10px 30px var(--color-black);
    height: auto;
    max-height: 85vh;
    max-width: min(90vw, 1100px);
    width: auto;
}

/* Tables
   -------------------------------------------------- */
.course-table-wrapper {
    overflow-x: auto;
}

.course-table {
    border-collapse: collapse;
    font-size: .9rem;
    width: 100%;
}

.course-table td,
.course-table th {
    border-bottom: 1px solid var(--color-white-15);
    padding: .35rem .5rem;
    text-align: left;
}

.course-table th {
    color: var(--color-sage-500);
    font-size: .85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.course-table td:first-child {
    white-space: nowrap; /* keep course prefix and catalog number on the same line */
}

/* ==========================================================================
   6. UTILITIES
   ========================================================================== */
.unstyled-link {
    background-color: transparent;
    border-bottom: none;
    box-shadow: none;
    text-decoration: none;
}

.unstyled-link:hover {
    background-color: transparent;
    border-bottom: none;
    box-shadow: none;
    text-decoration: none;
}

.text-small {
    font-size: .9rem;
}

.text-smaller {
    font-size: .7rem;
}

.text-accent {
    color: var(--color-sage-500);
    margin-top: 0;
}

.cmd-prompt {
    color: var(--color-ice-50);
    opacity: .7;
}

/* ==========================================================================
   7. ANIMATIONS
   ========================================================================== */
@keyframes menuTopLineOpen {
    0% { top: 0px; transform: rotate(0deg); }
    50% { top: 11px; transform: rotate(0deg); }
    100% { top: 11px; transform: rotate(45deg); }
}

@keyframes menuMiddleLineOpen {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes menuBottomLineOpen {
    0% { top: 22px; transform: rotate(0deg); }
    50% { top: 11px; transform: rotate(0deg); }
    100% { top: 11px; transform: rotate(-45deg); }
}

@keyframes menuTopLineClose {
    0% { top: 0px; transform: rotate(0deg); }
    50% { top: 11px; transform: rotate(0deg); }
    100% { top: 11px; transform: rotate(45deg); }
}

@keyframes menuMiddleLineClose {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes menuBottomLineClose {
    0% { top: 22px; transform: rotate(0deg); }
    50% { top: 11px; transform: rotate(0deg); }
    100% { top: 11px; transform: rotate(-45deg); }
}

/* ==========================================================================
   8. MEDIA QUERIES
   ========================================================================== */

/* Mobile Layout
   -------------------------------------------------- */
@media (max-width:600px) {
    h1 {
        font-size: 2.5rem;
    }

    .container {
        padding: 4rem 1rem 1rem;
    }

    /* Mobile Menu Controls */
    #mobile-menu-toggle {
        background: 0 0;
        border: 0;
        cursor: pointer;
        display: block;
        padding: 10px;
        position: fixed;
        right: 1rem;
        top: 1rem;
        z-index: 200;
    }

    .hamburger-box {
        display: inline-block;
        height: 24px;
        position: relative;
        width: 30px;
    }

    .hamburger-top,
    .hamburger-middle,
    .hamburger-bottom {
        background-color: var(--color-sage-500);
        border-radius: 2px;
        display: block;
        height: 2px;
        position: absolute;
        width: 30px;
    }

    .hamburger-top { top: 0px; }
    .hamburger-middle { top: 11px; }
    .hamburger-bottom { top: 22px; }

    /* Animation Triggers */
    #mobile-menu-toggle.open .hamburger-top {
        animation: .2s linear 0s 1 normal forwards running menuTopLineOpen;
    }
    #mobile-menu-toggle.open .hamburger-middle {
        animation: .2s linear 0s 1 normal forwards running menuMiddleLineOpen;
    }
    #mobile-menu-toggle.open .hamburger-bottom {
        animation: .2s linear 0s 1 normal forwards running menuBottomLineOpen;
    }

    #mobile-menu-toggle.closed .hamburger-top {
        animation: .2s linear 0s 1 reverse backwards running menuTopLineClose;
    }
    #mobile-menu-toggle.closed .hamburger-middle {
        animation: .2s linear 0s 1 reverse backwards running menuMiddleLineClose;
    }
    #mobile-menu-toggle.closed .hamburger-bottom {
        animation: .2s linear 0s 1 reverse backwards running menuBottomLineClose;
    }

    /* Navigation Transformation */
    .top-nav {
        align-items: center;
        backdrop-filter: blur(10px);
        background: var(--color-obsidian-900-overlay);
        border-bottom: none;
        flex-direction: column;
        font-size: 1.5rem;
        gap: 2rem;
        height: 100vh;
        justify-content: center;
        left: 0;
        padding: 2rem;
        position: fixed;
        top: 0;
        transform: translateY(-100%);
        transition: transform .3s ease-in-out;
        width: 100%;
    }

    .top-nav.open {
        transform: translateY(0);
    }

    .top-nav a {
        padding: .5rem 1rem;
        text-align: center;
        width: 100%;
    }
}

/* Desktop Only Overrides
   -------------------------------------------------- */
@media (min-width: 601px) {
    #mobile-menu-toggle {
        display: none;
    }
}

/* ==========================================================================
   9. PRINT STYLES
   ========================================================================== */
@page {
    margin: .6in
}

@media print {
    :root {
        --color-sage-500: var(--color-black);
        --color-olive-600: var(--color-black);
        --color-ice-50: var(--color-black);
        --color-silver-200: var(--color-black);
        --color-slate-300: var(--color-black);
    }

    body {
        background: var(--color-white);
        color: var(--color-black);
        font-size: 12pt;
        line-height: 1.4;
        margin: 0;
        overflow: visible;
    }

    .container {
        background: var(--color-white);
        box-shadow: none;
        max-width: 100%;
        padding: 0;
    }

    /* Hide decorative/interactive elements */
    .bg-image,
    .top-nav,
    #mobile-menu-toggle,
    .image-modal,
    .cmd-prompt {
        display: none !important;
    }

    h1,
    h2,
    h3 {
        color: var(--color-black);
        text-shadow: none;
    }

    a,
    a:visited {
        background: 0 0;
        box-shadow: none;
        color: var(--color-black);
        text-decoration: none;
        text-shadow: none;
    }

    a[href^="http"],
    a[href^="mailto:"] {
        word-break: break-all;
    }

    .projects-grid,
    .certs-grid {
        display: block;
    }

    .projects-grid,
    .education-card,
    .cert-badge,
    .cert-tag {
        background: var(--color-white);
        border-color: var(--color-white);
        box-shadow: none;
        break-inside: auto;
    }

    .edu-dropdown,
    .project-card,
    .project-media {
        background: var(--color-white);
        border-color: var(--color-white);
        break-inside: avoid;
    }

    .project-image {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    footer {
        border-color: var(--color-gray-500);
        color: var(--color-black);
        margin-top: .5rem;
        opacity: 1;
        padding-top: .5rem;
    }
}
