*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Custom Properties - Enhanced Color Scheme */
:root {
    /* Typography */
    --ff-primary: 'Inter', 'Source Sans Pro', system-ui, -apple-system, sans-serif;
    --ff-secondary: 'JetBrains Mono', 'Source Code Pro', 'Fira Code', monospace;
    --ff-heading: 'Poppins', 'Inter', sans-serif;

    /* Font Weights */
    --fw-light: 300;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 900;

    /* Modern Color Palette */
    --clr-light: #f8f9fa;
    --clr-off-white: #ffffff;
    --clr-dark: #1a1a2e;
    --clr-gray: #6c757d;
    --clr-gray-light: #e9ecef;

    /* Accent Colors - Professional Blue/Teal */
    --clr-primary: #0066cc;
    --clr-primary-light: #4d94ff;
    --clr-primary-dark: #004c99;
    --clr-accent: #00b4d8;
    --clr-accent-light: #90e0ef;
    --clr-success: #06d6a0;

    /* Text Colors */
    --clr-text-primary: #1a1a2e;
    --clr-text-secondary: #495057;
    --clr-text-light: #6c757d;

    /* Font Sizes - Fluid Typography */
    --fs-h1: clamp(2.5rem, 5vw + 1rem, 4.5rem);
    --fs-h2: clamp(2rem, 4vw + 1rem, 3.5rem);
    --fs-h3: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem);
    --fs-h4: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);
    --fs-body: clamp(1rem, 1vw + 0.5rem, 1.125rem);
    --fs-small: 0.875rem;
    --fs-extra-small: 0.75rem;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    --spacing-2xl: 8rem;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Reset & Base Styles */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--clr-light);
    color: var(--clr-text-primary);
    margin: 0;
    font-family: var(--ff-primary);
    font-size: var(--fs-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

section {
    padding: var(--spacing-xl) var(--spacing-md);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

strong {
    font-weight: var(--fw-bold);
}

:focus {
    outline: 3px solid var(--clr-accent);
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Selection */
::selection {
    background: var(--clr-accent-light);
    color: var(--clr-dark);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75em 2em;
    background: var(--clr-primary);
    color: white;
    text-decoration: none;
    cursor: pointer;
    font-size: var(--fs-body);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn:hover,
.btn:focus {
    background: var(--clr-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn--secondary {
    background: transparent;
    color: var(--clr-primary);
    border-color: var(--clr-primary);
}

.btn--secondary:hover {
    background: var(--clr-primary);
    color: white;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    margin: 0;
    font-family: var(--ff-heading);
    font-weight: var(--fw-bold);
}

h1 {
    font-size: var(--fs-h1);
}

h2 {
    font-size: var(--fs-h2);
}

h3 {
    font-size: var(--fs-h3);
}

h4 {
    font-size: var(--fs-h4);
}

p {
    margin-top: 0;
    margin-bottom: 1em;
}

.section__title {
    margin-bottom: 0.5em;
    position: relative;
}

.section__subtitle {
    margin: 0;
    font-size: var(--fs-h4);
    font-weight: var(--fw-medium);
}

.section__subtitle--intro,
.section__subtitle--about {
    background: linear-gradient(135deg, var(--clr-accent) 0%, var(--clr-primary-light) 100%);
    padding: 0.5em 1em;
    font-family: var(--ff-secondary);
    margin-bottom: 1.5em;
    border-radius: var(--radius-md);
    color: white;
    display: inline-block;
}

.section__subtitle--work {
    color: var(--clr-accent-light);
    font-weight: var(--fw-semibold);
    margin-bottom: 2em;
}

/* Header & Navigation */
.uberbar {
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--clr-gray-light);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: var(--fw-bold);
    color: var(--clr-primary);
    text-decoration: none;
    font-family: var(--ff-heading);
    transition: color var(--transition-fast);
}

.logo:hover {
    color: var(--clr-accent);
}

/* Mobile Navigation */
.nav {
    position: fixed;
    background: var(--clr-dark);
    color: var(--clr-light);
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__list {
    list-style: none;
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: var(--spacing-md);
}

.nav__link {
    color: inherit;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-h3);
    text-decoration: none;
    position: relative;
    padding: 0.5em;
    transition: color var(--transition-base);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--clr-accent);
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

.nav__link:hover,
.nav__link:focus {
    color: var(--clr-accent);
}

.nav__link:hover::after {
    width: 100%;
}

.nav-toggle {
    padding: 0.5em;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: calc(var(--z-modal) + 10);
    transition: transform var(--transition-base);
}

.nav-toggle:hover {
    transform: scale(1.1);
}

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

.nav-open .nav-toggle {
    position: fixed;
    right: 1.5em;
    top: 1.5em;
}

/* Hamburger Animation */
.hamburger {
    display: block;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    background: var(--clr-primary);
    width: 2em;
    height: 3px;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
}

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

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

.nav-open .hamburger {
    transform: rotate(225deg);
    background: var(--clr-accent);
}

.nav-open .hamburger::before {
    transform: rotate(90deg) translate(8px);
    background: var(--clr-accent);
}

.nav-open .hamburger::after {
    opacity: 0;
}

/* Desktop Navigation */
@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }

    .nav {
        position: static;
        transform: none;
        background: transparent;
        color: var(--clr-text-primary);
    }

    .nav__list {
        flex-direction: row;
        height: auto;
        gap: var(--spacing-md);
    }

    .nav__link {
        font-size: var(--fs-body);
        color: var(--clr-text-secondary);
    }

    .nav__link:hover {
        color: var(--clr-primary);
    }
}

/* Intro Section */
.intro {
    position: relative;
    padding-top: calc(var(--spacing-xl) + 4rem);
}

.intro__img {
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    object-fit: cover;
}

@media (min-width: 768px) {
    .intro {
        display: grid;
        width: min-content;
        margin: 0 auto;
        grid-column-gap: 2em;
        grid-template-areas:
            "img title"
            "img subtitle";
        grid-template-columns: min-content max-content;
    }

    .intro__img {
        grid-area: img;
        min-width: 280px;
        position: relative;
        z-index: 2;
    }

    .section__subtitle--intro {
        align-self: start;
        grid-column: -1 / 1;
        grid-row: 2;
        text-align: right;
        position: relative;
        left: -1.5em;
        width: calc(100% + 1.5em);
    }
}

/* Projects Section */
.my-projects {
    background: linear-gradient(135deg, var(--clr-dark) 0%, #16213e 100%);
    color: var(--clr-light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.my-projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url(../img/blue_tarp.jpg) center/cover;
    opacity: 0.1;
    z-index: 0;
}

.my-projects>* {
    position: relative;
    z-index: 1;
}

.section__title--projects {
    color: var(--clr-accent-light);
    position: relative;
}

.section__title--projects::after {
    content: '';
    display: block;
    width: 3em;
    height: 3px;
    margin: 0.75em auto 1.5em;
    background: linear-gradient(90deg, transparent, var(--clr-accent), transparent);
    border-radius: var(--radius-full);
}

.projects {
    margin-bottom: 4em;
}

.project {
    max-width: 500px;
    margin: 0 auto 3em;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    background: rgba(255, 255, 255, 0.08);
}

.project h3 {
    color: var(--clr-accent-light);
    margin-bottom: 0.5em;
}

.project p {
    font-size: var(--fs-body);
    line-height: 1.7;
}

@media (min-width: 768px) {
    .projects {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-md);
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    .project {
        margin-bottom: 0;
        flex: 1 1 300px;
        max-width: 500px;
    }
}

/* Links */
.hidden_link,
.simcode_link {
    color: var(--clr-accent-light);
    transition: color var(--transition-fast);
}

.hidden_link {
    text-decoration: none;
}

.hidden_link:hover,
.simcode_link:hover {
    color: var(--clr-accent);
    text-decoration: underline;
}

/* About Me Section */
.about-me {
    max-width: 1200px;
    margin: 0 auto;
}

.about-me__img {
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}

.about-me__body {
    font-size: var(--fs-body);
    line-height: 1.8;
}

@media (min-width: 768px) {
    .about-me {
        display: grid;
        grid-template-columns: 1fr 300px;
        grid-template-areas:
            "title img"
            "subtitle img"
            "text img";
        grid-column-gap: 3em;
    }

    .section__title--about {
        grid-area: title;
    }

    .section__subtitle--about {
        grid-column: 1 / -1;
        grid-row: 2;
        position: relative;
        left: -1em;
        width: calc(100% + 2em);
        padding-left: 1em;
        padding-right: calc(300px + 2em);
    }

    .about-me__img {
        grid-area: img;
        position: relative;
        z-index: 2;
    }
}

/* My Work Section */
.my-work {
    background: var(--clr-dark);
    color: var(--clr-light);
    text-align: center;
}

.section__title--work {
    color: var(--clr-accent-light);
}

.section__subtitle--work {
    color: var(--clr-gray-light);
}

.section__subtitle--work::after {
    content: '';
    display: block;
    width: 6em;
    height: 3px;
    margin: 0.75em auto 1.5em;
    background: linear-gradient(90deg, transparent, var(--clr-accent), transparent);
    border-radius: var(--radius-full);
}

.work {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
    max-width: 1400px;
    margin: 0 auto;
}

.work__item {
    background: var(--clr-light);
    overflow: hidden;
    border-radius: var(--radius-lg);
    position: relative;
    transition: all var(--transition-base);
    flex: 1 1 300px;
    max-width: 500px;
}

.work__item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-accent) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.work__item:hover::after {
    opacity: 0.2;
}

.work__img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.work__item:hover .work__img {
    transform: scale(1.1);
}

.work__item:focus {
    position: relative;
    z-index: 2;
}

/* Footer */
.footer {
    background: #0a0a0a;
    color: var(--clr-accent-light);
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

.footer a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.footer__link {
    font-weight: var(--fw-semibold);
    font-size: var(--fs-h4);
}

.footer__link:hover,
.social-list__link:hover {
    color: var(--clr-accent);
}

.footer__link:hover {
    text-decoration: underline;
}

.social-list {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 2em 0 0;
    padding: 0;
    gap: var(--spacing-sm);
}

.social-list__link {
    padding: 0.75em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    transition: all var(--transition-base);
}

.social-list__link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* Work Item Individual Page */
.work-item-individual {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: 1000px;
    margin: 0 auto;
}

.work-item-individual p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Utility Classes */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Print Styles */
@media print {

    .nav,
    .nav-toggle,
    .footer {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }
}