body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', monospace, sans-serif;
    overflow-x: hidden;
    overflow-y: scroll;
    min-height: 100vh;
    background: black;
    width: 100vw;
    max-width: 100%;
}

* {
    box-sizing: border-box;
}

/* Video Background */
#video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    overflow: hidden;
}

#video-background.active {
    opacity: 1;
}

#video-background.fading {
    opacity: 0;
}

#video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main content overlay */
#main-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    max-width: 100%;
    min-height: 100vh;
    padding: 60px 80px 100px 80px;
    background: rgba(17, 17, 17, 0.7);
    backdrop-filter: blur(2px);
    color: #fff;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#main-content.active {
    opacity: 1;
}

/* HERO SECTION STYLES */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px;
    margin-bottom: 40px;
    min-height: 300px;
    max-width: 100%;
    overflow: hidden;
}

.hero-left {
    flex: 1;
    max-width: 650px;
    min-width: 0;
}

.hero-location {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

.hero-title {
    margin: 0 0 30px 0;
    padding: 0;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    font-style: italic;
    letter-spacing: -2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-title-line {
    display: block;
}

.hero-right {
    flex: 1;
    max-width: 450px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 20px;
    margin-right: 70px;
    padding-right: 40px;
}

.hero-description {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    white-space: pre-line;
    animation: fadeIn 0.8s ease-in-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo styling */
.logo-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 50;
}

.site-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    transition: all 0.3s ease;
}

.site-logo:hover {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
    transform: scale(1.05);
}

.tabs { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 20px;
    margin-top: 20px;
    justify-content: left;
    flex-wrap: wrap;
}

.tab { 
    padding: 8px 12px; 
    border: 1px solid #fff;
    color: #fff;
    background: rgba(17, 17, 17, 0.8);
    border-radius: 6px;
    cursor: pointer; 
    transition: all 0.2s;
    user-select: none;
}

.tab:hover {
    background-color: rgba(255, 255, 255, 0.2); 
}

.tab.active {
    border-color: #fff;
    background-color: #fff; 
    font-weight: bold; 
    color: #111; 
}

.glitch-container {
    position: relative;
    font-family: 'Inter', monospace;
    font-size: 24px;
    padding: 10px 0;
    max-width: 100%;
    overflow: hidden;
}

.scrambled {
    position: relative; 
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7), 0 0 15px rgba(255, 255, 255, 0.4); 
    z-index: 30; 
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@keyframes flicker {
    0%, 19% { opacity: 1; }
    20%, 20.9% { opacity: 0.8; transform: skewX(1deg); }
    21%, 21.9% { opacity: 1; transform: skewX(0); }
    30%, 30.9% { opacity: 0.7; }
    31%, 100% { opacity: 1; }
}

.flicker {
    animation: flicker 4s infinite linear;
}

#start-screen {
    width: 100vw;
    height: 100vh;
    position: fixed; 
    top: 0;
    left: 0;
    background: black; 
    color: #fff; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', monospace;
    z-index: 101;
    overflow: hidden;
}

.title-wrapper,
.button-wrapper {
    display: flex; 
    justify-content: center;
    width: 100%;
    padding: 0 20px;
}

.button-wrapper {
    margin-top: 40px; 
}

.glitch-container.intro-title {
    font-size: 4rem;
    margin-bottom: 20px;
    padding: 0;
    text-align: center;
}

.intro-title .scrambled {
    text-shadow: 0 0 10px #fff, 0 0 30px rgba(255, 255, 255, 0.8);
}

.glitch-button {
    padding: 15px 30px !important;
    font-size: 1.5rem !important; 
    cursor: pointer !important;
    
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 250px !important;
    min-height: 50px !important;

    background: transparent !important; 
    border: 3px solid #fff !important; 
    color: #fff !important; 
    border-radius: 8px !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.2s !important;
}

.glitch-button:hover {
    box-shadow: 0 0 20px #fff, 0 0 40px rgba(255, 255, 255, 0.5); 
    transform: scale(1.05);
}

#video-intro {
    width: 100vw;
    height: 100vh;
    position: fixed; 
    top: 0;
    left: 0;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    overflow: hidden;
    
    opacity: 0; 
    transition: opacity 1s ease-in-out;
}

#video-intro.active {
    opacity: 1;
}

#video-intro video {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}

#glitch-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

#glitch-transition.active {
    opacity: 1;
}

.glitch-overlay {
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, #000 25%, transparent 25%),
        linear-gradient(-45deg, #000 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #000 75%),
        linear-gradient(-45deg, transparent 75%, #000 75%);
    background-size: 4px 4px;
    animation: glitchTransition 2.5s ease-in-out;
}

@keyframes glitchTransition {
    0% { 
        opacity: 0; 
        transform: scale(1);
        filter: hue-rotate(0deg);
        background-color: transparent;
    }
    20% { 
        opacity: 0.8; 
        transform: scale(1.02);
        filter: hue-rotate(90deg) blur(1px);
        background-color: rgba(255, 0, 255, 0.1);
    }
    40% {
        opacity: 0.6;
        transform: scale(1.05);
        filter: hue-rotate(180deg) blur(2px);
        background-color: rgba(0, 255, 255, 0.1);
    }
    60% { 
        opacity: 0.8; 
        transform: scale(1.03);
        filter: hue-rotate(270deg) blur(1px);
        background-color: rgba(255, 255, 0, 0.1);
    }
    80% { 
        opacity: 0.3; 
        transform: scale(1.01);
        filter: hue-rotate(320deg) blur(0.5px);
        background-color: transparent;
    }
    100% { 
        opacity: 0; 
        transform: scale(1);
        filter: hue-rotate(360deg);
        background-color: transparent;
    }
}

/* Footer - Positioned at bottom */
.main-footer {
    margin-top: 60px;
    width: 100%;
    text-align: center;
    padding: 20px 20px 40px 20px;
    opacity: 0.5;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    transition: opacity 0.3s ease;
}

.main-footer:hover {
    opacity: 0.8;
}

/* Skills Section */
.skills-section {
    margin-top: 30px;
    max-width: 100%;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.skills-grid {
    display: grid;
    gap: 20px;
    max-width: 100%;
}

.skill-category h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-item {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Portfolio Section */
.portfolio-section {
    max-width: 100%;
    overflow: visible;
}

.portfolio-categories {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.portfolio-category {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.portfolio-category.active,
.portfolio-category:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.portfolio-items {
    display: grid;
    gap: 20px;
    max-width: 100%;
}

.portfolio-item {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    max-width: 100%;
    cursor: pointer;
}

.portfolio-item:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.portfolio-item.glitching {
    animation: portfolioGlitch 0.3s infinite;
}

@keyframes portfolioGlitch {
    0% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

.portfolio-media {
    width: 100%;
    height: 150px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 4px;
}

.portfolio-media img,
.portfolio-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-media img,
.portfolio-item:hover .portfolio-media video {
    transform: scale(1.05);
}

.portfolio-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.portfolio-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Experiences Section */
.experiences-section {
    max-width: 100%;
    overflow: hidden;
}

.experience-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px 0;
    transition: all 0.3s ease;
}

.experience-item:last-child {
    border-bottom: none;
}

.experience-item:hover {
    padding-left: 10px;
    border-left: 3px solid rgba(255, 255, 255, 0.5);
}

.experience-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.experience-role {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
    text-transform: lowercase;
    font-style: italic;
}

.experience-period {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    text-transform: lowercase;
}

.experience-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
    backdrop-filter: blur(10px);
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.project-modal-content {
    background: rgba(17, 17, 17, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    max-width: 1200px;
    width: 100%;
    position: relative;
    animation: modalSlideUp 0.4s ease-out;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    margin: 40px auto;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-media {
    width: 100%;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #000;
}

.modal-media img,
.modal-media video {
    width: 100%;
    height: auto;
    display: block;
}

.modal-info {
    padding: 30px;
}

.modal-info h2 {
    font-size: 2rem;
    margin: 0 0 20px 0;
    color: #fff;
    font-weight: 800;
    letter-spacing: -1px;
}

.modal-description {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* Contact Section */
.contact-section {
    max-width: 100%;
    overflow: hidden;
}

.contact-methods {
    margin-bottom: 30px;
    max-width: 100%;
}

.contact-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 10px;
    flex-wrap: wrap;
}

.contact-handle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.qr-section {
    text-align: center;
    max-width: 100%;
}

.qr-section h4 {
    margin-bottom: 15px;
}

.qr-code {
    position: relative;
    display: inline-block;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.qr-code img {
    width: 150px;
    height: 150px;
    display: block;
    max-width: 100%;
}

.qr-glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.1) 50%, transparent 51%);
    background-size: 10px 10px;
    animation: qrGlitch 3s infinite linear;
    opacity: 0;
}

.qr-code:hover .qr-glitch-overlay {
    opacity: 1;
}

@keyframes qrGlitch {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-10px, -10px); }
}

/* Paragraph Glitch Effect */
.glitch-paragraph {
    line-height: 1.6;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.glitch-word {
    display: inline-block;
    margin-right: 4px;
}

/* Enhanced glitch effects for different components */
.glitch-container.hero-title {
    font-size: 4rem;
    font-weight: 800;
    font-style: italic;
}

.glitch-container.tab {
    font-size: 1rem;
}

.glitch-container.location {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Continuous scramble animation */
.continuous-scramble {
    animation: continuousFlicker 2s infinite;
}

@keyframes continuousFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.tab-change-glitch {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
}

.tab-change-glitch.active {
    animation: tabGlitch 0.8s ease-out;
}

@keyframes tabGlitch {
    0% {
        opacity: 0;
        background: linear-gradient(45deg, #000 25%, transparent 25%), 
                    linear-gradient(-45deg, #000 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #000 75%), 
                    linear-gradient(-45deg, transparent 75%, #000 75%);
        background-size: 20px 20px;
        transform: scale(1);
    }
    20% {
        opacity: 0.3;
        background: linear-gradient(45deg, #ff00ff 25%, transparent 25%), 
                    linear-gradient(-45deg, #00ffff 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #ff00ff 75%), 
                    linear-gradient(-45deg, transparent 75%, #00ffff 75%);
        background-size: 10px 10px;
        transform: scale(1.01);
    }
    40% {
        opacity: 0.6;
        background: linear-gradient(90deg, #000 25%, transparent 25%), 
                    linear-gradient(-90deg, #000 25%, transparent 25%), 
                    linear-gradient(90deg, transparent 75%, #000 75%), 
                    linear-gradient(-90deg, transparent 75%, #000 75%);
        background-size: 15px 15px;
        transform: scale(1.02);
        filter: hue-rotate(90deg);
    }
    60% {
        opacity: 0.4;
        background: linear-gradient(45deg, #00ff00 25%, transparent 25%), 
                    linear-gradient(-45deg, #ff0000 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #00ff00 75%), 
                    linear-gradient(-45deg, transparent 75%, #ff0000 75%);
        background-size: 8px 8px;
        transform: scale(1.01);
        filter: hue-rotate(180deg);
    }
    80% {
        opacity: 0.2;
        background: linear-gradient(0deg, #000 25%, transparent 25%), 
                    linear-gradient(-0deg, #000 25%, transparent 25%), 
                    linear-gradient(0deg, transparent 75%, #000 75%), 
                    linear-gradient(-0deg, transparent 75%, #000 75%);
        background-size: 25px 25px;
        transform: scale(1);
        filter: hue-rotate(270deg);
    }
    100% {
        opacity: 0;
        transform: scale(1);
        filter: hue-rotate(360deg);
    }
}

/* Enhanced Tab Styles with Glitch Effect */
.tab.glitching {
    animation: tabTextGlitch 0.3s ease-in-out;
}

@keyframes tabTextGlitch {
    0% { transform: translateX(0) skewX(0); }
    20% { transform: translateX(-2px) skewX(-1deg); color: #ff00ff; }
    40% { transform: translateX(2px) skewX(1deg); color: #00ffff; }
    60% { transform: translateX(-1px) skewX(-0.5deg); }
    80% { transform: translateX(1px) skewX(0.5deg); }
    100% { transform: translateX(0) skewX(0); color: inherit; }
}

/* Enhanced Glitch Button Effects */
.glitch-button.pulse-effect {
    animation: buttonPulseGlitch 3s infinite;
}

@keyframes buttonPulseGlitch {
    0%, 100% {
        border-color: #fff;
        box-shadow: 0 0 10px #fff, 0 0 20px rgba(255, 255, 255, 0.3);
    }
    25% {
        border-color: #ff00ff;
        box-shadow: 0 0 15px #ff00ff, 0 0 30px rgba(255, 0, 255, 0.4);
    }
    50% {
        border-color: #00ffff;
        box-shadow: 0 0 20px #00ffff, 0 0 40px rgba(0, 255, 255, 0.4);
        transform: scale(1.02);
    }
    75% {
        border-color: #ffff00;
        box-shadow: 0 0 15px #ffff00, 0 0 30px rgba(255, 255, 0, 0.4);
    }
}

.glitch-button::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: buttonScanLine 2s linear infinite;
}

@keyframes buttonScanLine {
    0% {
        top: -100%;
    }
    100% {
        top: 200%;
    }
}

.glitch-button:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: buttonDistortion 0.3s linear;
}

@keyframes buttonDistortion {
    0% {
        transform: translateX(0) skewX(0);
    }
    20% {
        transform: translateX(-5px) skewX(-5deg);
    }
    40% {
        transform: translateX(5px) skewX(5deg);
    }
    60% {
        transform: translateX(-3px) skewX(-3deg);
    }
    80% {
        transform: translateX(3px) skewX(3deg);
    }
    100% {
        transform: translateX(0) skewX(0);
    }
}

.glitch-button .scrambled {
    position: relative;
    z-index: 2;
}

.glitch-button.pulse-effect .scrambled {
    animation: buttonTextFlicker 4s infinite;
}

@keyframes buttonTextFlicker {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 5px #fff, 0 0 10px rgba(255, 255, 255, 0.5);
    }
    2% {
        opacity: 0.8;
        text-shadow: 0 0 5px #ff00ff, 0 0 10px rgba(255, 0, 255, 0.5);
    }
    4% {
        opacity: 1;
        text-shadow: 0 0 5px #fff, 0 0 10px rgba(255, 255, 255, 0.5);
    }
    25% {
        opacity: 0.9;
        text-shadow: 0 0 5px #00ffff, 0 0 10px rgba(0, 255, 255, 0.5);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 8px #fff, 0 0 15px rgba(255, 255, 255, 0.6);
    }
    75% {
        opacity: 0.95;
        text-shadow: 0 0 5px #ffff00, 0 0 10px rgba(255, 255, 0, 0.5);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .glitch-container.intro-title {
        font-size: 2.5rem;
    }
    #main-content {
        padding: 30px 20px 60px 20px;
    }
    .hero-section {
        flex-direction: column;
        gap: 40px;
        margin-bottom: 50px;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-right {
        margin-right: 0;
        padding-right: 0;
    }
    .logo-container {
        top: 15px;
        left: 15px;
    }
    .site-logo {
        width: 60px;
    }
    .project-modal-content {
        max-width: 95%;
    }
    .modal-info h2 {
        font-size: 1.5rem;
    }
    .modal-description {
        font-size: 0.9rem;
    }
    .experience-title {
        font-size: 1.1rem;
    }
    .experience-description {
        font-size: 0.85rem;
    }
}