/*#region CONSTS*/
:root {
    /* Colors */
    --background-color: rgb(9, 9, 11);
    --background-color-rgb: 9, 9, 11;
    --text-color: rgb(255, 255, 255);
    --muted-text: rgba(255, 255, 255, 0.7);
    --outline-color: rgba(255, 255, 255, 0.1);

    /* Layout */
    --max-width: 78rem;
    --page-padding: 1rem;
    --page-padding-top: 6rem;
    --header-padding: 0.75rem 1rem;
    --max-header-width: 80rem;

    /* Spacing */
    --gap-small: 0.5rem;
    --gap-medium: 1rem;
    --gap-large: 1.5rem;
    --grid-gap: 1.5rem;

    /* Other */
    --radius: 8px;
    --transition-duration: 0.2s;
    --card-bg: rgba(9, 9, 11, 0.4);
    --card-hover-bg: rgba(255, 255, 255, 0.02);

    /* Animation */
    --animation-duration: 0.6s;
    --stagger-delay: 0.1s;
}

/*#endregion CONSTS*/

/*#region BASE*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: system-ui, -apple-system, sans-serif;

}

#page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--page-padding);
    padding-top: var(--page-padding-top);
    animation: fadeIn 0.5s ease-out;
}

#page>h1 {
    font-size: 2.5rem;
    margin-bottom: var(--gap-large);
    animation: slideInFromTop 0.6s ease-out;
}

/*#endregion BASE*/

/*#region ANIMATIONS*/

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Page load animations for cards */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/*#endregion ANIMATIONS*/

/* #region background animation */
.bg {
    animation: slide 50s ease-in-out infinite alternate;
    background-image: linear-gradient(-60deg, #232337 50%, #323293 50%);
    bottom: 0;
    left: -50%;
    opacity: .1;
    position: fixed;
    right: -50%;
    top: 0;
    z-index: -1;
}

.bg2 {
    animation-direction: alternate-reverse;
    animation-duration: 60s;
    animation-delay: -10s;
}

.bg3 {
    animation-duration: 80s;
    animation-delay: -30s;
}

@keyframes slide {
    0% {
        transform: translateX(-25%);
    }

    100% {
        transform: translateX(25%);
    }
}

/* #endregion background animation */

/*#region HEADER*/

.header {
    position: fixed;
    inset-inline: 0;
    top: 0;
    background-color: rgba(var(--background-color-rgb), 0.3);
    backdrop-filter: blur(4px);
    z-index: 50;
    border-bottom: 1px solid var(--outline-color);
    padding: var(--header-padding);
    transition: background-color 0.3s ease,
        backdrop-filter 0.3s ease,
        padding 0.3s ease;
}

.header.scrolled {
    background-color: rgba(var(--background-color-rgb), 0.7);
    backdrop-filter: blur(12px);
}

.header>nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    max-width: var(--max-header-width);
    gap: 2rem;
    white-space: nowrap;
}

#logo {
    color: var(--text-color);
    text-decoration: none;
}

#logo h1 {
    font-size: 1.35rem;
}

#page-btns {
    display: flex;
    gap: 3rem;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    letter-spacing: 0.1em;
}

#page-btns a {
    color: var(--text-color);
    font-size: 1.3rem;
    position: relative;
    text-decoration: none;
}

#page-btns a::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--text-color);
    transition: width 0.3s ease;
}

#page-btns a:hover::after {
    width: 100%;
}

#page-btns .active {
    text-decoration: none;
}

#page-btns .active::after {
    width: 100%;
}

#social-btns {
    display: flex;
    gap: var(--gap-medium);
    justify-content: flex-end;
    align-items: center;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-small);
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.social-btn:hover {
    transform: translateY(-2px) scale(1.15);
    text-decoration: none;
}

.social-btn img {
    width: 1.75rem;
    height: 1.75rem;
    filter: grayscale(1) brightness(0) invert(1);
    transition: filter 0.3s ease;
}



/*#endregion HEADER*/

/*#region MOBILE MENU*/

.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
    width: 40px;
    height: 40px;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger-menu.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(var(--background-color-rgb), 0.98);
    backdrop-filter: blur(10px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-page-btns {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    padding-top: 8rem;
    padding-left: 2rem;
    margin-bottom: 3rem;
}

.mobile-btn {
    color: var(--text-color);
    text-decoration: none;
    font-size: 2rem;
    letter-spacing: 0.1em;
    transition: opacity 0.2s;
}

.mobile-btn:hover {
    opacity: 0.7;
}

.mobile-social-btns {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 2rem;
}

.mobile-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: opacity 0.2s;
}

.mobile-social-btn:hover {
    opacity: 0.7;
}

.mobile-social-btn img {
    width: 2rem;
    height: 2rem;
    filter: grayscale(1) brightness(0) invert(1);
}

/*#endregion MOBILE MENU*/

/*#region COMPONENTS*/

.btn {
    color: var(--text-color);
    text-decoration: none;
}

.btn:hover {
    text-decoration: underline;
    text-underline-offset: 0.25rem;
}

.btn.big {
    font-size: 1.5rem;
}

/*#endregion COMPONENTS*/

/*#region HOME*/

.home-navigation-hint {
    margin-bottom: calc(var(--gap-large) * 2);
    text-align: center;
    animation: fadeIn 1s ease-out 0.3s both;
}

.home-navigation-hint p {
    font-size: 0.9rem;
    color: var(--muted-text);
    opacity: 0.6;
}

.home-hero {
    margin-top: calc(var(--gap-large) * 6);
    width: fit-content;
    max-width: none;
    margin-inline: auto;
    text-align: left;
    padding-left: var(--gap-large);
    border-left: 2px solid var(--outline-color);
    animation: slideInFromLeft 0.8s ease-out 0.5s both;
}

.home-hero h1 {
    font-size: 2.5rem;
    margin-bottom: var(--gap-large);
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.home-hero p {
    font-size: 1.2rem;
    color: var(--muted-text);
    line-height: 1.7;
    font-weight: 300;
    max-width: 50ch;
    text-wrap-mode: nowrap;
}

.home-hero p strong,
.home-hero p b {
    color: var(--text-color);
    font-weight: 500;
}

/*#endregion HOME*/

/*#region GRID*/

#grid {
    column-count: 3;
    column-gap: var(--grid-gap);
    max-width: 100%;
}

#grid li {
    list-style: none;
}

#grid .card {
    font-size: 1.1rem;
    position: relative;
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    break-inside: avoid;
    margin-bottom: var(--grid-gap);
    display: inline-block;
    width: 100%;
    outline: 1px solid var(--outline-color);
    border-radius: var(--radius);
    color: var(--text-color);
    text-decoration: none;
    padding: var(--gap-medium);
    transition: transform 0.3s ease,
        box-shadow 0.3s ease,
        outline-color 0.3s ease,
        background-color var(--transition-duration);
}

#grid .card.card-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
}

#grid .card.card-reveal {
    animation: cardSlideIn 0.5s ease-out forwards;
}

#grid .card:hover {
    background-color: var(--card-hover-bg);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    outline-color: rgba(255, 255, 255, 0.2);
}

.card h3 {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem;
}

.card .subtitle {
    font-size: 0.9rem;
    color: var(--muted-text);
    margin-bottom: var(--gap-medium);
}

.card .content {
    font-size: 1rem;
    line-height: 1.5;
}

.card .content a {
    color: var(--text-color);
    text-decoration: underline;
}

.card img {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: var(--gap-medium);
}

#grid .card .badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.card footer {
    color: var(--muted-text)
}

/*#endregion GRID*/

/*#region CAROUSEL*/
.image-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: var(--gap-medium);
}

.image-container .thumbnail {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.carousel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    opacity: 0;
    pointer-events: none;
}

.image-container:hover .carousel {
    opacity: 1;
}

.carousel-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    opacity: 0;
}

.carousel-image.active {
    opacity: 1;
}

/*#endregion CAROUSEL*/

/*#region RESUME*/

#resume {
    display: flex;
    flex-direction: column;
    gap: var(--gap-large);
}

.resume-section {
    margin-bottom: var(--gap-medium);
}

.section-title {
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-text);
    margin-bottom: var(--gap-medium);
    padding-bottom: var(--gap-small);
    border-bottom: 1px solid var(--outline-color);
}

.resume-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    outline: 1px solid var(--outline-color);
    border-radius: var(--radius);
    padding: var(--gap-large);
    transition: background-color var(--transition-duration),
        transform 0.3s ease,
        box-shadow 0.3s ease;
}



.resume-card .content {
    line-height: 1.4;
    color: var(--muted-text);
}
.resume-card .content b {
    color: var(--text-color)
}

.resume-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.resume-card .subtitle {
    font-size: 0.95rem;
    color: var(--muted-text);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--gap-small);
    margin-bottom: var(--gap-medium);
}

.date-range {
    font-size: 0.9rem;
    color: var(--muted-text);
    white-space: nowrap;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--outline-color);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--gap-medium);
}

.timeline-item .resume-card {
    animation: slideInFromBottom 0.6s ease-out both;
}

.timeline-item:nth-child(1) .resume-card {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) .resume-card {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) .resume-card {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(4) .resume-card {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(5) .resume-card {
    animation-delay: 0.5s;
}

.timeline-item:nth-child(6) .resume-card {
    animation-delay: 0.6s;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 1.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-color);
    transform: translateX(-4px);
    animation: scaleIn 0.4s ease-out both;
}

.timeline-item:nth-child(1) .timeline-marker {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) .timeline-marker {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) .timeline-marker {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(4) .timeline-marker {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(5) .timeline-marker {
    animation-delay: 0.5s;
}

.timeline-item:nth-child(6) .timeline-marker {
    animation-delay: 0.6s;
}

/* Skills */
.resume-top-row {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: var(--gap-large);
}

.resume-top-row .resume-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.resume-top-row .resume-card {
    flex: 1;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: var(--gap-medium);
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.skill-percent {
    font-size: 0.8rem;
    color: var(--muted-text);
}

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

.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.9));
    border-radius: 3px;
    width: 0 !important;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-fill.animated {
    width: var(--target-width) !important;
}

@media (max-width: 768px) {
    .resume-top-row {
        grid-template-columns: 1fr;
    }

    /* Header mobile adjustments */
    #logo h1 {
        font-size: 1.1rem;
    }

    #logo small {
        font-size: 0.75rem;
    }

    #page-btns {
        display: none;
    }

    #social-btns {
        display: none;
    }

    .burger-menu {
        display: flex;
    }

    .mobile-menu {
        display: block;
    }

    /* Grid to single column */
    #grid {
        column-count: 1;
    }

    /* Home page mobile adjustments */
    .home-hero {
        margin-top: calc(var(--gap-large) * 3);
        padding-left: var(--gap-medium);
    }

    .home-hero h1 {
        font-size: 1.75rem;
    }

    .home-hero p {
        font-size: 1rem;
        text-wrap-mode: wrap;
    }

    /* Page title adjustments */
    #page>h1 {
        font-size: 1.75rem;
    }

    /* Card adjustments */
    .card h3 {
        font-size: 1.25rem;
    }

    .card .subtitle {
        font-size: 0.85rem;
    }

    /* Resume adjustments */
    .resume-card h3 {
        font-size: 1.1rem;
    }

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

/*#endregion RESUME*/