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

    /* Add this at the very beginning of your CSS, after the * selector */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: white;
}

/* Animated Background Stars */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Design & Development: Harshad Mahajan | 2025 */

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    from { filter: brightness(1); }
    to { filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3)); }
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item a:hover {
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.nav-item a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    transition: width 0.3s ease;
}

.nav-item a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at 30% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(69, 183, 209, 0.05) 0%, transparent 50%);
    padding: 120px 2rem 2rem;
}

.hero-content {
    text-align: center;
    z-index: 10;
    position: relative;
    max-width: 1200px;
    width: 100%;
}

.hero-title {
    font-size: 4rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
    animation: titleFloat 3s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 3rem;
    animation: subtitleFloat 3s ease-in-out infinite 0.5s;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes subtitleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Skills Matrix */
.skills-matrix {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
}

.skill-portal {
    position: relative;
    background: rgba(20, 20, 40, 0.8);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    cursor: pointer;
}

.skill-portal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 300%;
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: portalGlow 4s ease infinite;
}

.skill-portal:hover::before {
    opacity: 0.3;
}

.skill-portal:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(20, 20, 40, 0.9);
}

@keyframes portalGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.skill-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.skill-icon {
    font-size: 2rem;
    margin-right: 1rem;
    animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

.skill-title {
    font-size: 1.3rem;
    color: #4ecdc4;
    margin: 0;
    line-height: 1.2;
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-item {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.skill-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 500;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-percentage {
    font-size: 0.9rem;
    color: #4ecdc4;
    font-weight: bold;
    flex-shrink: 0;
}

.skill-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
    border-radius: 3px;
    width: 0%;
    transition: width 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mastery Section */
.mastery-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    color: #4ecdc4;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.mastery-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.mastery-radar {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mastery-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
    background: rgba(20, 20, 40, 0.8);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #4ecdc4;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

/* Tech Stack Section */
.tech-stack-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tech-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.tech-category {
    background: rgba(20, 20, 40, 0.8);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-title {
    color: #4ecdc4;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tech-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.tech-item:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.1);
}

.tech-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
    filter: brightness(1.2) contrast(1.1);
    transition: all 0.3s ease;
}

.tech-item span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-weight: 500;
}

/* Footer */
.footer {
    background: rgba(10, 10, 10, 0.9);
    padding: 3rem 2rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.link-content {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.social-icon {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.link-name {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Add this new rule for all sections */
.hero-section,
.mastery-section,
.tech-stack-section {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Canvas responsive fixes */
#skillRadar {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.mastery-radar {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    overflow: hidden;
}

/* ============ RESPONSIVE DESIGN - MOBILE FIRST ============ */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .header {
        padding: 1rem 1.5rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .skills-matrix {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .mastery-container {
        gap: 3rem;
    }
    
    .tech-categories {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .header {
        padding: 0.8rem 1rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center; /* Add this */
        width: 100%; /* Add this */
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-item a {
        font-size: 0.9rem;
    }
    
    .hero-section {
        padding: 100px 1rem 2rem;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2.8rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .skills-matrix {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .skill-portal {
        padding: 1.5rem;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .skill-title {
        font-size: 1.1rem;
        white-space: normal; /* Add this */
        word-wrap: break-word; /* Add this */
        line-height: 1.3; /* Add this */
    }
    
    .skill-icon {
        font-size: 1.5rem;
        margin-right: 0.8rem;
    }
    
    .skill-item {
        padding: 0.8rem;
    }
    
    .skill-name {
        font-size: 0.9rem;
    }
    
    .skill-percentage {
        font-size: 0.8rem;
    }
    
    .mastery-section {
        padding: 3rem 1rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .mastery-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        width: 100%;
    }
    
    .mastery-radar {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        padding: 0 1rem;
        box-sizing: border-box;
    }
    
    #skillRadar {
        width: 280px !important;
        height: 280px !important;
        max-width: 100%;
    }
    
    .mastery-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.5rem 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .tech-stack-section {
        padding: 3rem 1rem;
    }
    
    .tech-categories {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
        width: 100%;
        padding: 0;
    }
    
    .tech-category {
        padding: 1.5rem;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .category-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .tech-items {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 0.8rem;
    }
    
    .tech-item {
        padding: 0.8rem 0.5rem;
    }
    
    .tech-item img {
        width: 35px;
        height: 35px;
    }
    
    .tech-item span {
        font-size: 0.8rem;
    }
    
    .footer {
        padding: 2rem 1rem 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .social-links {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
        width: 100%;
    }
    
    .social-link {
        min-width: 100px;
        padding: 10px 16px;
    }
    
    .link-name {
        font-size: 0.8rem;
    }
    
    .footer-text {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

/* Large mobile phones */
@media (max-width: 480px) {
    .header {
        padding: 0.6rem 0.8rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        gap: 0.8rem;
    }
    
    .nav-item a {
        font-size: 0.8rem;
    }
    
    .hero-section {
        padding: 90px 0.8rem 1.5rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 0.6rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .skills-matrix {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    .skill-portal {
        padding: 1.2rem;
        margin: 0;
    }
    
    .skill-title {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .skill-icon {
        font-size: 1.3rem;
        margin-right: 0.6rem;
    }
    
    .skill-item {
        padding: 0.7rem;
    }
    
    .skill-name {
        font-size: 0.85rem;
        gap: 0.3rem;
    }
    
    .skill-percentage {
        font-size: 0.75rem;
    }
    
    .skill-bar {
        height: 5px;
    }
    
    .mastery-section {
        padding: 2.5rem 0.8rem;
    }

    .mastery-radar {
        max-width: 250px;
        padding: 0 0.5rem;
    }
    
    #skillRadar {
        width: 240px !important;
        height: 240px !important;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .mastery-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.2rem 0.8rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .tech-stack-section {
        padding: 2.5rem 0.8rem;
    }
    
    .tech-category {
        padding: 1.2rem;
        margin: 0 0.2rem;
        border-radius: 15px;
    }
    
    .category-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .tech-items {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 0.6rem;
    }
    
    .tech-item {
        padding: 0.6rem 0.3rem;
    }
    
    .tech-item img {
        width: 30px;
        height: 30px;
        margin-bottom: 0.3rem;
    }
    
    .tech-item span {
        font-size: 0.7rem;
    }
    
    .footer {
        padding: 1.5rem 0.8rem 1rem;
    }
    
    .social-links {
        gap: 0.8rem;
    }
    
    .social-link {
        min-width: 80px;
        padding: 8px 12px;
    }
    
    .social-icon {
        width: 16px;
        height: 16px;
    }
    
    .link-name {
        font-size: 0.7rem;
    }
    
    .footer-text {
        font-size: 0.7rem;
        padding: 0 0.5rem;
    }
}

/* Very small mobile phones */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .skill-portal {
        padding: 1rem;
    }
    
    .skill-title {
        font-size: 0.9rem;
    }
    
    .skill-icon {
        font-size: 1.2rem;
        margin-right: 0.5rem;
    }
    
    .skill-name {
        font-size: 0.8rem;
    }
    
    .skill-percentage {
        font-size: 0.7rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .section-subtitle {
        font-size: 0.8rem;
    }
    
    .mastery-stats {
        gap: 0.8rem;
    }

    .mastery-radar {
        max-width: 200px;
    }
    
    #skillRadar {
        width: 200px !important;
        height: 200px !important;
    }
    
    .stat-item {
        padding: 1rem 0.6rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .tech-category {
        padding: 1rem;
    }
    
    .category-title {
        font-size: 1rem;
    }
    
    .tech-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .tech-item {
        padding: 0.5rem 0.2rem;
    }
    
    .tech-item img {
        width: 25px;
        height: 25px;
    }
    
    .tech-item span {
        font-size: 0.65rem;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .social-link {
        width: 100px;
    }
    
    .footer-text {
        font-size: 0.65rem;
    }
}

/* Landscape orientation for mobile devices */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 80px 1rem 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .mastery-container {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .mastery-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}