/* ==========================================================================
   Global Variables
   ========================================================================== */

:root {
    --dark-grey: #3f3f3f;
    --yellow: #ffebc4;
    --black: black;
    --beige: #b8aea7;
    --brown: #201914;
    --dark-green: #2d3622;
    --light-grey-bg: #d7d1c3;
    --white-bg: #ffffff;
}
/* ==========================================================================
   Header Styles
   ========================================================================== */
header {
    background-color: var(--beige);
    color: var(--black);
    padding: 15px 0;
    font-family: 'Neuehaasdisplay Roman', Arial, sans-serif;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-content a {
    color: var(--black);
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    transition: color 0.3s ease;
}
.header-content a:hover {
    color: var(--yellow);
}
.header-left,
.header-right {
    font-weight: bold;
    font-size: 1em;
}


/* ==========================================================================
   Base Body and Layout Styles
   ========================================================================== */

body {
    font-family: 'Neuehaasdisplay Roman', Arial, sans-serif;
    font-size: 18px;
    line-height: 1.7;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
    box-sizing: border-box;
}

h1, h2, h3 {
    font-weight: normal;
}

h1 {
    font-size: 2.5em;
    text-align: left;
    border-bottom: 2px solid var(--beige);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

h2 {
    font-size: 1.8em;
    border-bottom: 2px solid;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.4em;
    margin-top: 30px;
    margin-bottom: 10px;
}

hr {
    border: none;
    border-top: 1px solid var(--dark-grey);
    margin: 40px 0;
}

/* ==========================================================================
   Section Themes
   ========================================================================== */

.theme-intro {
    background-color: var(--brown);
    color: var(--beige);
}
.theme-intro h1, .theme-intro h2 {
    color: var(--yellow);
    border-color: var(--beige);
}

.theme-avoidance {
    background-color: var(--light-grey-bg);
    color: var(--black);
}
.theme-avoidance h2, .theme-avoidance h3 {
    color: var(--black);
    border-color: var(--dark-grey);
}

.theme-detection {
    background-color: var(--white-bg);
    color: var(--black);
}
.theme-detection h2 {
    color: var(--black);
    border-color: var(--dark-grey);
}

.theme-demo {
    background-color: var(--dark-green);
}

/* ==========================================================================
   Content Layouts (Grid, etc.)
   ========================================================================== */

.content-section {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1.3fr;
    gap: 30px;
    align-items: start;
    margin-top: 50px;
}

.two-col-section {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 40px;
    align-items: center;
}

.numbered-point {
    margin-bottom: 20px;
    position: relative;
    padding-left: 40px;
}

.numbered-point span {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    color: var(--yellow);
    font-size: 1.2em;
}

.theme-avoidance .numbered-point span, .theme-detection .numbered-point span {
    color: var(--brown);
}

.content-image-left,
.content-image-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.content-image-right {
    transform: translateY(365px);
}

.content-image-left img,
.content-image-right img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    /* ADD THIS LINE for smooth animation */
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* ADD THIS NEW RULE for the hover effect */
.content-image-left img:hover,
.content-image-right img:hover {
    transform: scale(1.05); /* Makes the image 5% larger */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); /* Enhances the shadow */
}

.content-text {
    grid-column: 2;
}

/* ==========================================================================
   Interactive Demo Box Styles
   ========================================================================== */

.game-container {
    text-align: center;
    padding: 30px;
    border-radius: 16px;
    background-color: var(--dark-green);
    color: var(--yellow);
    border: 1px solid var(--yellow);
}

.game-container h2 {
    color: var(--yellow);
    border-bottom: 2px solid var(--yellow);
}

.game-container p {
    color: var(--yellow);
}

canvas {
    background-color: #fff;
    border: 1px solid var(--beige);
    border-radius: 8px;
    cursor: pointer;
}

.controls button {
    background-color: var(--yellow);
    color: var(--dark-green);
    border: 2px solid var(--yellow);
    padding: 12px 24px;
    margin: 10px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.controls button:hover {
    background-color: transparent;
    color: var(--yellow);
}

#message {
    margin-top: 15px;
    font-size: 1.1em;
    font-weight: bold;
    height: 25px;
    transition: color 0.3s ease;
}

/* ==========================================================================
   Smooth Scrolling & Section Blending
   ========================================================================== */

html {
    overflow: visible;
}

#scroll-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
}

.theme-intro, .theme-avoidance, .theme-detection, .theme-demo {
    position: relative;
    padding-top: 50px;
}

.theme-avoidance::before, .theme-detection::before, .theme-demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    border-bottom-left-radius: 100%;
    border-bottom-right-radius: 100%;
}

.theme-avoidance::before {
    background-color: var(--brown);
}

.theme-detection::before {
    background-color: var(--light-grey-bg);
}

.theme-demo::before {
    background-color: var(--white-bg);
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */
footer {
    background-color: var(--beige);
    padding: 30px 0;
    color: var(--black);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
}

.team-members {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    gap: 30px;
}

.team-members a {
    color: var(--black);
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
    font-family: 'Neuehaasdisplay Roman', Arial, sans-serif;
    transition: color 0.3s ease;
}

.team-members a:hover {
    color: var(--yellow);
}

/* ==========================================================================
   UX Improvements (Animations & Back to Top Button)
   ========================================================================== */

body {
    opacity: 0;
    transition: opacity 1s ease;
}
body.loaded {
    opacity: 1;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--yellow);
    color: var(--brown);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ==========================================================================
   Media Queries for Responsiveness
   ========================================================================== */
@media (max-width: 900px) {
    .content-section, .two-col-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .content-image-right {
        transform: none;
    }
}


/*Mobile*/

/* ==========================================================================
   Media Queries for Mobile Responsiveness
   ========================================================================== */

/* This block of styles will only apply to screens 768px wide or smaller (like tablets and phones) */
@media (max-width: 768px) {

    /* --- Adjust General Layout & Spacing --- */
    .container {
        padding: 40px 20px; /* Reduce horizontal padding to give content more space */
    }
    
    .header-content {
        padding: 0 20px;
        flex-direction: column; /* Stack header items vertically */
        gap: 10px;
    }

    h1 {
        font-size: 2em; /* Make the main heading a bit smaller on mobile */
    }

    /* --- Stack the Multi-Column Grids --- */
    /* This turns both your 3-column and 2-column layouts into a single vertical column */
    .content-section,
    .two-col-section {
        grid-template-columns: 1fr;
        gap: 25px; /* Adjust the gap for a stacked layout */
    }

    /* --- Reset Image Positions --- */
    /* This removes the downward shift from the right image so it aligns correctly in the stack */
    .content-image-right {
        transform: none;
    }

    .content-image-left img,
    .content-image-right img {
        max-height: 250px; /* Optional: prevent images from being excessively tall */
        width: auto;
    }
    
    /* --- Make the Canvas Responsive --- */
    /* This prevents the canvas from overflowing on small screens */
    canvas {
        width: 100%; /* Make the canvas fill its container's width */
        height: auto; /* Maintain its aspect ratio */
    }
}