
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

:root {
    --bg-color: #0a0a0a;
    --second-bg-color: #131313;
    --text-color: #f0f0f0;
    --main-color: #00ffee;
    --main-color-darker: #00b8a6;
    --header-height: 7rem;
    --header-height-scrolled: 6rem;
    --fs-h1: clamp(3.5rem, 6vw + 1rem, 7rem);
    --fs-h3: clamp(2.2rem, 4vw + 0.5rem, 3.5rem);
    --fs-p: clamp(1.4rem, 2.5vw + 0.2rem, 1.8rem);
    --fs-nav: clamp(1.6rem, 2vw + 0.3rem, 1.8rem);
    --fs-btn: clamp(1.5rem, 2vw + 0.2rem, 1.7rem);
    --padding-section-y: clamp(6rem, 10vh, 10rem);
    --padding-section-x: clamp(2rem, 8vw, 12%);
    --gap-home: clamp(3rem, 8vw, 10rem);
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

body.menu-open-no-scroll {
    overflow: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    padding: 0 var(--padding-section-x);
    background: rgba(8, 8, 8, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), height 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.header.header-scrolled {
    height: var(--header-height-scrolled);
    background: rgba(8, 8, 8, 0.85);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header.header-hidden {
    top: calc(-1 * var(--header-height-scrolled) - 10px);
}

.header.header-visible {
    top: 0;
}

.logo {
    font-size: clamp(2.2rem, 3vw + 0.5rem, 3rem);
    color: var(--text-color);
    font-weight: 700;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo span {
    color: var(--main-color);
    text-shadow: 0 0 15px var(--main-color);
}

.navbar {
    display: flex;
    align-items: center;
}

.navbar a {
    font-size: var(--fs-nav);
    color: var(--text-color);
    margin-left: clamp(2rem, 4vw, 4rem);
    font-weight: 500;
    transition: color 0.3s ease, transform 0.2s ease;
    position: relative;
    padding-bottom: 0.5rem;
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--main-color);
    transition: width 0.3s ease;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

.navbar a:hover::after,
.navbar a.active::after {
    width: 100%;
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--main-color);
    display: none;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}

#menu-icon:hover {
    transform: scale(1.1);
}

section {
    min-height: 100vh;
    padding: var(--padding-section-y) var(--padding-section-x);
    padding-top: calc(var(--header-height) + var(--padding-section-y) / 2);
}

.home {
    padding-top: calc(var(--header-height) + var(--padding-section-y) / 1.5);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: var(--gap-home);
}

.home-img {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    order: 1;
}

.home-img img {
    width: clamp(25rem, 30vw, 40rem);
    height: clamp(25rem, 30vw, 40rem);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 35px var(--main-color), 0 0 15px var(--main-color-darker) inset;
    border: 3px solid var(--main-color);
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

.home-img img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 0 50px var(--main-color), 0 0 70px var(--main-color-darker), 0 0 25px var(--main-color) inset;
}

.home-img img:active {
    transform: scale(1.02);
    transition: transform 0.1s ease-out;
}

.home-content {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    justify-content: center;
    order: 0;
}

.home-content h1 {
    font-size: var(--fs-h1);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.home-content h1 span {
    color: var(--main-color);
}

.home-content h3 {
    font-size: var(--fs-h3);
    font-weight: 600;
    margin-bottom: 2.5rem;
    min-height: calc(var(--fs-h3) * 1.2);
}

.text-animation span {
    color: var(--main-color);
    position: relative;
}

.text-animation span::before {
    content: 'Programcı';
    animation: words 20s infinite;
}

.text-animation span::after {
    content: "";
    background-color: var(--bg-color);
    position: absolute;
    width: calc(100% + 8px);
    height: 105%;
    top: -2.5%;
    border-left: 3px solid var(--bg-color);
    right: -8px;
    animation: cursor 0.7s infinite, typing 20s steps(14) infinite;
}

.home-content p {
    font-size: var(--fs-p);
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 3rem;
    max-width: 60ch;
}

.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: clamp(3.8rem, 5vw, 4.5rem);
    height: clamp(3.8rem, 5vw, 4.5rem);
    background: transparent;
    border: 2px solid var(--main-color);
    font-size: clamp(1.8rem, 2.5vw, 2.2rem);
    border-radius: 50%;
    color: var(--main-color);
    margin: 0 1.5rem 3rem 0;
    transition: all 0.3s ease-in-out;
}

.social-icons a:hover {
    color: var(--bg-color);
    background-color: var(--main-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 255, 238, 0.3);
}

.btn-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: clamp(1rem, 2vh, 1.4rem) clamp(2.5rem, 4vw, 3.5rem);
    background: var(--main-color);
    box-shadow: 0 0 20px rgba(0, 255, 238, 0.4);
    border-radius: 3rem;
    font-size: var(--fs-btn);
    color: var(--bg-color);
    border: 2px solid var(--main-color);
    letter-spacing: 0.05rem;
    font-weight: 600;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.btn:hover {
    background-color: transparent;
    color: var(--main-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(0, 255, 238, 0.6);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 15px rgba(0, 255, 238, 0.5);
}

.btn.btn-secondary {
    background-color: transparent;
    color: var(--main-color);
    border-color: var(--main-color);
}

.btn.btn-secondary:hover {
    background-color: var(--main-color);
    color: var(--bg-color);
    border-color: var(--main-color);
}

#scrollTopBtn {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    z-index: 999;
    background-color: var(--main-color);
    color: var(--bg-color);
    border: none;
    border-radius: 50%;
    width: 5rem;
    height: 5rem;
    font-size: 2.4rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 255, 238, 0.3);
    opacity: 0;
    transform: translateY(30px);
    transition: background-color 0.3s, transform 0.3s, opacity 0.3s;
    pointer-events: none;
}

#scrollTopBtn.show {
    opacity: 0.85;
    transform: translateY(0);
    pointer-events: auto;
}

#scrollTopBtn:hover {
    background-color: var(--main-color-darker);
    transform: scale(1.1);
    opacity: 1;
}

@keyframes cursor {
    0%, 100% {
        border-left-color: var(--main-color);
    }
    50% {
        border-left-color: transparent;
    }
}

@keyframes words {
    0%, 20% { content: 'Web Geliştirici'; }
    21%, 40% { content: 'Backend Developer'; }
    41%, 60% { content: 'Frontend Developer'; }
    61%, 80% { content: 'Python Geliştiricisi'; }
    81%, 100% { content: 'Programcı'; }
}

@keyframes typing {
    5%, 20% { width: calc(100% + 8px); }
    10%, 15% { width: 0; }
    25%, 40% { width: calc(100% + 8px); }
    30%, 35% { width: 0; }
    45%, 60% { width: calc(100% + 8px); }
    50%, 55% { width: 0; }
    65%, 80% { width: calc(100% + 8px); }
    70%, 75% { width: 0; }
    85%, 100% { width: calc(100% + 8px); }
    90%, 95% { width: 0; }
}

@media (max-width: 992px) {
    :root {
        --header-height: 6.5rem;
        --header-height-scrolled: 5.5rem;
    }

    .home {
        gap: calc(var(--gap-home) / 1.5);
    }

    .home-content {
        flex: 1.2;
    }
}

@media (max-width: 768px) {
    #menu-icon {
        display: block;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(8px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.6s cubic-bezier(0.77, 0, 0.175, 1);
        padding: 0;
        z-index: 1000;
    }

    .navbar.active {
        left: 0;
        z-index: 1050;
    }

    .navbar a {
        font-size: clamp(2.2rem, 6vw, 3rem);
        margin: 1.8rem 0;
        padding: 1.2rem 2.5rem;
        display: block;
        text-align: center;
        color: var(--text-color);
        width: 85%;
        opacity: 0;
        transform: translateY(20px);
        transition: color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    }

    .navbar.active a {
        opacity: 1;
        transform: translateY(0);
    }

    .navbar.active a:nth-child(1) { transition-delay: 0.15s; }
    .navbar.active a:nth-child(2) { transition-delay: 0.23s; }
    .navbar.active a:nth-child(3) { transition-delay: 0.31s; }
    .navbar.active a:nth-child(4) { transition-delay: 0.39s; }

    .navbar a::after {
        display: none;
    }

    .navbar a:hover {
        color: var(--main-color);
        background-color: rgba(0, 255, 238, 0.08);
        border-radius: 8px;
    }

    .navbar a.active {
        color: var(--main-color);
        background-color: rgba(0, 255, 238, 0.15);
        border-radius: 8px;
        font-weight: 700;
        box-shadow: inset 0 0 15px rgba(0, 255, 238, 0.1);
    }

    .home {
        flex-direction: column;
        text-align: center;
        padding-top: calc(var(--header-height) + 3rem);
    }

    .home-img {
        order: 0;
        margin-bottom: 4rem;
    }

    .home-img img {
        width: clamp(22rem, 60vw, 30rem);
        height: clamp(22rem, 60vw, 30rem);
    }

    .home-content {
        order: 1;
        align-items: center;
        text-align: center;
    }

    .home-content h1 {
        margin-bottom: 0.5rem;
    }

    .home-content p {
        margin-bottom: 2.5rem;
        max-width: 90%;
    }

    .social-icons {
        margin-bottom: 2.5rem;
        justify-content: center;
    }

    .social-icons a {
        margin: 0 1rem 1rem 1rem;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .btn {
        width: 80%;
        max-width: 300px;
        margin-bottom: 1.5rem;
        padding: 1.2rem 2rem;
    }

    .btn-group .btn:last-child {
        margin-bottom: 0;
    }

    .text-animation span::after {
        background-color: var(--bg-color);
    }

    #scrollTopBtn {
        width: 4.5rem;
        height: 4.5rem;
        font-size: 2rem;
        bottom: 2rem;
        right: 2rem;
    }
}

@media (max-width: 480px) {
    :root {
        --padding-section-x: clamp(1.5rem, 5vw, 8%);
    }

    html {
        font-size: 58%;
    }

    .home-img img {
        width: clamp(20rem, 55vw, 28rem);
        height: clamp(20rem, 55vw, 28rem);
    }

    .home-content h1 {
        line-height: 1.3;
    }

    .social-icons a {
        width: clamp(3.5rem, 10vw, 4rem);
        height: clamp(3.5rem, 10vw, 4rem);
        font-size: clamp(1.6rem, 4vw, 2rem);
    }
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-out, visibility 0s linear 0.5s;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-text {
    color: var(--main-color);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 1px;
    animation: pulseText 1.5s infinite alternate;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 255, 238, 0.3);
    border-top-color: var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseText {
    from {
        opacity: 0.7;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1.02);
    }
}