:root {
    --bg: #fafafa;
    --bg-rgb: 250, 250, 250;
    --text: #222222;
    --card-bg: #ffffff;
    --border: #d1d5db;
    --accent: #1e90ff;
    --accent2: #105fa9;
    --link-hover: #0b4a8a;
    --shadow-light: rgba(30, 144, 255, 0.15);
}

body.dark {
    --bg: #121212;
    --bg-rgb: 18, 18, 18;
    --text: #f5f5f5;
    --card-bg: #1e1e1e;
    --border: #2a2a2a;
    --accent: #00aaff;
    --accent2: #0077cc;
    --link-hover: #66d9ff;
    --shadow-light: rgba(0, 170, 255, 0.3);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: visible;
    overflow-y: auto;
}

.bg-animations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: visible;
}

.bg-shape {
    position: absolute;
    border-radius: 50% 40% 60% 30% / 30% 60% 40% 50%;
    background: radial-gradient(circle at 30% 30%, var(--accent2) 0%, var(--accent2) 20%, transparent 70%);
    opacity: 0.2;
    animation: floatRotateScale 30s infinite linear;
}

.shape-1 {
    width: 600px;
    height: 600px;
    top: -120px;
    left: -180px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
    animation-delay: 8s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    top: -50px;
    right: -60px;
    animation-delay: 4s;
    opacity: 0.18;
}

@keyframes floatRotateScale {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.05);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

#scrollToTop {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scrollToTop::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-right: 3px solid #fff;
    border-top: 3px solid #fff;
    transform: rotate(-45deg);
    margin-top: 2px;
    transition: transform 0.3s ease;
}

#scrollToTop:hover::before {
    transform: rotate(-45deg) scale(1.2);
}

#scrollToTop.show {
    opacity: 1;
    visibility: visible;
}

#scrollToTop:hover {
    background-color: var(--accent2);
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.top-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 1001;
}

.top-controls button {
    background: var(--card-bg);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    padding: 8px 14px;
    box-shadow: 0 2px 6px var(--shadow-light);
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease,
        transform 0.2s ease;
}

.top-controls button:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 12px var(--accent);
    transform: translateY(-2px);
}

.main-header {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    overflow: visible;
}

.logo {
    font-size: 36px;
    font-weight: 700;
    text-decoration: none;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.logo:hover,
.logo:focus {
    transform: scale(1.05);
    color: var(--accent2);
}

.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    transition: transform 0.3s ease;
    position: relative;
}

.burger-line {
    width: 30px;
    height: 3px;
    background-color: var(--accent);
    border-radius: 3px;
    transition: all 0.4s ease;
    transform-origin: center;
}

.nav {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav a {
    color: var(--accent);
    font-weight: 600;
    font-size: 18px;
    position: relative;
    text-decoration: none;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 3px;
    background: var(--accent2);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav a:hover,
.nav a:focus {
    color: var(--accent2);
}

.nav a:hover::after,
.nav a:focus::after {
    width: 100%;
}

.section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto 60px;
    text-align: center;
    overflow: visible;
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--accent);
    font-weight: 700;
}

/* HERO */
.hero-section {
    padding: 6rem 2rem;
    position: relative;
    z-index: 0;
}

.hero-section .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    padding: 20px 0 20px 80px;
}

.hero-avatar {
    flex: 0 0 auto;
    text-align: center;
}

.hero-avatar img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 6px 15px var(--shadow-light);
    transition: transform 0.3s;
}

.hero-avatar img:hover {
    transform: scale(1.05);
}

.hero-text {
    flex: 1 1 400px;
    max-width: 800px;
    text-align: left;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-title i {
    font-size: 1.6rem;
    color: var(--accent2);
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text);
    font-weight: 500;
    max-width: 720px;
    margin: 0 0 2rem 0;
}

.accent-word {
    font-weight: 700;
    color: var(--accent);
}

.tech-name {
    font-weight: 700;
    color: var(--accent2);
}

.tech-name i {
    margin-right: 6px;
    font-size: 1rem;
    color: var(--accent2);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px var(--shadow-light);
    font-size: 1rem;
}

.hero-btn:hover {
    background-color: var(--link-hover);
    transform: translateY(-2px);
}

.resume-btn {
    background-color: #fff;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.resume-btn:hover {
    background-color: var(--accent);
    color: #fff;
}

.hero-socials {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.hero-socials a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    color: var(--text);
    border-radius: 50%;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-light);
}

.hero-socials a:hover {
    background-color: var(--accent);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent);
}

/* ABOUT */
.about-section {
    position: relative;
    padding: 6rem 2rem;
    overflow: visible;
    z-index: 0;
}

.about-section .container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--text);
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-text {
    font-size: 1.15rem;
    line-height: 1.75;
    padding: 1.5rem 2rem;
    background-color: var(--card-bg);
    border-left: 6px solid var(--accent);
    border-radius: 12px;
    box-shadow: 0 6px 16px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-text:hover {
    transform: translateX(6px);
    box-shadow: 0 8px 20px var(--shadow-light);
}

body.dark .about-text {
    background-color: var(--card-bg);
    color: var(--text);
    border-left-color: var(--accent);
}

body.dark .about-bg-shape {
    background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
    opacity: 0.1;
}

/* PROJECTS */
#projects {
    padding: 60px 20px;
}

#projects-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--text);
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 20px;
}

.card {
    background: var(--card-bg);
    padding: 28px 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 12px var(--shadow-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.35s ease, transform 0.3s ease;
    cursor: default;
}

.card:hover {
    box-shadow: 0 20px 40px var(--shadow-light);
    transform: translateY(-10px);
    cursor: pointer;
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card:hover .card-img {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-content {
    padding: 20px 0 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.card-desc {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 16px;
    flex-grow: 1;
    line-height: 1.5;
}

.tech-stack {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-stack li {
    background-color: rgba(30, 144, 255, 0.15);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
    transition: background-color 0.3s ease;
}

.card:hover .tech-stack li {
    background-color: var(--accent);
    color: #fff;
}

.project-link {
    display: inline-block;
    text-decoration: none;
    margin-top: auto;
    color: var(--accent);
    font-weight: 700;
    border: 2px solid var(--accent);
    padding: 10px 22px;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
    user-select: none;
}

.project-link:hover {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 6px 20px var(--shadow-light);
    transform: translateY(-2px);
}

/* SKILLS */
#skills {
    text-align: center;
    padding: 3rem 1rem 5rem;
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--text);
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category-title {
    font-size: 1.75rem;
    margin: 2.5rem 0 1.5rem;
    color: var(--text);
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.skill-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 10px var(--shadow-light);
    padding: 1.5rem 1rem;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease;
    cursor: default;
}

.skill-item:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 30px var(--shadow-light);
    background-color: rgba(30, 144, 255, 0.1);
}

.skill-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    filter: brightness(0) saturate(100%) invert(30%);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.skill-item:hover .skill-icon {
    transform: scale(1.15);
    filter: brightness(1) saturate(1);
}

body.dark .skill-icon {
    filter: brightness(0) invert(100%);
}

.skill-item span {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
    user-select: none;
    text-align: center;
}

body.dark .skill-item {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text);
}

body.dark .skill-item:hover {
    background-color: rgba(0, 170, 255, 0.15);
}

/* CONTACTS */
#contact {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem 1rem;
    color: var(--text);
}

#contact h2 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--text);
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#contact p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--accent2);
    text-decoration: none;
    background: var(--card-bg);
    border: 2px solid var(--accent2);
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    box-shadow: 0 6px 15px var(--shadow-light);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    user-select: none;
}

.contact-link:hover,
.contact-link:focus {
    background-color: var(--accent2);
    color: #fff;
    transform: translateY(-3px);
    outline: none;
}

.contact-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(30%);
    transition: filter 0.3s ease;
}

body.dark .contact-icon {
    filter: brightness(0) invert(100%);
}

/* FOOTER */
.footer {
    text-align: center;
    padding: 30px 10px;
    background: var(--card-bg);
    color: var(--text);
    border-top: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 1500px) {
    .main-header {
        flex-direction: column;
        align-items: center;
    }

    .nav {
        justify-content: center;
        gap: 20px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero p {
        font-size: 1.2rem;
    }
}

@media (max-width: 1200px) {
    .hero {
        padding: 100px 20px 80px;
    }

    .hero h1 {
        font-size: 2.6rem;
    }

    .hero p {
        font-size: 1.15rem;
    }

    .nav {
        gap: 24px;
    }

    .nav a {
        font-size: 16px;
    }

    .projects {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 935px) {
    .section {
        padding: 60px 16px 40px;
    }

    .section h2,
    #projects-title,
    .section-title,
    #contact h2 {
        font-size: 2.2rem;
        margin-bottom: 30px;
    }

    .hero-section {
        padding: 4.5rem 1.5rem;
    }

    .hero-section .container {
        padding-left: 40px;
        gap: 3rem;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        max-width: 600px;
    }

    .hero-buttons {
        gap: 0.75rem;
    }

    .hero-btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.25rem;
    }

    .nav {
        gap: 20px;
        max-width: 500px;
    }

    .nav a {
        font-size: 17px;
    }

    .about-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }

    .about-text {
        font-size: 1.05rem;
        padding: 1.25rem 1.75rem;
    }

    .projects {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 16px;
    }

    .card {
        padding: 22px 18px;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .card-desc {
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .tech-stack li {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    .project-link {
        font-size: 0.9rem;
        padding: 8px 18px;
    }

    #skills {
        padding: 2.5rem 1rem 4rem;
        max-width: 700px;
    }

    .category-title {
        font-size: 1.5rem;
        margin: 2rem 0 1.25rem;
    }

    .skills-grid {
        gap: 1.5rem;
        max-width: 700px;
    }

    .skill-item span {
        font-size: 0.9rem;
    }

    #contact {
        max-width: 500px;
        padding: 2.5rem 1rem;
    }

    #contact p {
        font-size: 1.1rem;
    }

    .contact-link {
        font-size: 0.95rem;
        padding: 0.6rem 1.3rem;
    }

    .footer {
        font-size: 13px;
        padding: 25px 10px;
    }
}


@media (max-width: 768px) {
    .section {
        padding: 40px 14px 30px;
    }

    .section h2,
    #projects-title,
    .section-title,
    #contact h2 {
        font-size: 2rem;
        margin-bottom: 25px;
    }

    .hero-section {
        padding: 4rem 1rem;
    }

    .hero-section .container {
        padding-left: 30px;
        gap: 2.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        max-width: 480px;
    }

    .hero-buttons {
        gap: 0.6rem;
    }

    .hero-btn {
        font-size: 0.85rem;
        padding: 0.55rem 1.1rem;
    }

    .nav {
        gap: 16px;
        max-width: 450px;
    }

    .nav a {
        font-size: 15px;
    }

    .about-title {
        font-size: 2rem;
        margin-bottom: 1.8rem;
    }

    .about-text {
        font-size: 1rem;
        padding: 1.2rem 1.5rem;
    }

    .projects {
        gap: 18px;
        padding: 14px;
    }

    .card {
        padding: 18px 14px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-desc {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .tech-stack li {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .project-link {
        font-size: 0.85rem;
        padding: 7px 16px;
    }

    #skills {
        padding: 2rem 1rem 3.5rem;
        max-width: 600px;
    }

    .category-title {
        font-size: 1.4rem;
        margin: 1.8rem 0 1rem;
    }

    .skills-grid {
        gap: 1.2rem;
        max-width: 600px;
    }

    .skill-item span {
        font-size: 0.85rem;
    }

    #contact {
        max-width: 450px;
        padding: 2rem 1rem;
    }

    #contact p {
        font-size: 1rem;
    }

    .contact-link {
        font-size: 0.9rem;
        padding: 0.5rem 1.2rem;
    }

    .footer {
        font-size: 12px;
        padding: 20px 10px;
    }
}

@media (max-width: 682px) {
    .section {
        padding: 35px 12px 25px;
    }

    .section h2,
    #projects-title,
    .section-title,
    #contact h2 {
        font-size: 1.85rem;
        margin-bottom: 22px;
    }

    .hero-section {
        padding: 3.5rem 1rem;
    }

    .hero-section .container {
        padding-left: 20px;
        gap: 2rem;
    }

    .hero-title {
        font-size: 1.85rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        max-width: 400px;
    }

    .hero-buttons {
        gap: 0.5rem;
    }

    .hero-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    .nav {
        gap: 14px;
        max-width: 400px;
    }

    .nav a {
        font-size: 14px;
    }

    .about-section {
        padding: 4rem 2rem 3rem;
    }

    .about-title {
        font-size: 1.85rem;
        margin-bottom: 1.5rem;
    }

    .about-text {
        font-size: 0.95rem;
        padding: 1rem 1.25rem;
    }

    #projects {
        padding: 3rem 1rem;
        margin-bottom: 0;
    }

    .projects {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 12px;
    }

    .card {
        padding: 16px 12px;
    }

    .card-title {
        font-size: 1.05rem;
    }

    .card-desc {
        font-size: 0.85rem;
        line-height: 1.35;
    }

    .tech-stack li {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .project-link {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    #skills {
        padding: 1.8rem 1rem 3rem;
        max-width: 550px;
    }

    .category-title {
        font-size: 1.3rem;
        margin: 1.5rem 0 0.8rem;
    }

    .skills-grid {
        gap: 1rem;
        max-width: 550px;
    }

    .skill-item span {
        font-size: 0.8rem;
    }

    #contact {
        max-width: 400px;
        padding: 1.8rem 1rem;
    }

    #contact p {
        font-size: 0.95rem;
    }

    .contact-link {
        font-size: 0.85rem;
        padding: 0.45rem 1rem;
    }

    .footer {
        font-size: 11px;
        padding: 18px 10px;
    }
}

@media (max-width: 663px) {
    .hero-section {
        padding: 4rem 1.5rem 3.5rem;
    }

    .hero-section .container {
        flex-direction: column;
        text-align: center;
        padding-left: 0;
        gap: 2.5rem;
    }

    .hero-text {
        text-align: center;
        max-width: 100%;
        max-height: 150px;
    }

    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.5;
        max-width: 480px;
        margin: 0 auto;
    }

    .burger-btn {
        display: flex;
    }

    .nav {
        position: fixed;
        width: 400px;
        top: 100px;
        left: 50%;
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        display: flex;
        gap: 1rem;
        padding: 0.5rem;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(30, 144, 255, 0.15);
        transition: transform 0.4s ease, opacity 0.4s ease;
        z-index: 1099;
        white-space: nowrap;
    }

    .nav.active {
        transform: translateX(-50%);
        opacity: 1;
        pointer-events: auto;
    }

    .nav a {
        font-size: 1.1rem;
        color: var(--accent2);
        font-weight: 600;
        padding: 8px 0;
        border-bottom: 1px solid transparent;
        transition: border-color 0.3s ease;
    }

    .nav a:hover,
    .nav a:focus {
        border-bottom: 1px solid var(--accent);
    }

    .burger-btn.active .line1 {
        transform: rotate(45deg) translate(5px, 5px);
        background-color: var(--accent2);
    }

    .burger-btn.active .line2 {
        opacity: 0;
    }

    .burger-btn.active .line3 {
        transform: rotate(-45deg) translate(6px, -6px);
        background-color: var(--accent2);
    }

    .skills-list {
        gap: 8px;
        justify-content: center;
    }

    .skills-list li {
        padding: 8px 18px;
        font-size: 14px;
    }

    .card-desc {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .card-title {
        font-size: 1.1rem;
    }

    #contact h2 {
        font-size: 2.1rem;
        margin-bottom: 1.8rem;
    }

    #contact p {
        font-size: 1.1rem;
        max-width: 420px;
        margin: 0 auto 1.5rem;
    }

    .contact-link {
        font-size: 1rem;
        padding: 0.6rem 1.3rem;
        border-radius: 28px;
    }
}

@media (max-width: 483px) {
    .top-controls {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    #skills {
        padding: 2rem 1rem 3rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .category-title {
        font-size: 1.3rem;
        margin: 1.5rem 0 1rem;
        text-align: center;
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .skill-item {
        padding: 0.8rem 0.6rem;
        border-radius: 10px;
        min-height: auto;
    }

    .skill-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 0.4rem;
    }

    .skill-item span {
        font-size: 0.8rem;
    }

    #contact {
        padding: 2rem 1rem;
    }

    #contact h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    #contact p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .contact-link {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
        gap: 8px;
    }

    .contact-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 399px) {
    .nav a {
        font-size: 0.9rem;
    }

    .hero-section {
        padding: 3rem 1rem 14rem;
        margin-bottom: 2rem;
    }

    .hero-section .container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .hero-avatar img {
        width: 140px;
        height: 140px;
    }

    .hero-title {
        font-size: 2rem;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.7rem;
    }

    .hero-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .resume-btn {
        font-size: 0.95rem;
    }

    .hero-socials a {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .about-section {
        padding: 2.5rem 1rem;
        margin-top: 0;
    }

    .about-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }

    .about-text-wrapper {
        gap: 1rem;
    }

    .about-text {
        font-size: 1rem;
        padding: 1rem 1rem;
        border-left-width: 4px;
        border-radius: 10px;
        box-shadow: 0 4px 12px var(--shadow-light);
        line-height: 1.6;
    }

    .hero-btn,
    .resume-btn {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    #skills {
        padding: 2rem 0.5rem 2.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .category-title {
        font-size: 1.1rem;
        margin: 1rem 0 0.7rem;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .skill-item {
        padding: 0.6rem;
        border-radius: 8px;
    }

    .skill-icon {
        width: 28px;
        height: 28px;
    }

    .skill-item span {
        font-size: 0.75rem;
    }

    #projects {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .card-title {
        font-size: 1.05rem;
    }

    .card-desc {
        font-size: 0.88rem;
    }

    .project-link {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    #contact {
        padding: 2rem 0.8rem;
    }

    #contact h2 {
        font-size: 1.9rem;
    }

    #contact p {
        font-size: 1rem;
    }

    .contact-link {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .contact-icon {
        width: 18px;
        height: 18px;
    }

    .footer {
        font-size: 12px;
        padding: 20px 10px;
    }
}