/* --------------------------------------- */
/* ----- Basic Setup ----- */
/* --------------------------------------- */
@font-face {
    font-family: 'Hk Grotesk';
    font-style: normal;
    font-weight: 400;
    src: url('./fonts/HKGrotesk-Regular.woff') format('woff');
}

@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 400;
    src: url('./fonts/Jost-Regular.ttf') format('woff');
}

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

:root {
    --font-size-small: 1.6rem;
    --font-size-normal: 2rem;
    --font-size-medium: 2.6rem;
    --font-size-medium-1: 3.2rem;
    --font-size-large: 4.8rem;
    --font-size-huge: 6.8rem;
    --font-stack: 'Hk Grotesk', sans-serif;
    --line-height-normal: 1.6;
    --line-height-small: 1.1;
    /* Dark Mode Colors (Default) */
    --primary-bg: #121212;
    --secondary-bg: #1a1a1a;
    --primary-text: #f5f5f5;
    --secondary-text: #e0e0e0;
    --accent-color: #ff4081;
    --border-color: 1px solid rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --header-gradient-start: rgba(0,0,0, .3);
    --header-gradient-end: rgba(0,0,0, .6);
    --heading-line-color: var(--accent-color);
}

body.light-mode {
    /* Light Mode Colors */
    --primary-bg: #f5f5f5;
    --secondary-bg: #ffffff;
    --primary-text: #121212;
    --secondary-text: #333333;
    --accent-color: #d81b60; /* Slightly different pink for light mode */
    --border-color: 1px solid rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --header-gradient-start: rgba(255,255,255, .3);
    --header-gradient-end: rgba(255,255,255, .6);
    --heading-line-color: var(--accent-color);
}


html {
    font-size: 62.5%; /* (16/10)*100 = 62.5% => 1rem = 10px */
    box-sizing: border-box;
    scroll-behavior: smooth;
}

@media(max-width: 1000px) {
    html {
        font-size: 55%;
    }
}

body {
    font-size: var(--font-size-small);
    font-family: var(--font-stack);
    font-weight: 400;
    color: var(--secondary-text);
    line-height: var(--line-height-normal);
    background: var(--primary-bg);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition for theme change */
    padding-top: 8rem; /* Added: Pushes content down to clear fixed navigation bar */
}

.row {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--gutter-normal);
}

@media(max-width: 1340px) {
    .row {
        max-width: 1100px;
    }
}

@media(max-width: 1240px) {
    .row {
        padding: 0 var(--gutter-medium);
    }
}

@media(max-width: 600px) {
    .row {
        padding: 0 var(--gutter-normal);
    }
}

@media(max-width: 600px) {
    .row {
        padding: 0 var(--gutter-small);
    }
}

section {
    padding: var(--gutter-huge) 0;
    border-bottom: var(--border-color);
}

img {
    object-fit: contain;
    max-width: 100%;
}

/* --------------------------------------- */
/* ----- Headlines and Paragraphs ----- */
/* --------------------------------------- */

h1,
h2,
h3 {
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    line-height: var(--line-height-small);
    color: var(--primary-text);
    transition: color 0.3s ease; /* Smooth transition for theme change */
}

.heading-primary {
    line-height: 1.1;
    font-size: var(--font-size-huge);
    font-weight: 400;
    margin-bottom: var(--gutter-small);
}

@media(max-width: 900px) {
    .heading-primary {
        font-size: 4.5rem; /* Adjusted from 5.5rem */
    }
}

h2 {
    font-size: var(--font-size-large);
    margin-bottom: var(--gutter-normal);
    text-align: center;
}

    h2::after {
        content: '';
        display: block;
        height: 2px;
        width: 8rem;
        background: var(--heading-line-color);
        margin: var(--gutter-small) auto;
        transition: background-color 0.3s ease; /* Smooth transition for theme change */
    }

h3 {
    font-size: var(--font-size-medium-1);
    margin-bottom: var(--gutter-small);
}

@media(max-width: 500px) {
    .heading-primary {
        font-size: 3.8rem; /* Adjusted from 4.8rem */
    }

    h2 {
        font-size: var(--font-size-medium-1);
    }

    h3 {
        font-size: var(--font-size-medium);
    }
}

p {
    margin: var(--gutter-small-1) 0;
}

@media(max-width: 900px) {
    p {
        max-width: var(--container-small-width);
        margin-left: auto;
        margin-right: auto;
    }
}

/* --------------------------------------- */
/* ----- Buttons and Links ----- */
/* --------------------------------------- */

a {
    color: var(--primary-text);
    font-weight: 400;
    font-family: 'Jost', sans-serif;
    transition: all .2s ease-in-out;
    outline: 2px solid transparent;
}

::-moz-focus-inner {
    border: 0;
}

button:focus,
a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

body:not(.user-is-tabbing) button:focus,
body:not(.user-is-tabbing) a:focus {
    outline: none;
}

.link:hover {
    color: var(--accent-color);
}

.btn {
    position: relative;
    display: inline-block;
    padding: 1.2rem 4.5rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--accent-color);
    font-weight: 400;
    overflow: hidden;
}

    .btn:focus {
        outline: none;
    }

    .btn::after {
        content: '';
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--accent-color);
        z-index: -1;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .btn:hover::after,
    .btn:focus::after {
        transform: translateX(0);
    }

    .btn:hover,
    .btn:focus {
        color: var(--primary-text);
    }

.btn--pink {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-text);
    transition: all 0.2s ease-in-out;
}

    .btn--pink::after {
        display: none;
    }

    .btn--pink:hover,
    .btn--pink:focus {
        background: transparent;
        color: var(--accent-color);
    }

.link__text {
    position: relative;
    display: inline-block;
    padding: .6rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--accent-color);
    overflow: hidden;
}

    .link__text::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        display: inline-block;
        height: 2px;
        background: var(--accent-color);
        transform: scaleX(0);
        transform-origin: bottom right;
        transition: transform 0.25s ease-out;
    }

    .link__text:focus {
        outline: none;
    }

        .link__text:hover::after,
        .link__text:focus:after {
            transform: translateX(0);
        }

    .link__text span {
        padding-left: 1rem;
        font-family: sans-serif;
    }

/* ----- Back to Top ----- */

.back-to-top {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 5rem;
    width: 5rem;
    background-color: var(--accent-color);
    border-radius: 50%;
    z-index: 10;
    visibility: hidden;
    opacity: 0;
    transition: all .3s ease-in-out;
}

    .back-to-top.show {
        visibility: visible;
        opacity: 1;
    }

.back-to-top__image {
    height: 60%;
    width: 60%;
}

@media(max-width: 900px) {
    .back-to-top {
        right: 2rem;
        bottom: 2rem;
    }
}

@media(max-width: 500px) {
    .back-to-top {
        right: 1.5rem;
        bottom: 1.5rem;
        height: 4rem;
        width: 4rem;
    }
}

/* --------------------------------------- */
/* ----- Navigation ----- */
/* --------------------------------------- */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--secondary-bg);
    box-shadow: 0 2px 5px var(--shadow-color);
    z-index: 100;
    padding: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.nav__items {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--gutter-normal);
}

.nav__item:not(:last-child) {
    margin-right: 4rem; /* Adjusted for more spacing */
}

@media(max-width: 500px) {
    .nav {
        justify-content: center;
    }

    .nav__item {
        margin: 0.5rem 2rem; /* Adjusted for consistency with margin-right */
    }

        .nav__item:not(:last-child) {
            margin-right: 2rem; /* Adjusted for more spacing on smaller screens */
        }
}

@media(max-width: 400px) {
    .nav__item:not(:last-child) {
        margin-right: 1.5rem; /* Adjusted for more spacing on very small screens */
    }
}

@media(max-width: 300px) {
    .nav {
        font-size: var(--font-size-small);
    }
}

.nav__link {
    position: relative;
    display: inline-block;
    padding: 1rem 0;
    text-decoration: none;
    color: inherit;
    transition: all .2s ease-in-out;
}

    .nav__link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        display: inline-block;
        height: 2px;
        background: var(--accent-color);
        transform: scaleX(0);
        transform-origin: bottom right;
        transition: transform 0.25s ease-out;
    }

    .nav__link:hover {
        color: var(--accent-color);
    }

        .nav__link:hover::after {
            transform: scaleX(1);
            transform-origin: bottom left;
        }

/* --------------------------------------- */
/* ----- Header ----- */
/* --------------------------------------- */

.header {
    background: linear-gradient(var(--header-gradient-start), var(--header-gradient-end)), url('../images/header.jpg') no-repeat center center/cover;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-size: var(--font-size-normal);
    /* Updated alignment for nav at top, text centered */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes nav to top, text-box to middle, if other content below */
    align-items: center; /* Center horizontally */
    text-shadow: 0 0 10px var(--shadow-color);
    /* Removed padding-top and padding-bottom from header */
}

/* Removed .header .row:first-child rule as nav is no longer a child of header */


.header__text-box {
    text-align: center;
    flex-grow: 1; /* Allows text box to take up available space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center the text within its flex container */
    align-items: center; /* Horizontally center text content */
    width: 100%; /* Ensure text box takes full width */
}


.header__text {
    position: static;
    transform: none;
    text-align: center;
    padding: var(--gutter-normal);
}

    .header__text p {
        margin: 1.5rem auto 5.5rem; /* Adjusted: Increased margin-bottom from 4.5rem to 5.5rem */
        max-width: var(--container-medium-width);
        font-family: 'Jost', sans-serif;
        font-size: var(--font-size-medium);
        color: var(--secondary-text);
    }

    .header__text .btn {
        margin: 0.8rem;
    }

@media(max-width: 900px) {
    .heading-primary {
        font-size: 4.5rem; /* Adjusted from 5.5rem */
    }
}

@media(max-width: 768px) {
    .header__text p {
        font-size: var(--font-size-normal);
    }

    .header__text .btn {
        display: block;
        margin: 1rem auto;
    }
}

@media(max-width: 500px) {
    .header {
        text-align: center;
    }

    .heading-primary {
        font-size: 3.8rem; /* Adjusted from 4.8rem */
    }

    .header__text p {
        transform: none;
    }
}

/* --------------------------------------- */
/* ----- Work ----- */
/* --------------------------------------- */

.work__boxes {
    display: grid;
    grid-template-columns: repeat(1, 1fr); /* Default to 1 column on small screens */
    gap: var(--gutter-normal);
    justify-content: center;
}

@media (min-width: 768px) { /* Adjust breakpoint as needed, for medium to large screens */
    .work__boxes {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on larger screens */
    }
}

.work__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Removed border, border-radius, background-color, box-shadow */
    padding: 4rem; /* Increased padding to make the entire box larger */
    transition: transform 0.2s ease-in-out; /* Removed box-shadow transition */
}

    .work__box:hover {
        transform: translateY(-5px);
        /* Removed box-shadow hover effect */
    }

.work__text {
    flex: 1;
    width: 100%;
    margin-top: var(--gutter-small); /* Space between image and text */
    text-align: left; /* Changed: Align text within the box to left */
    padding: 0 1rem; /* Add horizontal padding to text */
}

    .work__text h3 {
        margin-bottom: 0.5rem; /* Adjusted spacing */
        text-align: center; /* Keep project title centered */
    }

    .work__text p {
        margin: 0.5rem 0; /* Adjusted: Removed auto margin for centering */
        font-size: var(--font-size-small); /* Smaller font for details */
        max-width: none; /* Adjusted: Removed max-width to let it take full available width */
    }

        .work__text p strong {
            color: var(--primary-text); /* Ensure bold labels stand out */
        }


.work__code {
    display: block;
    height: 3rem;
    margin-left: var(--gutter-small);
    transition: all .3s;
}

    .work__code:hover {
        transform: scale(1.1);
    }

/* Revise .work__image-box to be a flexible container */
.work__image-box {
    margin-top: 0;
    width: 100%;
    height: auto; /* Allow height to adjust */
    max-height: 750px; /* Set a max height for images or if aspect ratio is not applied */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* Crucial for absolute positioning of content */
    border-radius: 4px;
    background-color: var(--primary-bg);
}

    .work__image-box iframe,
    .work__image-box img {
        position: absolute; /* Always absolute within .work__image-box */
        width: 100%;
        height: 100%;
        object-fit: cover; /* Keep for images, but will be overridden for videos if a specific rule exists */
        display: block;
        top: 0;
        left: 0;
    }

    /* Specific adjustments for video iframes to maintain aspect ratio */
    /* This will make the video container itself scale to 16:9 */
    .work__image-box.video-container {
        height: 0; /* collapse height */
        padding-bottom: 56.25%; /* This creates the 16:9 aspect ratio (9/16 = 0.5625) */
        position: relative; /* Necessary for absolute positioning of iframe children */
        display: block; /* Override any potential 'display: flex' from parent for this specific case */
    }

        /* Make iframes inside video-container fill its aspect-ratio-driven space */
        .work__image-box.video-container iframe {
            position: absolute; /* Absolute to fill the relative parent */
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: unset; /* Explicitly unset if it was inherited, or simply remove the line if it's only here */
        }

/* --------------------------------------- */
/* ----- Clients (Değiştirildi) ----- */
/* --------------------------------------- */
.client__logos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--gutter-normal);
    padding-top: var(--gutter-normal);
}

.client__logo {
    height: 12rem;
    width: auto;
    max-width: 100%;
    filter: grayscale(100%) brightness(150%);
    opacity: 0.7;
    transition: all 0.3s ease-in-out;
}

    .client__logo:hover {
        filter: grayscale(0%) brightness(100%);
        opacity: 1;
    }


/* --------------------------------------- */
/* ----- About (Değiştirildi) ----- */
/* --------------------------------------- */

.about__content {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: var(--gutter-medium);
}

@media(max-width: 900px) {
    .about__content {
        flex-direction: column-reverse;
        align-items: center;
    }
}

.about__photo-container {
    margin-bottom: var(--gutter-normal);
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px var(--shadow-color);
}

    .about__photo-container img {
        display: block;
        width: 100%;
        height: auto;
    }


@media(min-width: 901px) {
    .about__text {
        flex: 0 0 45%;
    }

    .about__photo-container {
        flex: 1;
        margin: 0;
    }
}

/* --------------------------------------- */
/* ----- Contact (Değiştirildi) ----- */
/* --------------------------------------- */

.contact__info {
    max-width: var(--container-normal-width);
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    padding: var(--gutter-normal);
    border: var(--border-color);
    border-radius: 8px;
    background-color: var(--secondary-bg);
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

    .contact__info h4 {
        margin-top: var(--gutter-small);
        color: var(--accent-color);
    }

    .contact__info .work__list {
        text-align: center;
        list-style-position: inside;
        padding-left: 0;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        list-style-type: none;
    }

        .contact__info .work__list li {
            margin-bottom: 0.8rem;
        }

            .contact__info .work__list li a {
                display: inline-block;
                margin: 0 8px;
                font-size: var(--font-size-normal);
            }

    .contact__info .btn {
        margin-top: var(--gutter-normal);
    }

/* --------------------------------------- */
/* ----- Footer ----- */
/* --------------------------------------- */

.footer {
    text-align: center;
    padding: var(--gutter-medium) 0 var(--gutter-normal);
    border-top: var(--border-color);
    transition: border-color 0.3s ease;
}

.footer__social-links {
    display: flex;
    justify-content: center;
    padding: var(--gutter-normal) 0;
    list-style: none;
}

.footer__social-link-item:not(:last-of-type) {
    margin-right: var(--gutter-small);
}

.footer__social-image {
    height: 3.5rem;
    transition: transform 0.2s ease-in-out;
}

    .footer__social-image:hover {
        transform: translateY(-3px) scale(1.1);
    }

.footer__github-buttons {
    display: flex;
    justify-content: center;
    margin-top: var(--gutter-small);
}

    .footer__github-buttons iframe {
        height: 2.5rem;
        width: 84px;
        transform: translateY(3px);
    }

@media(max-width: 500px) {
    .footer {
        padding: var(--gutter-normal) 0;
    }
}

/* --------------------------------------- */
/* ----- Dark/Light Mode Switch ----- */
/* --------------------------------------- */
.mode-switch-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

.mode-switch {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.5rem;
    width: 6rem;
    height: 3rem;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.mode-switch-icon {
    font-size: 1.6rem;
    color: var(--secondary-text);
    transition: color 0.3s ease;
}

.mode-switch .slider {
    background-color: var(--accent-color);
    position: absolute;
    left: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

body.light-mode .mode-switch .slider {
    transform: translateX(3rem);
}
