:root {
    --bg-color: #050505;
    --surface-color: #0f0f0f;
    --surface-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent-color: #00f2ea;
    --accent-secondary: #ff00c1;
    --accent-gradient: linear-gradient(135deg, #00f2ea 0%, #0055ff 100%);
    --accent-dim: rgba(0, 242, 234, 0.05);
    --border-color: rgba(255, 255, 255, 0.08);
    --gap: 1.5rem;
    --transition-speed: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
.logo {
    font-family: 'Space Grotesk', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.7);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: padding 0.3s ease;
}

.navbar.scrolled {
    padding: 0.8rem 4rem;
    background: rgba(5, 5, 5, 0.9);
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.accent {
    color: var(--accent-color);
}

/* XYZ Logo Animation */
.xyz-wrapper span {
    transition: color 0.5s ease;
    color: var(--accent-color);
    /* Default accent */
}

.xyz-wrapper.rgb-mode .letter-x {
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

.xyz-wrapper.rgb-mode .letter-y {
    color: #33ff33;
    text-shadow: 0 0 10px rgba(51, 255, 51, 0.5);
}

.xyz-wrapper.rgb-mode .letter-z {
    color: #3333ff;
    text-shadow: 0 0 10px rgba(51, 51, 255, 0.5);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

/* Hamburger Button - Hidden by default on desktop */
.hamburger-btn {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-size: 1.2rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.cta-btn {
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
}

.cta-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color) !important;
}

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0a0a0a 0%, #000 100%);
}

.hero-content {
    z-index: 1;
    max-width: 800px;
    padding: 0 2rem;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 6rem);
    line-height: 0.9;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -3px;
    font-weight: 800;
}

/* Simple Glitch Effect on Hover and JS Interval */
.glitch:hover,
.glitch.active {
    text-shadow: 2px 2px var(--accent-color), -2px -2px #ff00c1;
    transition: text-shadow 0.1s;
}

.hero .subtitle {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.hero .mini-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
    letter-spacing: 1px;
    opacity: 0.8;
    text-transform: uppercase;
}

.scroll-down {
    font-size: 1.5rem;
    color: var(--text-secondary);
    animation: bounce 2s infinite;
    display: inline-block;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Work Section */
.work-section {
    padding: 6rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--surface-color);
    color: var(--text-primary);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
    grid-auto-rows: 300px;
}

.project-card {
    position: relative;
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(0, 242, 234, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 234, 0.1);
    z-index: 10;
}

/* Grid Spans for Bento Effect */
.project-card.large {
    grid-column: span 2;
    grid-row: span 2;
}

.project-card.medium {
    grid-row: span 1;
}

@media (max-width: 768px) {
    .project-card.large {
        grid-column: span 1;
    }
}

.media-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.media-placeholder {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* Gradients as placeholder images */
.gradient-1 {
    background: linear-gradient(45deg, #FF3CAC 0%, #784BA0 50%, #2B86C5 100%);
}

.gradient-2 {
    background: linear-gradient(160deg, #0093E9 0%, #80D0C7 100%);
}

.gradient-3 {
    background: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%);
}

.gradient-4 {
    background: linear-gradient(45deg, #85FFBD 0%, #FFFB7D 100%);
}

.gradient-5 {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0));
    color: white;
    transform: translateY(0);
    opacity: 1;
    transition: all 0.3s ease;
}

.project-card:hover .overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.3));
}

.overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.overlay p {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 0.8rem;
}

.tech-tag {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.3rem;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* About Section */
.about-section {
    padding: 6rem 3rem;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
}

.about-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-text h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.profile-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.skills-list {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.skills-list li {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-link:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    padding-left: 1rem;
    /* Animation trigger */
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* MOdal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--surface-color);
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2100;
    color: var(--text-primary);
    background: transparent;
    border: none;
    line-height: 1;
    padding: 0;
}

.modal-body {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.modal-media {
    flex: 1 1 65%;
    min-width: 0;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.view-toggle {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 90%;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    /* IE and Edge */
}

.view-toggle::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.view-toggle::-webkit-scrollbar {
    display: none;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: #ccc;
    padding: 0.5rem 1rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
    text-transform: uppercase;
}

.toggle-btn.active {
    background: var(--text-primary);
    color: #000;
}

.visual-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-visual {
    color: #555;
    font-family: 'Space Grotesk';
    font-size: 1.5rem;
}

.modal-info {
    flex: 0 0 35%;
    min-width: 320px;
    padding: 2.5rem;
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
    background: var(--surface-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.modal-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-tags span {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    color: var(--accent-color);
}

.modal-info p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .modal-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .modal-content {
        height: 90vh;
        width: 95%;
    }

    .modal-media {
        flex: none;
        height: 50%;
        min-height: 250px;
    }

    .modal-info {
        flex: none;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 1.5rem;
    }
}

/* Canvas Background */
#tech-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Contact Form Styling */
.contact-wrapper {
    display: flex;
    gap: 4rem;
    margin-top: 3rem;
    align-items: flex-start;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.contact-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.social-links-minimal {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

.contact-form {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 0;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    resize: none;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Floating Label Animation */
.input-group label {
    position: absolute;
    top: 0.8rem;
    left: 0;
    color: var(--text-secondary);
    pointer-events: none;
    transition: 0.3s ease all;
}

.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label,
.input-group textarea:focus~label,
.input-group textarea:not(:placeholder-shown)~label {
    top: -1.2rem;
    font-size: 0.8rem;
    color: var(--accent-color);
}

.submit-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 2rem;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* --- Resume Section --- */
.resume-section {
    padding: 100px 5%;
    background: linear-gradient(180deg, var(--bg-color) 0%, rgba(10, 10, 20, 1) 100%);
}

.resume-container {
    max-width: 1000px;
    margin: 0 auto;
}

.resume-header {
    margin-bottom: 4rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.resume-header h2 {
    font-size: 3rem;
    font-family: 'Outfit';
    font-weight: 800;
}

.resume-header p {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.download-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.resume-timeline {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
}

.resume-item {
    position: relative;
}

.resume-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
}

.resume-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.resume-item h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
}

.resume-item .period {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'Space Grotesk';
}

.resume-item .role {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: block;
}

.resume-item .description {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 800px;
}

/* Response Fixes for Resume */
@media (max-width: 768px) {
    .resume-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .resume-item-header {
        flex-direction: column;
        gap: 0.2rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .logo {
        font-size: 1rem;
    }

    .hero h1 {
        font-size: 2.8rem;
        /* Smaller title */
        letter-spacing: -1px;
    }

    .hero .subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }

    .work-section {
        padding: 4rem 1rem;
        /* Less padding on sides */
    }

    .bento-grid {
        grid-template-columns: 1fr;
        /* Force 1 column */
        grid-auto-rows: auto;
        /* Flexible height */
        gap: 1rem;
    }

    .project-card {
        min-height: 0;
        height: auto;
    }

    /* Important: Force aspect ratio to prevent cropping */
    .project-card.large {
        grid-column: span 1;
        grid-row: span 1;
        aspect-ratio: 16/9;
    }

    .project-card.medium,
    .project-card.small {
        grid-row: span 1;
        aspect-ratio: 3/2;
        min-height: 220px;
    }

    .contact-wrapper {
        flex-direction: column;
        gap: 2rem;
    }

    .modal-content {
        width: 95%;
        height: 85vh;
    }

    /* Hamburger Menu Styles */
    .hamburger-btn {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        text-align: center;
    }

    .nav-links .cta-btn {
        display: inline-block;
        width: auto;
    }
}