/* Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0a0a0a;
    --secondary-color: #1a1a1a;
    --accent-color: #3644ff;
    --text-color: #ffffff;
    --text-secondary: #a0a0a0;
    --transition-speed: 0.5s;
    --image-radius: 12px;
    --image-ratio: 16/9;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    height: 100vh;
    width: 100vw;
    overflow-y: auto; /* allow vertical scrolling */
}

/* Canvas Background */
#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

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

.loading-content h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
    margin: 0 auto 2rem;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.start-button {
    padding: 0.8rem 2rem;
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-color);
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    opacity: 0.5;
    pointer-events: none;
}

.start-button.active {
    opacity: 1;
    pointer-events: all;
}

.start-button:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Navigation - Vertical on right side */
nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
}

nav ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    align-items: flex-end;
}

nav ul li {
    margin-left: 0;
    margin-bottom: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    transition: color var(--transition-speed) ease;
}

.nav-link.active {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
}

.nav-link::after {
    display: none;
}

/* Page Sections */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    padding: 2rem;
    opacity: 0;
}

.page.active {
    display: flex;
    opacity: 1;
}

/* Home Page */
#home {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.title-large {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.cta-button {
    padding: 1rem 3rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(54, 68, 255, 0.3);
}

/* Work Page */
#work {
    padding-top: 150px;
    justify-content: center;
}

/* 2×2 fixed grid that fits the frame */
.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Unified project frame */
.project-image {
    width: 100%;
    aspect-ratio: var(--image-ratio);
    background-color: var(--secondary-color);
    border-radius: var(--image-radius);
    overflow: hidden;
}

/* All images fill container regardless of original size */
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* fills container exactly */
    object-position: center;
    display: block;
}

/* View buttons aligned and balanced */
.view-button {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 0; /* centered under image */
}

.view-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(54, 68, 255, 0.3);
    background-color: #4a59ff;
}

/* Modal image styling */
.modal-image {
    width: 100%;
    aspect-ratio: var(--image-ratio);
    background-color: var(--secondary-color);
    border-radius: var(--image-radius);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.modal-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* About Page */
#about {
    padding-top: 150px;
    justify-content: center;
}

.about-content {
    display: flex;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-image {
    flex: 0 0 auto;
    width: 350px;
    aspect-ratio: 3/4;
    background-color: var(--secondary-color);
    border-radius: var(--image-radius);
    overflow: hidden;
    position: relative;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.contact-button {
    padding: 0.8rem 2rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all var(--transition-speed) ease;
}

.contact-button:hover {
    background-color: #4a59ff;
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background-color: var(--primary-color);
    border-radius: 10px;
    position: relative;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

.modal-body {
    padding: 3rem;
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.modal-description {
    margin-bottom: 2rem;
}

.modal-description p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.modal-details {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.detail h4 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.visit-site {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

.visit-site:hover {
    background-color: #4a59ff;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .title-large {
        font-size: 4rem;
    }

    .work-grid {
        gap: 1.5rem;
    }

    .about-content {
        gap: 3rem;
    }

    .about-image {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .title-large {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

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

    .about-content {
        flex-direction: column;
    }

    .about-image {
        width: 100%;
        max-width: 330px;
        margin: 0 auto;
    }

    .modal-details {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    nav ul li {
        margin-left: 1rem;
    }

    .title-large {
        font-size: 2.5rem;
    }

    .modal-body {
        padding: 2rem;
    }

    .modal-title {
        font-size: 2rem;
    }
}
