:root {
    --text-color: #333;
    --link-color: #333;
    /* Links are subtle until hover perhaps? Original is greyish */
    --bg-color: #ffffff;
    /* White */
    --font-family: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    width: 100%;
    height: 100vh;
    overflow: hidden;
    /* Prevent scroll */
    position: relative;
    background-color: var(--bg-color);
    /* Mobile-first adjustment */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Canvas Background (Otoro) */
#canvas-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Intro Canvas (Tetris) */
#canvas-intro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* On top of content initially */
    pointer-events: none;
}

/* Centered Content */
#main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    text-align: center;
    background: transparent;
    pointer-events: none;
    /* Let clicks pass through to canvas if needed, but links need pointer-events: auto */
}

#main h1 {
    font-weight: 300;
    font-size: 2.2rem;
    /* Reduced size */
    margin-bottom: 1rem;
    letter-spacing: -1px;
    color: #2c3e50;
}

#main p {
    font-weight: 300;
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

#main a {
    color: #42b983;
    /* Vue green or a similar accent */
    text-decoration: none;
    font-weight: 400;
    pointer-events: auto;
    transition: color 0.2s ease;
}

#main a:hover {
    color: #3aa876;
}

/* Nav links styling */
nav {
    margin-top: 2rem;
    pointer-events: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav li a {
    color: #7f8c8d !important;
    /* Override the green for these secondary links */
    font-size: 1rem;
    position: relative;
}

nav li a:hover {
    color: #2c3e50 !important;
}

@media (max-width: 600px) {
    #main h1 {
        font-size: 1.8rem;
    }

    #main p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    nav ul {
        flex-direction: row;
        /* Keep row even on mobile usually, or wrap */
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Menu Buttons on Index */
.menu-container {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    /* Stack them for better separation */
    align-items: center;
    gap: 1.5rem;
    pointer-events: auto;
}

.menu-btn {
    text-decoration: none;
    color: #2c3e50;
    border: 2px solid #2c3e50;
    /* Thicker border */
    padding: 1rem 3rem;
    /* Wider padding */
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    width: 300px;
    /* Fixed width for uniformity */
    display: inline-block;
    /* Ensure width is respected */
}

.menu-btn:hover {
    background: #2c3e50;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Content Sections */
.content-section {
    max-width: 700px;
    /* Reduced from 800px */
    margin: 4rem auto;
    /* Increased margin */
    padding: 0 2rem;
    /* Increased padding */
    text-align: left;
    color: #2c3e50;
    pointer-events: auto;
    /* Allow text selection */
}

.text-left {
    text-align: left;
}

.content-section h2 {
    font-weight: 400;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.project-item {
    margin-bottom: 2rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.project-header h3 {
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0;
    color: #2c3e50;
}

.project-header .date {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-style: italic;
}

.content-section ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    font-size: 1rem;
    font-weight: 300;
}

.content-section p {
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #34495e;
}

hr {
    border: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

/* Scrollable container if needed, but body overflow is hidden? 
   We need to allow scrolling now that content is long. 
*/
body {
    overflow-y: auto !important;
    /* Enable scroll */
}

/* Subpage Styling */
body.subpage {
    overflow-y: auto;
    background-color: #ffffff;
    /* White background */
}

/* Adjust main container to flow naturally */
#main {
    height: auto;
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: 100px;
    /* Space for the initial centered text to look good */
    padding-bottom: 50px;
}

/* Man Utd Button */
.btn-manutd {
    border-color: #DA291C;
    color: #DA291C;
}

.btn-manutd:hover {
    background: #DA291C;
    color: #ffffff;
    box-shadow: 0 6px 15px rgba(218, 41, 28, 0.3);
}

/* Achievements Layout */
.achievements-layout {
    display: flex;
    flex-wrap: wrap;
    /* Stack on mobile */
    gap: 2rem;
    align-items: flex-start;
    max-width: 1200px;
    /* Wider container */
}

.achievements-text {
    flex: 1;
    /* Less flexible space, more fixed */
    min-width: 300px;
}

.achievements-image-container {
    flex: 2;
    /* More space for images */
    display: flex;
    /* Flex container for images */
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.image-wrapper {
    flex: 1;
    min-width: 180px;
    /* Reduced to ensure they fit side-by-side */
    max-width: 100%;
    text-align: center;
}

.achievements-image-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
}

.photo-caption {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.source-link {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0;
}

.source-link a {
    color: #DA291C;
    /* Match theme or link color */
    text-decoration: none;
}

.source-link a:hover {
    text-decoration: underline;
}

/* Dictionary / Gallery Styles */
.text-center {
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: auto;
    /* Maintain aspect ratio */
    display: block;
    position: relative;
    z-index: 2;
    /* Image on top */
}

/* Specific style for the 3rd item (Stadium) to have the logo behind */
/* Specific style for the 3rd item (Stadium) to have the logo behind */
/* Specific style for the 3rd item (Stadium) to have the logo on the side */
.gallery-item:nth-child(3) {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    /* Remove previous background image styles */
    background-image: none;
}

/* Style for the photo in the 3rd item */
.gallery-item:nth-child(3) .photo {
    flex: 2;
    /* Photo takes up more space */
    width: auto;
    max-width: 70%;
    z-index: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Style for the logo in the 3rd item */
.gallery-item:nth-child(3) .logo {
    flex: 1;
    /* Logo takes less space */
    width: auto;
    max-width: 30%;
    height: auto;
    object-fit: contain;
    z-index: 0;
}