/* CSS Variables for consistent styling */
:root {
    --bg-color: #121212;
    --text-primary: #8BC5BF;
    --text-title: #E29BA8;
    --font-mono: 'IBM Plex Mono', monospace;
    --max-width: 75rem;
    --padding-x: 4rem;
    --padding-y: 4rem;
    --gap-spacing: 2rem;
    --border-radius: 1.5rem;
    --border-color: rgba(61, 61, 61, 0.212);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: #e2f0f0;
    font-family: var(--font-mono);
    line-height: 1.75;
    font-size: 16pt;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: underline;
    transition: color 0.25s ease;
}

a:hover {
    text-decoration: none;
}

/* Layout */
.site-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.site-main {
    width: 100%;
    display: flex;
    justify-content: center;
}

.inner-container {
    width: 100%;
    max-width: var(--max-width);
    padding: var(--padding-y) var(--padding-x);
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Typography */
.heading-primary {
    color: var(--text-title);
    font-size: 2.25rem;
    font-weight: 300;
    line-height: 1.375;
    margin-bottom: 1rem;
}

.text-body {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

/* Containers */
.section-container {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: var(--padding-y) var(--padding-x);
}

.section-title {
    text-align: center;
    margin-bottom: -2rem; /* Pull section content closer */
}

/* Hero Section */
.hero-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.profile-image-container {
    flex: 0 0 20%;
    max-width: 20%;
}

.profile-image {
    width: 100%;
    border-radius: 0; /* original doesn't seem to have border radius on this image */
    display: block;
}

.bio-container {
    flex: 0 0 80%;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 1.25rem;
    margin-top: 2rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.25s ease;
    text-decoration: none;
}

.social-icon svg {
    width: 60%;
    height: 60%;
    fill: #3D3D3D;
    transition: fill 0.25s ease;
}

.social-icon:hover {
    border-color: #000000;
    background-color: rgba(255, 255, 255, 0.05);
}

.social-icon:hover svg {
    fill: #000000;
}

/* Projects Grid */
.games-grid, .tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
}

.project-item {
    flex: 1 1 0%;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.project-item.full-width {
    flex: 1 1 100%;
}

.project-header-info {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-title-main {
    font-size: 1.25rem;
    color: var(--text-title);
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.project-tag {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
    background-color: rgba(139, 197, 191, 0.1);
    border: 1px solid rgba(139, 197, 191, 0.3);
    padding: 0.4rem 0.75rem;
    border-radius: 0.35rem;
    line-height: 1.2;
}

.project-thumbnail {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 19.125rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.25s ease;
}

.project-thumbnail:hover .thumbnail-image {
    transform: scale(1.06);
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem;
    pointer-events: none;
    font-size: 0.95rem;
    line-height: 1.5;
}

.project-thumbnail:hover .thumbnail-overlay {
    opacity: 1;
}

.hover-list {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0 0 0 1rem;
}

.hover-list li {
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0;
    list-style-type: disc;
}

/* Divider */
.divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 3rem 0;
}

/* Credits */
.credits {
    text-align: center;
    margin-top: 2rem;
}

.credits a {
    color: rgba(226, 155, 168, 0.5);
    font-size: 0.75rem;
    font-family: Arial, sans-serif;
    text-decoration: none;
    transition: color 0.25s ease;
}

.credits a:hover {
    color: white;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.9);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-modal.visible {
    opacity: 1;
    visibility: visible;
}

.lightbox-inner {
    width: 90%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.lightbox-modal.visible .lightbox-image {
    transform: translateY(0);
}

.lightbox-caption {
    color: white;
    margin-top: 1.5rem;
    text-align: center;
    max-width: 800px;
    padding: 0 2rem;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCI+PGxpbmUgeDE9IjIwIiB5MT0iMjAiIHgyPSI0NCIgeTI9IjQ0IiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz48bGluZSB4MT0iMjAiIHkxPSI0NCIgeDI9IjQ0IiB5Mj0iMjAiIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg==');
    background-size: cover;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .games-grid, .tools-grid {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-image-container {
        max-width: 50%;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .inner-container {
        gap: 2rem;
        padding: 1rem;
    }
    
    .project-item {
        min-width: 100%;
    }
    
    /* Simulate zooming out on BlueprintUE iframes by making them 1.5x larger and scaling down */
    .content-placeholder:has(iframe[src*="blueprintue"]) {
        position: relative;
        height: 350px;
    }
    
    .content-placeholder iframe[src*="blueprintue"] {
        position: absolute;
        top: 0;
        left: 0;
        width: 150% !important;
        height: 525px !important;
        transform: scale(0.666666);
        transform-origin: 0 0;
    }
}

/* Project Layout Styles */
.portfolio-header {
    margin-bottom: 1rem;
    display: flex;
}

.portfolio-close {
    color: var(--text-title);
    white-space: nowrap;
    align-items: center;
    font-size: 1.125rem;
    text-decoration: none;
    display: inline-flex;
    transition: color 0.25s ease;
}

.portfolio-close:hover {
    color: #fff;
}

.portfolio-top {
    margin-bottom: 2rem;
}

.hero-image-placeholder {
    width: 100%;
    background-color: var(--border-color);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    overflow: hidden;
}

.hero-image {
    width: 100%;
    display: block;
    object-fit: cover;
}

.portfolio-top h2 {
    color: var(--text-primary);
    background-color: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    margin-top: -3rem; /* overlap the image */
    padding: 1rem 1.5rem;
    font-size: 2rem;
    position: relative;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    display: block;
    margin-left: 0;
    margin-right: 0;
}

/* Code Blocks */
pre {
    background-color: rgba(10, 10, 10, 0.8);
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: #e2f0f0;
}

/* Inline code specifically */
p > code, li > code {
    background-color: rgba(10, 10, 10, 0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

.experience {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.job-card {
    background-color: rgba(35, 35, 35, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    flex: 1 1 calc(50% - 1rem);
    min-width: 300px;
}

.job-card h3 {
    font-size: 1.5rem;
    color: var(--text-title);
    margin-bottom: 1rem;
    font-weight: 500;
}

.job-card p {
    font-size: 1rem;
    line-height: 1.6;
}

.project-info-list {
    list-style: none;
    padding: 0;
}

.project-info-list li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.project-info-list strong {
    color: var(--text-title);
    margin-right: 0.5rem;
}

.part {
    margin-bottom: 2rem;
}

.part-header {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
}

.part p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.videos_two {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.videos_two .content-placeholder {
    flex: 1 1 calc(50% - 1rem);
    min-width: 300px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--border-color);
}

.video-text {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-style: italic;
    color: rgba(255,255,255,0.6);
}

.content-placeholder img,
.content-placeholder video {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
}

@media (max-width: 768px) {
    .portfolio-top h2 {
        font-size: 1.5rem;
        margin-top: -2rem;
    }
}

/* Language Toggle */
.lang-toggle-container {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.75rem;
    z-index: 100;
}

.lang-btn {
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.4;
    filter: grayscale(100%);
}

.lang-btn:hover {
    opacity: 0.8;
    filter: grayscale(50%);
}

.lang-btn svg {
    display: block;
    width: 32px;
    height: 24px;
    object-fit: cover;
}

:root[lang="en"] .lang-btn-en,
:root[lang="es"] .lang-btn-es {
    opacity: 1;
    filter: grayscale(0%);
    border-color: var(--text-title);
    box-shadow: 0 0 10px rgba(226, 155, 168, 0.3);
}

/* Zero-Latency Language Toggling */
:root[lang="en"] .lang-es { display: none !important; }
:root[lang="es"] .lang-en { display: none !important; }

@media (max-width: 768px) {
    .lang-toggle-container {
        top: 1rem;
        right: 1rem;
    }
}
