:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent-color: #00ffcc; /* Hacker/Coding green-cyan */
    --font-main: 'Outfit', sans-serif;
    --font-code: 'Fira Code', monospace;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body, html {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* Header Navigation */
.site-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    padding: 20px 0;
}

.site-header.scrolled {
    top: 20px;
    width: 90%;
    max-width: 1200px;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 204, 0.1);
    padding: 10px 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: padding 0.5s ease;
}

.site-header.scrolled .header-container {
    padding: 0 30px;
}

.logo {
    font-family: var(--font-main);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo .dot {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-code);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    margin-left: 20px;
}

.hamburger span {
    display: block;
    width: 30px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Sidebar Ultra Animation */
.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000; /* Above header */
    padding: 120px 50px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    transition: right 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.sidebar-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2001;
}

.sidebar-close span {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.sidebar-close span:nth-child(1) {
    transform: rotate(45deg);
}
.sidebar-close span:nth-child(2) {
    transform: rotate(-45deg);
}

.sidebar-close:hover span {
    background: var(--accent-color);
    transform: rotate(135deg);
}

.sidebar.active {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1999; /* Below sidebar, above header */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sidebar-content {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.3s;
}

.sidebar.active .sidebar-content {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.sidebar-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

.sidebar-details {
    list-style: none;
    margin-bottom: 40px;
}

.sidebar-details li {
    margin-bottom: 25px;
    font-family: var(--font-code);
    font-size: 1rem;
    display: flex;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.sidebar.active .sidebar-details li {
    opacity: 1;
    transform: translateY(0);
}

.sidebar.active .sidebar-details li:nth-child(1) { transition-delay: 0.4s; }
.sidebar.active .sidebar-details li:nth-child(2) { transition-delay: 0.5s; }
.sidebar.active .sidebar-details li:nth-child(3) { transition-delay: 0.6s; }
.sidebar.active .sidebar-details li:nth-child(4) { transition-delay: 0.7s; }

.sidebar-details span {
    color: var(--accent-color);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.sidebar-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-main);
    font-size: 1.8rem;
    font-weight: 600;
    transition: color 0.3s ease;
    opacity: 0;
    transform: translateX(20px);
}

.sidebar.active .sidebar-nav-link {
    opacity: 1;
    transform: translateX(0);
}

.sidebar.active .sidebar-nav-link:nth-child(1) { transition: all 0.4s ease 0.4s; }
.sidebar.active .sidebar-nav-link:nth-child(2) { transition: all 0.4s ease 0.5s; }
.sidebar.active .sidebar-nav-link:nth-child(3) { transition: all 0.4s ease 0.6s; }
.sidebar.active .sidebar-nav-link:nth-child(4) { transition: all 0.4s ease 0.7s; }

.sidebar-nav-link:hover {
    color: var(--accent-color);
}

/* 3D Canvas Background */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; /* Behind everything */
    pointer-events: none;
    opacity: 0.6;
}

/* Main Wrapper needs to sit above the fixed canvas */
.main-wrapper {
    position: relative;
    z-index: 1;
}

/* Typography & Tags */
h1, h2, h3 {
    font-weight: 600;
}

.tag {
    font-family: var(--font-code);
    color: var(--accent-color);
    font-size: 0.9rem;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 1rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5vw;
    position: relative;
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(0,255,204,0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.hero-content {
    max-width: 900px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 30px;
    font-family: var(--font-code);
    font-size: 0.8rem;
    margin-bottom: 30px;
    backdrop-filter: blur(5px);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 255, 204, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 204, 0); }
}

.hero-title {
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
    min-height: 2.2em; /* Prevents jumping during typing */
}

.cursor {
    color: var(--accent-color);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-cta-group {
    display: flex;
    gap: 20px;
    margin-bottom: 60px; /* Increased to separate from scroll indicator */
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.primary-btn {
    background: var(--text-primary);
    color: var(--bg-color);
    border: 1px solid var(--text-primary);
}

.primary-btn:hover {
    background: transparent;
    color: var(--text-primary);
}

.glow-btn {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
}

.glow-btn:hover {
    background: transparent;
    color: var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.6);
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.scroll-indicator {
    position: relative; /* Removed absolute to sit in flow */
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.mouse {
    width: 24px;
    height: 36px;
    border: 2px solid var(--text-secondary);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { top: 6px; opacity: 1; }
    100% { top: 18px; opacity: 0; }
}

/* --- Solid Background Content Area --- */
.content-background {
    /* Covers the 3D canvas once you scroll past the hero */
    background-color: var(--bg-color);
    position: relative;
    z-index: 2;
}

/* Sections Base */
section {
    padding: 100px 5vw;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 3rem;
}

/* Skills Section */
.skills {
    position: relative;
    padding-top: 150px;
    padding-bottom: 150px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card {
    perspective: 1000px;
}

.card-inner {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 40px 30px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), background 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-inner:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
}

.skill-icon {
    font-family: var(--font-code);
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.card-inner h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.experience-tag {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.card-inner p {
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

/* Portfolio Horizontal Scroll Section */
.portfolio {
    padding: 0;
    height: 100vh;
    background: #020202; /* Slightly darker to contrast */
}

.portfolio-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 100px; /* Space for the header */
}

.fixed-header {
    /* Position normally in the flow so it doesn't overlap images */
    padding: 0 5vw;
    margin-bottom: 40px;
    z-index: 10;
}

.horizontal-scroll-wrapper {
    flex: 1; /* Take up remaining space */
    display: flex;
    align-items: center;
}

.horizontal-scroll-content {
    display: flex;
    gap: 150px;
    padding: 0 5vw;
    /* Start without offset since header is now above */
    margin-left: 0; 
}

.project-panel {
    width: 900px;
    max-width: 80vw;
    height: 550px;
    max-height: 70vh;
    display: flex;
    align-items: stretch; /* Make children fill height */
    gap: 40px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    box-sizing: border-box;
    overflow: hidden; /* Ensure nothing breaks out */
}

.end-panel {
    width: 10vw; /* Just for spacing at the end */
    background: transparent;
    border: none;
    box-shadow: none;
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-info h3 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 20px;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 400px;
    line-height: 1.6;
}

.tech-stack {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.tech-stack li {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 5px 15px;
    border-radius: 20px;
}

.primary-btn {
    display: inline-block;
    padding: 15px 30px;
    background: var(--text-primary);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: var(--font-code);
    font-size: 0.9rem;
}

.primary-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    transform: translateY(-3px);
}

.project-image-wrapper {
    flex: 1;
    height: 100%; 
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.project-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-panel:hover .project-image-wrapper img {
    transform: scale(1.05);
}

/* Footer Section */
.footer {
    min-height: 80vh;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 100px 5vw 0 5vw;
    position: relative;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.footer-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.footer-cta {
    margin-bottom: 100px;
}

.footer-cta h2 {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 2rem;
    line-height: 1.1;
}

.mega-link {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--accent-color);
    text-decoration: none;
    font-family: var(--font-code);
    display: inline-block;
    position: relative;
}

.mega-link::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.4s ease;
}

.mega-link:hover::after {
    width: 100%;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 40px;
    padding-bottom: 40px;
    margin-top: auto;
}

.socials a {
    color: var(--text-primary);
    text-decoration: none;
    margin-right: 30px;
    font-family: var(--font-code);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.socials a:hover {
    color: var(--accent-color);
}

.copyright {
    font-family: var(--font-code);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .horizontal-scroll-content {
        margin-left: 5vw;
        gap: 50px;
    }
    .project-panel {
        width: 85vw;
        flex-direction: column-reverse;
        height: auto;
        gap: 30px;
    }
    .project-image-wrapper {
        height: 40vh;
        width: 100%;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 60px 5vw;
    }
    .nav-link {
        display: none; /* Hide nav links, rely on hamburger on mobile */
    }
    .hero-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }
    .hero-cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    .btn {
        text-align: center;
        width: 100%;
    }
    .sidebar {
        width: 100vw;
    }
    .footer {
        padding-top: 60px;
    }
    .footer-cta h2 {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    .mega-link {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
    
    /* Fix Portfolio section for vertical layout */
    .portfolio-container {
        height: auto;
        padding-top: 60px;
        padding-bottom: 60px;
    }
    .portfolio {
        height: auto;
    }
    .horizontal-scroll-content {
        flex-direction: column;
        margin-left: 0;
        gap: 40px;
    }
    .project-panel {
        width: 100%;
        max-width: 100%;
    }
    .end-panel {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }
    .sidebar-title {
        font-size: 2rem;
    }
    .skill-icon {
        font-size: 2rem;
    }
    .project-info h3 {
        font-size: 1.5rem;
    }
    .footer-cta h2 {
        font-size: clamp(1.8rem, 5vw, 2.2rem);
    }
    .mega-link {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }
    .card-inner {
        padding: 30px 20px;
    }
}
