html { scroll-behavior: smooth; }
:root {
    --primary-accent: #e56b55;
    --primary-accent-hover: #c44933;
    --text-dark: #f4ecd8;
    --text-light: #f4ecd8;
    --border-color: rgba(255, 255, 255, 0.2);

    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);}

/* ---=== Base & ANON STUDIOS Canvas ===--- */
body {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    margin: 0;
    padding: 0;
    background: url('assets/bg_image.jpeg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-light);
    overflow-x: hidden;
}

#ukiyo-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.3; pointer-events: none; }

/* ---=== General Animations & Card Style ===--- */
.animated-component {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFadeIn 0.8s ease-out forwards;
}

.header { animation-delay: 0.1s; }
.carousel { animation-delay: 0.2s; }
.container { animation-delay: 0.3s; }
.footer { animation-delay: 0.4s; }

@keyframes slideUpFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-brutalist-card {
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-brutalist-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* ---=== Header ===--- */
.header {
    color: var(--text-light);
    text-align: center;
    padding: 2rem 1rem;
    margin: 80px 20px 0 20px;
    background-color: rgba(58, 58, 58, 0.2);
    border-bottom: 8px solid var(--text-light);
}
.header h1 { margin: 0; font-size: 2.5rem; }
.header h2 { margin: 0.5rem 0 0; font-weight: 400; color: var(--primary-accent); }


/* ---=== Drawer Navigation ===--- */
.drawer {
    height: 100%;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 3px solid var(--border-color);
    overflow-x: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding-top: 60px;
    z-index: 1001;
}
.drawer.is-open {
    transform: translateX(0);
}
.drawer a {
    padding: 15px 20px;
    text-decoration: none;
    font-size: 1.1em;
    color: var(--text-light);
    display: block;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: bold;
}
.drawer a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}
.drawer-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 36px;
    color: var(--text-light);
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}
.drawer-close:hover {
    transform: rotate(90deg);
}

/* ---=== 3D Skeuomorphic/Brutalist Buttons ===--- */
.btn-3d {
    background-color: var(--primary-accent);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    font-family: 'IBM Plex Mono', monospace;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s linear, box-shadow 0.1s linear;
}
.btn-3d:hover {
    background-color: var(--primary-accent-hover);
    color: var(--text-light);
}
.btn-3d:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.drawer-toggle {
    font-size: 24px;
    color: var(--text-light);
    background-color: var(--primary-accent);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    padding: 5px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s linear, box-shadow 0.1s linear;
}

.drawer-toggle:hover {
    background-color: var(--primary-accent-hover);
    color: var(--text-light);
}
.drawer-toggle:active {
     transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ---=== Infinite Carousel ===--- */
.carousel {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: 40px auto;
    overflow: hidden;
    padding: 10px;
}
.carousel-inner {
    display: flex;
    width: 200%; 
    animation: infinite-scroll 40s linear infinite;
}
.carousel-inner img {
    width: 25%;
    height: 300px;
    object-fit: cover;
    flex-shrink: 0;
    padding: 0 10px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}
@keyframes infinite-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---=== Projects Grid ===--- */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* MODIFICATION FOR PROJECT CARD CLARITY */
.project-card.glass-brutalist-card {
    background-color: rgba(25, 20, 15, 0.75); /* Dark background for readability */
    backdrop-filter: blur(4px); /* Less blur to reduce background noise */
}
/* END MODIFICATION */

.project-card {
    /* Staggered animation entrance */
    opacity: 0;
    animation: slideUpFadeIn 0.5s ease-out forwards;
}
.project-card:active {
    transform: translateY(2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.project-card a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 2rem 1rem;
    box-sizing: border-box;
}
.project-card a span {
    font-weight: 400;
    font-size: 0.8em;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* ---=== Footer ===--- */
.footer {
    text-align: center;
    margin: 40px auto;
    padding: 2rem;
    max-width: 800px;
}
.footer p { margin: 1rem 0; color: var(--text-light); text-shadow: 1px 1px 2px #000; }


@media (max-width: 768px) {
    .header h1 { font-size: 1.8rem; }
    .carousel-inner img { height: 200px; }
    .container { padding: 1rem; gap: 1rem; grid-template-columns: 1fr; }
}

@keyframes pulse-btn {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
    50% { transform: scale(1.02); box-shadow: 0 4px 15px rgba(229, 107, 85, 0.4); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
}

/* Index Page Specific Responsive Utilities */
@media screen and (max-width: 768px) {
    /* Container Grid */
    .container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    /* Carousel Adjustment */
    .carousel {
        width: 100% !important;
        margin: 20px auto !important;
    }

    .carousel-inner img {
        height: 150px !important;
    }
}
