/* ==================== */
/* FONT IMPORTS */
/* ==================== */

@import url('https://fonts.googleapis.com/css2?family=Azo+Sans:wght@400;500;600;700&family=Azo+Mono&display=swap');

/* ==================== */
/* GLOBAL STYLES */
/* ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #000000;
    --white: #ffffff;
    /* Only --black and --white are used for color now */
    --spacing-unit: clamp(8px, 1.2vw, 16px);
    --padding-horizontal: clamp(24px, 5vw, 80px);
    --font-main: 'Azo Sans', sans-serif;
    --font-mono: 'Azo Mono', monospace;
    --font-size-base: 0.95rem;
    font-family: var(--font-main);
    color: var(--black);
    line-height: 1.2;
    background-color: #ffffff;
}

html,
body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-main);
    color: var(--black);
    line-height: 1.6;
    background-color: #ffffff;
}

p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--black);
    margin-bottom: var(--spacing-unit);
    margin-top: 0;
    font-family: var(--font-main);
    text-align: left;
    font-weight: 400;

    hyphens: auto;
    overflow-wrap: break-word;
    text-wrap: pretty;
}

a,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-mono);
}

a {
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
    transition: text-decoration 0.3s ease, opacity 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

a img {
    transition: opacity 0.3s ease;
}

a img:hover {
    opacity: 0.8;
}

h1 {
    font-size: 2.625rem;
    color: var(--black);
}

h2 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-unit);
    color: var(--black);
}

h3 {
    font-size: 1rem;
}

main.container {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    color: var(--white);
}

.container {
    max-width: clamp(320px, 90vw, 90vw);
    margin: 0 auto;
    padding-left: 5vw;
    padding-right: 5vw;
}

/* ==================== */
/* NAVIGATION */
/* ==================== */

.navbar {
    background-color: var(--white);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 0.75) 5vw;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    max-height: clamp(50px, 8vw, 80px);
    width: auto;
    transition: opacity 0.3s ease;
    display: block;
}

.logo:hover img {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .logo img {
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    .logo img {
        max-height: 35px;
    }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
}

.nav-links a {
    color: var(--black);
    font-weight: 500;
    position: relative;
}

.nav-links a.active {
    color: var(--black);
}

/* ==================== */
/* PORTFOLIO GRID */
/* ==================== */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit));
    padding: calc(var(--spacing-unit) * 4) 0;
}

.portfolio-item {
    overflow: hidden;
    transition: all 0.3s ease;
    height: auto;
    background-color: var(--white);
    position: relative;
}

.portfolio-item a {
    display: block;
}

.portfolio-item:hover {
    filter: invert(1);
}

.portfolio-image {
    width: 100%;
    height: auto;
    object-position: center;
    background-color: #f5f5f5;
    display: block;
    transition: transform 0.3s ease;
}



.portfolio-info h3 {
    font-size: 1.125rem;
    color: var(--black);
    margin: 0;
}

.portfolio-info p {
    padding-top: 0.25rem;
}

/* ==================== */
/* UTILITY CLASSES */
/* ==================== */

.flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

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

.link-primary {
    color: var(--black);
    font-weight: 500;
}

.heading-large {
    font-size: 2.625rem;
    color: var(--black);
}

/* ==================== */
/* PROJECT DETAIL PAGE */
/* ==================== */

.project-header {
    padding: calc(var(--spacing-unit) * 2) 0;
}

.project-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: var(--spacing-unit);
    margin-bottom: 0.25em;
}

.project-header-collumn {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: var(--spacing-unit);
    margin-bottom: var(--spacing-unit);
    padding-bottom: calc(var(--spacing-unit) * 2);
}

.project-header-collumn .project-meta {
    width: 100%;
    justify-content: space-between;
    gap: 0;
    padding: 0;
    margin: 0;
}

.project-header-collumn .project-meta li {
    padding: 0;
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--black);
    font-weight: 600;
    white-space: nowrap;
}

.project-detail {
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: calc(var(--spacing-unit));
    align-items: start;
    padding-bottom: var(--spacing-unit);
}

.project-section {
    grid-column: 1;
    margin-bottom: calc(var(--spacing-unit) * 4);
    padding-right: calc(var(--spacing-unit) * 2);
    position: sticky;
    top: calc(var(--spacing-unit) * 2);
    align-self: start;
    z-index: 10;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
}

.project-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-unit);
}

.gallery-item {
    flex: 0 1 calc(50% - var(--spacing-unit));
    max-width: calc(50% - var(--spacing-unit));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.gallery-item--wide {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    display: block;
}

.gallery-item div {
    width: 100%;
}

.gallery-item h3 {
    width: 100%;
    padding: calc(var(--spacing-unit) * 0.75) var(--spacing-unit);
    margin: 0;
    font-size: 1rem;
    background-color: var(--white);
}

/* ==================== */
/* TECH STACK */
/* ==================== */

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    display: inline-block;
    background-color: var(--white);
    color: var(--black);
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--black);
    transition: all 0.3s ease;
}

/* ==================== */
/* PROJECT NAVIGATION */
/* ==================== */

.project-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-unit);
    margin: calc(var(--spacing-unit) * 4) 0;
    padding-top: calc(var(--spacing-unit) * 3);
}

.nav-arrow {
    flex: 1;
    padding: calc(var(--spacing-unit) * 1.5);
    color: var(--black);
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Minimal prev/next nav used on generated project pages */
.project-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: calc(var(--spacing-unit) * 4);
    padding-bottom: calc(var(--spacing-unit) * 1);
    border-top: 1px solid #e0e0e0;
}

.project-nav .nav-arrow {
    flex: unset;
    padding: 0;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 400;
    text-decoration: none;
    color: var(--black);
    display: inline;
    justify-content: unset;
}

.project-nav .nav-arrow:hover {
    background: transparent;
    color: var(--black);
}

.project-nav .nav-arrow.disabled {
    visibility: hidden;
}

/* Gallery spacer (empty row) */
.gallery-spacer {
    flex: 0 0 100%;
    max-width: 100%;
    min-height: calc(var(--spacing-unit) * 3);
    box-sizing: border-box;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: calc(var(--spacing-unit) * 0.5);
}

.gallery-spacer--labeled {
    grid-column: 1 / span 2;
}

.gallery-spacer-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
}

/* Project metadata list */
.project-meta {
    list-style: none;
    margin-bottom: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.project-meta .meta-label {
    font-weight: 700;
    margin-right: 0.4em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== */
/* ABOUT PAGE */
/* ==================== */

.about-section {
    padding-top: calc(var(--spacing-unit) * 4);
    padding-bottom: calc(var(--spacing-unit) * 4);
    margin: 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 4);
    align-items: start;
}

.about-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: cover;
}

.about-content {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 0;
}

.about-content h1 {
    margin-bottom: var(--spacing-unit);
}

.about-content p {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    line-height: 1.6;
}

/* ==================== */
/* FOOTER */
/* ==================== */

.footer {
    background-color: var(--black);
    color: var(--white);
    text-align: center;
    padding: calc(var(--spacing-unit) * 1) 0;
    margin-top: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-unit);
    color: var(--white);
}

.footer-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.footer-logo img {
    max-height: clamp(50px, 8vw, 80px);
    width: auto;
    transition: opacity 0.3s ease;
    display: block;
    opacity: 1;
}
.footer-nav {
    display: flex;
    list-style: none;
    text-decoration: none;
    gap: calc(var(--spacing-unit) * 1.5);
    margin: 0;
    padding: 0;
    color: var(--white);
}
.footer-nav a {
    opacity: 1;
}

/* Footer text color overrides */
.footer p {
    color: var(--white);
}

.footer a {
    color: var(--white);
}

/* ==================== */
/* RESPONSIVE DESIGN */
/* ==================== */

@media (min-width: 1680px) {
    :root {
        --spacing-unit: clamp(12px, 2vw, 24px);
        --font-size-base: 1.25rem;
    }

    .container {
        padding-left: 0.5vw;
        padding-right: 0.5vw;
    }

}

@media (min-width: 1440px) {
    .container {
        padding-left: 0.5vw;
        padding-right: 0.5vw;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.25rem;
    }

    .project-detail h1 {
        font-size: 2rem;
    }

    .project-meta {
        grid-template-columns: 1fr;
    }

    .project-navigation {
        flex-direction: column;

    }

    .nav-links {
        gap: var(--spacing-unit);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 2);
    }

    .about-content h1 {
        font-size: 1.875rem;
    }
}

@media (max-width: 480px) {
    .navbar .container {
        flex-direction: column;
        gap: var(--spacing-unit);
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero {
        padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .project-detail h1 {
        font-size: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}