* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    background: #0a0a0a;
    color: #fff;
}


img,
video,
canvas {
    max-width: 100%;
    height: auto;
}


.hero-content,
.about-content,
.project-content,
.contact-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}


#loader {
    position: fixed;
    inset: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    width: 100vw;
    height: 100dvh;
    min-height: 100vh;
    background: #0a0a0a;
    display: grid;
    place-items: center;
    z-index: 10000;
    transition: opacity 1s;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid #333;
    border-top: 3px solid #00ffcc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s;
}

nav.scrolled {
    padding: 15px 50px;
    background: rgba(10, 10, 10, 0.95);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    z-index: 1002;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    padding: 5px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1003;
    background: transparent;
    border: none;
    padding: 8px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}


#hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    animation: fadeInUp 1s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    min-height: 80vh;
}

.hero-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.greeting {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #00ffcc;
    font-weight: 600;
    animation: fadeInLeft 1s ease-out 0.3s both;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: bold;
    margin: 0;
    background: linear-gradient(45deg, #00ffcc, #0099ff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
    background-size: 200% 200%;
}

.typing-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 60px;
    margin: 15px 0;
    width: 100%;
}

.typing-text {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    color: #0099ff;
    min-width: 300px;
    text-align: center;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
}

.cursor {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #00ffcc;
    animation: blink 1s infinite;
    display: inline-block;
    font-weight: normal;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: #aaa;
    margin: 0;
    max-width: 800px;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.9s both;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    font-size: 16px;
    min-width: 180px;
}

.cta-button.primary {
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    color: #000;
}

.cta-button.secondary {
    background: transparent;
    color: #00ffcc;
    border: 2px solid #00ffcc;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 204, 0.3);
}

.cta-button.secondary:hover {
    background: #00ffcc;
    color: #000;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: fadeInUp 1s ease-out 1.8s both;
    z-index: 10;
    cursor: pointer;
}

.scroll-text {
    font-size: 14px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.scroll-arrow {
    color: #00ffcc;
    font-size: 18px;
    animation: bounce 2s infinite;
    text-shadow: 0 2px 4px rgba(0, 255, 204, 0.3);
}


section {
    padding: 100px 50px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 50px;
    text-align: center;
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.project-card {
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.1), rgba(0, 153, 255, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 255, 204, 0.2);
}

.project-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.project-content {
    padding: 25px;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #00ffcc;
}

.project-description {
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tech-tag {
    padding: 5px 12px;
    background: rgba(0, 153, 255, 0.2);
    border-radius: 5px;
    font-size: 12px;
    color: #0099ff;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 204, 0.4);
    background: linear-gradient(45deg, rgba(0, 255, 204, 0.15), rgba(0, 153, 255, 0.15));
    color: #00ffcc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 204, .15);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1) !important;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    color: #000 !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2) !important;
}

.btn-secondary {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.04));
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
}


#about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-content {
    padding-right: 20px;
}

.about-content h2 {
    text-align: left;
    margin-bottom: 30px;
}

.about-content p {
    color: #aaa;
    line-height: 1.8;
    margin-bottom: 20px;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.skill-tag {
    padding: 8px 20px;
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid #00ffcc;
    border-radius: 20px;
    color: #00ffcc;
    font-size: 14px;
    transition: all 0.3s;
}

.skill-tag:hover {
    background: rgba(0, 255, 204, 0.2);
    transform: translateY(-2px);
}

.about-3d {
    height: 550px;
    width: 100%;
    overflow: hidden;
}

.about-3d canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.about-3d h2 {
    display: none;
}


#contact {
    text-align: center;
    padding: 100px 50px;
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.05), rgba(0, 153, 255, 0.05));
    border-radius: 30px;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    margin-bottom: 8px;
    color: #00ffcc;
}

.form-group input,
.form-group textarea {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00ffcc;
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    padding: 15px 40px;
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    color: #000;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 204, 0.3);
}

#formSuccessMsg {
    max-width: min(90vw, 520px);
    text-align: center;
    line-height: 1.35;
    font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    padding: 14px 24px;
    top: max(16px, env(safe-area-inset-top));
    pointer-events: none;
}


footer {
    text-align: center;
    padding: 30px;
    background: #050505;
    color: #666;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    color: #000;
    transform: translateY(-3px);
}


.project-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 7, 0.75);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.project-overlay.active {
    display: flex;
}

.project-detail {
    width: min(1000px, 95vw);
    max-height: 90vh;
    overflow: auto;
    background: #0f1012;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.detail-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(15, 16, 18, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: #00ffcc;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.back-btn:hover {
    transform: translateX(-2px);
    background: rgba(0, 255, 204, 0.08);
}

.detail-title {
    font-size: 1.1rem;
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.detail-body {
    display: grid;
    gap: 20px;
    padding: 18px;
}

.detail-gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.detail-gallery img {
    height: 220px;
    width: auto;
    border-radius: 12px;
    object-fit: cover;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.detail-description {
    color: #c7c7c7;
    line-height: 1.7;
}

.detail-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tech .tech-tag {
    background: rgba(0, 255, 204, 0.15);
    border: 1px solid rgba(0, 255, 204, 0.4);
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

/* --- AI Chat Icon & Modal --- */
.ai-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 255, 204, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 24px;
    color: #000;
}

.ai-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 255, 204, 0.5);
}

.ai-icon i {
    animation: pulse 2s infinite;
}

.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.ai-modal.active {
    display: flex;
}

.ai-modal-content {
    background: #0f1012;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    width: 100%;
    max-width: 450px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.ai-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px 50px 15px 20px;
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    color: #000;
    font-weight: bold;
    flex-wrap: nowrap;
    gap: 10px;
    min-height: 60px;
}

.ai-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-modal-header .btn {
    flex-shrink: 0;
    margin-left: 0;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.ai-close-btn {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #000;
    padding: 5px;
    line-height: 1;
}

.ai-chat-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(85vh - 120px);
    min-height: 300px;
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-bubble {
    align-items: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.3);
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: rgba(0, 153, 255, 0.1);
    border-color: rgba(0, 153, 255, 0.3);
}

.message-bubble {
    flex: 1;
    max-width: 85%;
    display: flex;
    flex-direction: column;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 100%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.user-message .message-content {
    background: linear-gradient(45deg, #00ffcc, #0099ff);
    color: #000;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.message-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
}

.message-time {
    font-size: 10px;
    color: #666;
}

.copy-message-btn,
.reaction-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-message-btn:hover,
.reaction-btn:hover {
    color: #00ffcc;
    background: rgba(0, 255, 204, 0.1);
    transform: scale(1.1);
}

.ai-chat-input {
    display: flex;
    padding: 15px;
    gap: 10px;
    background: #0f1012;
    align-items: stretch;
    flex-wrap: nowrap;
}

.ai-chat-input input {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    min-width: 0;
}

.ai-chat-input input:focus {
    outline: none;
    border-color: #00ffcc;
    background: rgba(255, 255, 255, 0.08);
}

.ai-chat-input button {
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s;
}

.ai-chat-input button:hover {
    transform: scale(1.05);
}

/* Typing Indicator */
.typing-indicator .typing-animation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator .typing-text {
    font-size: 12px !important;
    color: #666 !important;
    font-weight: 400 !important;
    min-width: auto !important;
    text-align: left !important;
    overflow: visible !important;
}

.typing-indicator .cursor {
    display: none;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #00ffcc;
    border-radius: 50%;
    animation: typingPulse 1.5s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Suggestions */
.suggestions {
    margin-top: 10px;
    padding: 8px;
}

.suggestion-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.suggestion-btn {
    padding: 12px 16px;
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 12px;
    color: #00ffcc;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    white-space: nowrap;
    text-align: left;
    font-weight: 500;
}

.suggestion-btn:hover {
    background: rgba(0, 255, 204, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 204, 0.3);
}


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes gradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes typingPulse {

    0%,
    60%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideDown {
    from {
        transform: translate(-50%, -16px);
    }

    to {
        transform: translate(-50%, 0);
    }
}



@media (max-width: 1200px) {
    nav {
        padding: 20px 30px;
    }

    section {
        padding: 80px 30px;
    }

    #about {
        gap: 40px;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }
}


@media (max-width: 1024px) {
    .hero-title {
        font-size: clamp(2rem, 6vw, 4rem);
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    }

    .section-title {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
    }

    #about {
        grid-template-columns: 1fr;
    }

    .about-content {
        text-align: center;
        padding-right: 0;
    }

    .about-content h2 {
        text-align: center;
    }

    .about-3d {
        height: 420px;
    }

    .about-3d h2 {
        display: block;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}


@media (max-width: 768px) {

    nav,
    nav.scrolled {
        padding: 15px 20px;
        height: 70px;
    }

    .logo {
        font-size: 18px !important;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
        background: #00ffcc;
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
        background: #00ffcc;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100vw;
        width: 100vw;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 1001;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
        text-align: center;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-links a {
        font-size: 1.8rem;
        padding: 15px 30px;
        min-width: 200px;
    }

    .nav-links a::after {
        display: none;
    }

    .hero-content {
        gap: 20px;
        padding: 10px;
        min-height: 70vh;
    }

    .greeting {
        font-size: clamp(1rem, 4vw, 1.2rem);
        margin-bottom: 5px;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem) !important;
        margin: 5px 0;
        line-height: 1.1;
    }

    .typing-wrapper {
        min-height: 40px;
        margin: 5px 0;
    }

    .typing-text {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        min-width: 200px;
        text-align: center;
    }

    .cursor {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .hero-subtitle {
        font-size: clamp(0.85rem, 3.5vw, 1rem);
        margin: 10px 0;
        padding: 0 5px;
        line-height: 1.4;
        max-width: 95%;
    }

    .hero-actions {
        gap: 10px;
        margin: 15px 0;
    }

    .cta-button {
        min-width: 140px;
        padding: 10px 20px;
        font-size: 13px;
    }

    .hero-social {
        display: none !important;
    }

    section {
        padding: 60px 20px;
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
        margin-bottom: 30px;
    }

    .about-3d {
        height: 420px;
    }

    .skills {
        justify-content: center;
    }

    .skill-tag {
        font-size: 12px;
        padding: 6px 15px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-image {
        height: 200px;
    }

    .project-content {
        padding: 20px;
    }

    .project-title {
        font-size: 1.3rem;
    }

    .project-description {
        font-size: 14px;
        line-height: 1.5;
    }

    .tech-tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    #contact {
        padding: 60px 20px;
        margin: 0 20px;
        border-radius: 20px;
    }

    .scroll-indicator {
        bottom: 20px;
    }

    .scroll-text {
        font-size: 12px;
    }

    .scroll-arrow {
        font-size: 16px;
    }


    .ai-icon {
        width: 55px;
        height: 55px;
        font-size: 22px;
        bottom: 20px;
        right: 20px;
    }

    .ai-modal {
        padding: 10px;
        align-items: flex-end;
    }

    .ai-modal-content {
        max-height: 90vh;
        border-radius: 15px 15px 0 0;
    }

    .ai-modal-header {
        padding: 12px 50px 12px 15px;
        flex-wrap: nowrap;
        gap: 6px;
        min-height: 55px;
    }

    .ai-modal-header h3 {
        font-size: 1rem;
        min-width: 0;
    }

    .ai-modal-header .btn {
        padding: 5px 8px !important;
        font-size: 10px !important;
    }

    .ai-chat-body {
        max-height: calc(90vh - 140px);
        min-height: 280px;
    }

    .ai-chat-messages {
        padding: 12px;
        max-height: calc(90vh - 220px);
        min-height: 200px;
    }

    .message-content {
        max-width: 90%;
        font-size: 13px;
        padding: 10px 14px;
    }

    .ai-chat-input {
        padding: 12px;
        gap: 8px;
    }

    .ai-chat-input input {
        padding: 10px;
        font-size: 16px;
        border-radius: 8px;
    }

    .ai-chat-input button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .suggestion-buttons {
        grid-template-columns: 1fr;
    }

    .suggestion-btn {
        font-size: 13px;
        padding: 10px 15px;
        width: 100%;
        text-align: center;
    }
}


@media (max-width: 480px) {

    nav,
    nav.scrolled {
        padding: 12px 15px;
        height: 60px;
    }

    .logo {
        font-size: 16px !important;
    }

    .menu-toggle span {
        width: 20px;
        height: 2px;
        margin: 2px 0;
    }

    .hero-content {
        gap: 15px;
        padding: 5px;
        min-height: 65vh;
    }

    .hero-title {
        font-size: clamp(1.8rem, 9vw, 3rem) !important;
        margin: 5px 0;
    }

    .typing-text {
        font-size: clamp(1rem, 6vw, 1.5rem);
        min-width: 160px;
    }

    .cursor {
        font-size: clamp(1rem, 6vw, 1.5rem);
    }

    .hero-subtitle {
        font-size: clamp(0.8rem, 4vw, 0.95rem);
        padding: 0 3px;
    }

    .cta-button {
        min-width: 120px;
        padding: 8px 16px;
        font-size: 12px;
    }

    section {
        padding: 50px 15px;
    }

    .section-title {
        font-size: clamp(1.3rem, 7vw, 2rem);
        margin-bottom: 25px;
    }

    .about-content p {
        font-size: 14px;
        line-height: 1.6;
    }

    .about-3d {
        height: 360px;
    }

    .project-image {
        height: 180px;
    }

    .project-content {
        padding: 15px;
    }

    .project-title {
        font-size: 1.2rem;
    }

    #contact {
        padding: 40px 15px;
        margin: 0 15px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
        -webkit-appearance: none;
        appearance: none;
    }

    .scroll-indicator {
        bottom: 15px;
    }

    .scroll-text {
        font-size: 11px;
    }

    .scroll-arrow {
        font-size: 14px;
    }

    #formSuccessMsg {
        width: calc(100vw - 32px) !important;
        padding: 12px 16px !important;
        border-radius: 14px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .28) !important;
        animation: toastSlideDown .35s ease-out !important;
    }
}


@media (hover: none) and (pointer: coarse) {

    .cta-button,
    .submit-btn,
    .menu-toggle {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-links a {
        padding: 15px 20px;
        min-height: 44px;
    }

    .skill-tag {
        min-height: 36px;
        padding: 8px 16px;
    }

    .ai-icon,
    .ai-close-btn,
    .suggestion-btn,
    .ai-chat-input button {
        min-height: 44px;
        min-width: 44px;
    }
}


@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loader-spinner {
        animation: none;
    }
}


@media (prefers-contrast: high) {

    .skill-tag,
    .tech-tag,
    .project-card,
    .nav-links a {
        border-width: 2px;
    }
}


@media print {

    nav,
    #canvas-container,
    .cta-button,
    .submit-btn,
    .ai-icon,
    .ai-modal {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .hero-title,
    .section-title {
        color: black;
        -webkit-text-fill-color: black;
    }
}

html {
  scroll-behavior: smooth;

}
