/* ===================================
   CSS Custom Properties
   =================================== */
:root {
    /* Colors */
    --color-bg: #FFFFFF;
    --color-bg-dots: #B3B3B3;
    --color-text-primary: #000;
    --color-text-name: #0C0C0C;
    --color-text-caption: rgba(0, 0, 0, 0.80);
    --color-highlight: #FFE68C;
    --color-border: #000;

    /* Typography */
    --font-manrope: 'Manrope', sans-serif;
    --font-hanken: 'Hanken Grotesk', sans-serif;

    /* Transitions */
    --transition-crossfade: 300ms;
    --transition-highlight: 200ms;
}

/* ===================================
   Base Styles & Reset
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-manrope);
    background-color: var(--color-bg);
    background-image: url('./images/background_dot_pattern.png');
    background-repeat: repeat;
    color: var(--color-text-primary);
    overflow-x: hidden;
}

/* ===================================
   Navigation Bar
   =================================== */
.navbar {
    width: 100%;
    height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--color-border);
}

.navbar__container {
    display: flex;
    gap: 34px;
    align-items: center;
    justify-content: center;
}

.navbar__link {
    color: var(--color-text-primary);
    font-family: var(--font-manrope);
    font-size: 24.867px;
    font-weight: 600;
    line-height: normal;
    text-decoration: none;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.navbar__link:hover {
    opacity: 0.7;
}

.navbar__link--disabled {
    pointer-events: none;
    cursor: default;
}

.navbar__link--disabled:hover {
    opacity: 1;
}

/* ===================================
   Intro Section
   =================================== */
.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    margin-top: 210px;
    margin-bottom: 245px;
}

.intro__name {
    position: relative;
    display: inline-block;
}

.intro__name-text {
    position: relative;
    color: var(--color-text-name);
    font-family: var(--font-manrope);
    font-size: 64px;
    font-weight: 600;
    line-height: normal;
    z-index: 2;
}

/* Highlight effect for name - will be animated via JS */
.intro__name::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 0%;
    height: 70%;
    background-color: var(--color-highlight);
    opacity: 0.5;
    border-radius: 4px;
    z-index: 1;
    transition: width 1.5s ease-out;
}

.intro__name.highlight::before {
    width: 100%;
}

.intro__description {
    color: var(--color-text-primary);
    text-align: center;
    font-family: var(--font-manrope);
    font-size: 30px;
    font-weight: 500;
    line-height: 40px;
    max-width: 800px;
    min-height: 80px;
}

.intro__description-text {
    display: inline;
    caret-color: transparent;
}

.intro__description-text:focus {
    outline: none;
    caret-color: transparent;
}

/* Typewriter cursor effect */
.intro__description-text::after {
    content: '';
    display: none;
}

.intro__description-text.typing::after {
    content: '|';
    display: inline;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===================================
   Content Section
   =================================== */
.content-section {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px 80px;
}

.content-section__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 60px;
}

.content-section__title-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.content-section__divider {
    width: 1500px;
    max-width: 100%;
    height: 4px;
    background-color: var(--color-border);
    align-self: center;
    margin-top: 12px;
    margin-bottom: 75px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 1.2s ease-out;
}

.content-section__divider.animate {
    transform: scaleX(1);
}

.content-section__title {
    color: var(--color-text-primary);
    font-family: var(--font-manrope);
    font-size: 45.063px;
    font-weight: 600;
    line-height: normal;
}

.content-section__emoji {
    width: auto;
    height: 50px;
    margin-top: 8px;
}

.content-section__main {
    display: flex;
    gap: 90px;
    align-items: flex-start;
}

/* ===================================
   Carousel Container (Left Side ~60%)
   =================================== */
.carousel-container {
    flex: 1;
    max-width: 802px;
    margin-top: -45px;
}

.carousel__caption-wrapper {
    margin-bottom: 15px;
    min-height: 36px;
}

.carousel__caption {
    position: relative;
    display: inline-block;
    color: var(--color-text-caption);
    font-family: var(--font-manrope);
    font-size: 30px;
    font-weight: 600;
    line-height: normal;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}

.carousel__caption[data-category="projects"] {
    cursor: pointer;
    pointer-events: auto;
}

.carousel__caption-text {
    position: relative;
    z-index: 2;
}

/* Highlight effect behind caption text (for projects only) */
.carousel__caption-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 0%;
    height: 70%;
    background-color: var(--color-highlight);
    opacity: 0.5;
    border-radius: 4px;
    z-index: 1;
    transition: width var(--transition-highlight) ease-out;
}

.carousel__caption[data-category="projects"]:hover .carousel__caption-highlight {
    width: 100%;
}

.carousel {
    position: relative;
    width: 802px;
    height: 442px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.carousel__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity var(--transition-crossfade) ease-in-out;
    pointer-events: none;
}

.carousel__image.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===================================
   Categories (Right Side ~40%)
   =================================== */
.categories {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.category {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: left;
    color: var(--color-text-primary);
    font-family: var(--font-hanken);
    font-size: 75.813px;
    font-weight: 400;
    line-height: 105.772px;
    transition: filter 0.2s ease;
}

.category__text {
    position: relative;
    z-index: 2;
}

/* Highlight effect behind category text */
.category__highlight {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 0%;
    height: 70%;
    background-color: var(--color-highlight);
    opacity: 0.5;
    border-radius: 4px;
    z-index: 1;
    transition: width var(--transition-highlight) ease-out;
}

/* Hover effect: highlight animates left to right */
.category:hover .category__highlight {
    width: 100%;
}

/* Active state: category is brightened slightly and highlighted */
.category.active {
    filter: brightness(1.05);
}

.category.active .category__highlight {
    width: 100%;
}

/* ===================================
   Footer
   =================================== */
.footer {
    width: 100%;
    height: 123.4px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 80px;
    border-top: 2px solid var(--color-border);
}

.footer__container {
    display: flex;
    gap: 22px;
    align-items: center;
}

.footer__link {
    display: inline-block;
    transition: transform 0.2s ease;
}

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

.footer__icon {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
}

/* ===================================
   Responsive Design - Mobile
   =================================== */
@media (max-width: 768px) {
    /* Navigation */
    .navbar {
        height: 80px;
    }

    .navbar__container {
        gap: 15px;
    }

    .navbar__link {
        font-size: 18px;
    }

    /* Intro */
    .intro {
        margin-top: 100px;
        margin-bottom: 200px;
    }

    .intro__name-text {
        font-size: 40px;
    }

    .intro__description {
        font-size: 20px;
        line-height: 28px;
        min-height: 56px;
    }

    /* Content Section */
    .content-section {
        padding: 0 20px 60px;
    }

    .content-section__header {
        margin-bottom: 40px;
    }

    .content-section__title-wrapper {
        gap: 15px;
    }

    .content-section__title {
        font-size: 32px;
    }

    .content-section__emoji {
        height: 35px;
    }

    .content-section__divider {
        width: calc(100% - 10px);
        margin-bottom: 30px;
    }

    /* Stack vertically on mobile: Header -> Carousel -> Categories */
    .content-section__main {
        flex-direction: column;
        gap: 40px;
    }

    /* Carousel */
    .carousel-container {
        max-width: 100%;
        width: 100%;
        margin-top: 0;
    }

    .carousel {
        width: 100%;
        height: auto;
        aspect-ratio: 176/97;
    }

    .carousel__caption-wrapper {
        margin-bottom: 12px;
    }

    .carousel__caption {
        font-size: 20px;
    }

    /* Categories */
    .categories {
        width: 100%;
    }

    .category {
        font-size: 48px;
        line-height: 70px;
    }

    /* Footer */
    .footer {
        height: 80px;
        margin-top: 60px;
    }
}

@media (max-width: 480px) {
    .intro__name-text {
        font-size: 32px;
    }

    .intro__description {
        font-size: 18px;
        line-height: 24px;
        min-height: 48px;
    }

    .content-section__title {
        font-size: 28px;
    }

    .category {
        font-size: 36px;
        line-height: 52px;
    }

    .carousel__caption {
        font-size: 18px;
    }
}
