/* --- General & Reset --- */
:root {
    --bg-color: #3e2723; /* deep brown */
    --text-color: #fff8e1; /* warm cream */
    --text-muted-color: #bcaaa4; /* muted brown */
    --primary-color: #ff9800; /* vibrant orange */
    --primary-hover-color: #ff5722; /* bold orange-red */
    --glass-bg: rgba(29, 18, 2, 0.6); /* 70s orange glass */
    --glass-border: rgba(255, 152, 0, 0.2); /* orange border */
    --card-bg: #6d4c41; /* rich brown */
    --card-border: #a1887f; /* light brown */
    --fade-coolor: #291a0f; /* dark brown for fade effect */
    --header-bg-fade: rgba(29, 18, 2, 0.6);   /* semi-transparent */
    --header-bg-solid: #1d1202;               /* solid color */
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

section {
    padding: 5rem 0;
}

@media (min-width: 1024px) {
    section {
        padding: 8rem 0;
    }
}

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

h2 {
    font-size: 2.25rem;
    margin-bottom: 3rem;
    text-align: center;
}

/* --- Animations & Effects --- */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

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

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.konami-active {
    animation: party-time 0.5s infinite;
}

@keyframes party-time {
    0% { background-color: #ef4444; }
    25% { background-color: #f97316; }
    50% { background-color: #eab308; }
    75% { background-color: #22c55e; }
    100% { background-color: #3b82f6; }
}

/* --- Custom Cursor --- */
.cursor-dot, .cursor-outline {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    border-radius: 50%;
}
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
}
.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    transition: transform 0.2s ease-out, top 0.2s ease-out, left 0.2s ease-out;
}

/* --- Header --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: linear-gradient(
        to bottom,
        var(--header-bg-solid) 0%,
        var(--header-bg-fade) 50%,
        var(--header-bg-fade) 25%,
        transparent 100%
    );
    transition: background 0.3s, backdrop-filter 0.3s;
}
#header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
#logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    cursor: pointer;
}
#logo span {
    color: var(--primary-color);
}
.nav-links {
    display: none; /* Hidden on mobile */
}
@media (min-width: 768px) {
    .nav-links {
        display: flex;
        align-items: center;
        gap: 2rem;
    }
}
.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}
.nav-links a:hover {
    color: var(--primary-color);
}
.contact-btn {
    background-color: var(--primary-hover-color);
    color: white;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.3s;
}
.contact-btn:hover {
    transform: scale(1.05);
    background-color: var(--text-color);
}
#header.solid {
    background: var(--header-bg-solid);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

/* --- Hero Section --- */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}
.hero-content {
    z-index: 10;
    padding: 0 1rem;
}
#typing-text {
    font-size: 2.25rem;
    font-family: 'Hatch', sans-serif;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
    min-height: 1.2em; /* fallback, will be overwritten below */
    display: block;
}
/* Ensure #typing-text always reserves enough space for the longest quote */
@media (min-width: 768px) {
    #typing-text {
        min-height: 4.5rem; /* matches font-size at large screens */
    }
}
@media (max-width: 767px) {
    #typing-text {
        min-height: 3.75rem; /* matches font-size at medium screens */
    }
}
@media (max-width: 479px) {
    #typing-text {
        min-height: 2.25rem; /* matches font-size at small screens */
    }
}
.hero-content p {
    font-size: 1.125rem;
    color: var(--text-muted-color);
    max-width: 48rem; /* max-w-3xl */
    margin: 0 auto;
}
.hero-content .cta-btn {
    background-color: var(--primary-hover-color);
    color: white;
    font-weight: bold;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
    margin-top: 2rem;
}
.hero-content .cta-btn:hover {
    transform: scale(1.05);
    background-color: var(--primary-color);
}
@media (min-width: 768px) {
    #typing-text { font-size: 3.75rem; }
    .hero-content p { font-size: 1.25rem; }
}
@media (min-width: 1024px) {
    #typing-text { font-size: 4.5rem; }
}

/* --- About Section --- */
#about .about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}
@media (min-width: 768px) {
    #about .about-grid {
        grid-template-columns: 2fr 1fr;
    }
}
#about h2 {
    text-align: left;
    margin-bottom: 1rem;
}
#about p {
    color: var(--text-muted-color);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.profile-image-container {
    width: 16rem;
    height: 16rem;
    margin: 0 auto;
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 4px solid var(--glass-border);
    transition: transform 0.5s;
}
.profile-image-container:hover {
    transform: scale(1.05);
}
.profile-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@media (min-width: 1024px) {
    .profile-image-container {
        width: 20rem;
        height: 20rem;
    }
}

/* --- Projects Section --- */
#projects {
    background-color: var(--glass-bg);
}
.project-grid {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
}
@media (min-width: 768px) {
    .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .project-grid { grid-template-columns: repeat(3, 1fr); }
}
.project-card {
    min-width: 320px;
    max-width: 320px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    position: relative;
    padding: 0; /* Remove padding so banner is flush */
    border-radius: 0.75rem;
    transition: transform 0.3s;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.08);
    overflow: hidden;
}
.project-banner {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}
.project-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.project-links {
    display: flex;
    gap: 1rem;
    margin-top: auto; /* Add this line */
}
.project-card:hover {
    transform: scale(1.01);
}
/* .project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: linear-gradient(120deg, #38bdf8, #a78bfa, #f472b6) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
} */
.project-card:hover::before {
    opacity: 1;
}
.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
.project-card p {
    color: var(--text-muted-color);
    margin-bottom: 1rem;
}
.project-links {
    display: flex;
    gap: 1rem;
}
.project-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}
.project-links a:hover {
    color: var(--primary-hover-color);
}
.project-carousel-fade {
    position: relative;
    overflow: hidden;
}
.project-carousel-fade::before,
.project-carousel-fade::after {
    content: "";
    position: absolute;
    top: 0;
    width: 48px; /* adjust width as needed */
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.project-carousel-fade::before {
    left: 0;
    background: linear-gradient(to right, var(--fade-coolor) 10%, transparent 100%);
}
.project-carousel-fade::after {
    right: 0;
    background: linear-gradient(to left, var(--fade-coolor) 10%, transparent 100%);
}


/* --- Skills Section --- */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}
@media (min-width: 768px) {
    .skills-grid { gap: 3rem; }
}
.skill-icon {
    text-align: center;
    transition: transform 0.3s ease, color 0.3s ease;
}
.skill-icon:hover {
    transform: scale(1.1) translateY(-5px);
    color: var(--primary-color);
}
.skill-icon-img {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    filter: brightness(0) invert(0.95) sepia(0.1) saturate(2) hue-rotate(10deg);
    /* This filter makes most SVGs appear cream colored */
    transition: filter 0.3s;
}
.skill-icon p {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* --- Contact Section --- */
#contact {
    background-color: var(--glass-bg)
}
.contact-form-container {
    max-width: 48rem;
    margin: 0 auto;
    text-align: center;
}
.contact-form-container p {
    color: var(--text-muted-color);
    margin-bottom: 2rem;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
    }
}
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    transition: all 0.3s;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-hover-color);
}
.contact-form button {
    background-color: var(--primary-hover-color);
    color: white;
    font-weight: bold;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    align-self: center;
}
.contact-form button:hover {
    transform: scale(1.05);
    background-color: var(--primary-color);
}

/* --- Footer --- */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--card-border);
    text-align: center;
    color: var(--text-muted-color)
}
#easter-egg-trigger {
    cursor: pointer;
}
.load-more {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}
.load-more button {
    background-color: var(--primary-hover-color);
    color: white;
    font-weight: bold;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px 0 rgba(56,189,248,0.08);
}
.load-more button:hover {
    transform: scale(1.05);
    background-color: var(--primary-color);
}

/* --- Scroll Down Arrow --- */
.scroll-down-arrow {
    position: absolute;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    animation: bounceDown 1.5s infinite;
    transition: color 0.3s;
    color: var(--primary-color);
    text-decoration: none;
}
.scroll-down-arrow:hover {
    color: var(--primary-hover-color);
}
@keyframes bounceDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(12px); }
}
.scroll-down-arrow svg {
    display: block;
    width: 3rem;
    height: 3rem;
}
#typing-text .quote-dot {
    color: var(--primary-color);
}

/* --- Fonts --- */
@font-face {
    font-family: 'Hatch';
    src: url('/fonts/Hatch.woff') format('woff');
}
.live-demo-btn {
    background-color: var(--primary-hover-color);
    color: var(--text-color) !important;
    font-weight: bold;
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.3s, transform 0.3s;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: none;
}
.live-demo-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color) !important;
    transform: scale(1.05);
}
.source-code-btn {
    color: var(--text-color);
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s, transform 0.3s;
    display: inline-block;
    vertical-align: middle;
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: none;
}