@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&family=Tinos:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
    --base-color: hsl(0 0% 100%);
    --text-color: hsl(0 0% 0%);
    --primary-color: hsl(34 100% 72%);
    --secondary-color: hsl(240 100% 78%);
    --color-hero-bg: hsl(30 33% 96%);
    --color-section-light-bg: hsl(200 33% 96%);
    --color-section-alt-bg: hsl(270 33% 96%);

    /* Colors for project cards */
    --first-color: hsl(82 60% 28%);
    --project-name-color: hsl(0 0 15%);
    --project-description-color: hsl(0 0 35%);
    --body-color: hsl(0 0 95%);
    --project-card-container-color: hsl(0 0 100%);

    /* Font and typography */
    --body-font: 'Google Sans', sans-serif;
    --h2-font-size: 1.25rem;
    --small-font-size: .813rem;

    /* Colors for career timeline*/
    --timeline-card-color: hsl(250 50% 78%);
}

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

html {
    font-family: 'Google Sans', sans-serif;
    color: var(--text-color);
}

body {
    padding: 1em;
    background-color: var(--base-color);
}

h1, h2, h3 {
    font-family: 'Tinos', serif;
}

header, section{
    margin: 2em auto;
    width: min(75em, 100%);
    background-color: var(--color-hero-bg);
    padding: min(2em, 15%);
    border-radius: 1em;
}

h1{
    font-size: 2.5rem;
}

.cta-button{
    display: inline-block;
    text-decoration: none;
    color: var(--bas);
    background-color: var(--primary-color);
    padding: .75em 1.25em;
    border-radius: .5em;
    font-weight: 600;
}

.secondary{
    background-color: var(--secondary-color);
}

.specialists__list {
    text-align: left;
}

.specialist_item {
    list-style-position: inside;
}

section {
    padding: 3em min(2em, 15%);
    background-color: var(--color-section-light-bg);
    text-align: justify;
}

h2 {
    font-size: 2rem;
}

section p{
    margin-top: 1em;
    font-size: 1.25rem;
}

footer {
    padding-bottom: 1.5rem;
    text-align: center;
}

footer a{
    margin: 0 1em;
    text-decoration: none;
    color: var(--text-color);
}

footer a:hover{
    text-decoration: underline;
}

/*=============== HERO SECTION ===============*/
.hero__container{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 3em;
}

.hero__text{
    flex: 0 1 34em;
}

.hero__text p{
    margin: .75em 0 1em 0;
    font-size: 1.25rem;
}

.hero__image{
    max-width: 100%;
    border-radius: 1em;
    object-fit: cover;
    object-position: bottom;
    width: 300px;
    height: 400px;
}

.about__image{
    max-width: 100%;
    border-radius: 1em;
    object-fit: cover;
    object-position: bottom;
    width: 400px;
    height: auto;
}

/*=============== NAVAGATION BAR ===============*/
.nav {
    margin: 1em auto 3em auto;
    width: min(1000px, 100%);
}

.nav__list{
    display: flex;
    align-items: center;
    list-style-type: none;
    gap: 2em;
}

.nav__list li:first-child{
    margin-right: auto;
}

.nav__item__first{
    font-family: 'Tinos', serif;
    font-weight: bold;
}

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

.nav__item:hover{
    text-decoration: underline;
}

/*=============== PROJECT CARDS ===============*/
.project__container{
    display: grid;
    place-items: center;
    margin-inline: 1.5rem;
    padding-block: 5rem;
}

.card__container{
    display: grid;
    row-gap: 3.5rem;
}

.card__article {
    position:relative;
    overflow: hidden;
}

.card__thumbnail{
    width: 328px;
    height:300px;
    border-radius: 1.5rem;
    object-fit: cover;
    object-position: bottom;
}

.card__content{
    width: 280px;
    background-color: var(--project-card-container-color);
    padding: 1.5rem 2rem;
    box-shadow: 0 8px 24px hsla(0,0%, 0%, .15);
    border-radius: 1rem;
    position: absolute;
    bottom: -15rem;
    left: 0;
    right: 0;
    margin-inline: auto;
    transition: opacity 1 1s;
}

.card__description{
    display: block;
    font-size: var(--small-font-size);
    color: var(--project-description-color);
    margin-bottom: .75rem;
}

.card__title{
    font-size: var(--h2-font-size);
    color: var(--project-name-color);
    margin-bottom: 2.5rem;
}

.card__button{
    text-decoration: none;
    font-size: var(--small-font-size);
    font-weight: 500;
    color: var(--first-color);
}

.card__button:hover{
    text-decoration: underline;
}

/* Naming animations in hover */
.card__article:hover .card__content{
    animation: show-data 1.5s forwards;
    opacity: 1;
    transition: opacity .3s;
}

.card__article:hover{
    animation: remove-overflow 2.5s forwards;
}

.card__article:not(:hover){
    animation: show-overflow 2.5s forwards;
}

.card__article:not(:hover) .card__content{
    animation: remove-data 2s forwards;
}

/* Card animation */
@keyframes show-data{
    50%{
        transform: translateY(-20rem);
    }
    100%{
        transform: translateY(-17rem);
    }
}

@keyframes remove-overflow{
    to{
        overflow: initial;
    }
}

@keyframes remove-data{
    0%{
        transform: translateY(-13rem);
    }
    50%{
        transform: translateY(-20rem);
    }
    100%{
        transform: translateY(.17rem);
    }
}

@keyframes show-overflow{
    0%{
        overflow: initial;
        pointer-events: none;
    }
    50%{
        overflow: hidden;
    }
}

/* =============== CAREER TIMELINE ===============*/
.career_timeline__container {
    position: relative;
    max-width: 100vw;
    height: 30rem;

    display: flex;
    justify-content: flex-start;
    align-items: center;

    overflow-x: auto;
}

.timeline__list {
    height: .12rem;
    padding: 0 30rem;
    background-color: hsl(0 0% 53%);
    list-style-type: none;
    white-space: nowrap;

    --scale: 1;
    display: flex;
}

.timeline__item {
    width: 20rem;
    position: relative;
}

.timeline__item::before,
.timeline__item::after,
.timeline_card__title,
.timeline_card__content{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(var(--scale));
    transition: .5s ease;
}

.timeline__item::before {
    content: "";
    top: 1rem;

    display: inline-block;
    width: 0.12rem;
    height: 1rem;
    background-color: hsl(0 0% 53);
}

.timeline__item:nth-child(even)::before {
    top: -3.4rem;
}

.timeline__item:nth-child(odd)::before {
    top: 3.4rem;
}


.timeline__item:hover::before {
    background-color: var(--timeline-card-color);
}

.timeline__item::after {
    content: attr(data-date);
    top: -5rem;
}

.timeline__item:nth-child(odd)::after {
    top: 5rem;
}

.timeline__item:hover:after,
.timeline_card__title{
    color: var(--timeline-card-color);
}

.timeline_card__title {
    top: 2.4rem;
    font: 600 1.1rem;
    white-space: pre;

    opacity: 0  ;
}

.timeline__item:nth-child(odd) > .timeline_card__title {
    top: -5rem;
}

.timeline__item:nth-child(even) > .timeline_card__title {
    top: 5rem;
}

.timeline__item:hover .timeline_card__title{
    opacity: 1;
}

.timeline_card__content {
    width: 5rem;
    height: 5rem;
    background-color: hsl(0 0% 53%);
    color: var(--base-color);
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    overflow: hidden;
    transition: .3s ease;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.timeline__item:hover .timeline_card__content{
    color: var(--timeline-card-color);
    --scale: 1.2;
    cursor: pointer;
    z-index: 200;
}

.timeline_card__content.show {
    width: 22rem;
    height: 22rem;
    border-radius: 1rem;
    padding: 1rem;
    background-color: var(--base-color);
    color: var(--text-color);
    background-image: none;
    box-shadow: 0 .1rem .4rem black;
    z-index: 100;
}

/* Keep text color black on hover for expanded cards */
.timeline__item:hover .timeline_card__content.show {
    color: var(--text-color);
}

/* Hide text content in collapsed nodes */
.timeline_card__content h3,
.timeline_card__content small,
.timeline_card__content p,
.timeline_card__content .close {
    display: none;
} 

/* Show text content only when expanded */
.timeline_card__content.show h3,
.timeline_card__content.show small,
.timeline_card__content.show p,
.timeline_card__content.show .close{
    display: block;
}

.timeline_card__content h3{
    text-transform: capitalize;
}

.timeline_card__content p {
    background-color: hsl(0 0% 85%);
    padding: 1rem;
    border-radius: 1rem;

    margin-left: 0.5rem;
}

.timeline_card__content.show p {
    margin-left: 0;
}

.timeline_card__content .close{
    align-self: flex-start;
    background-color: var(--primary-color);

    padding: .5rem .8rem;
    border-radius: 2rem;
    font-size: 1rem;
}

/* Assign logos to each company */
.timeline__item[data-company="DRX"] .timeline_card__content {
    background-image: url("images/drx.png");
}

.timeline__item[data-company="PWC"] .timeline_card__content {
    background-image: url("images/pwc.png");
}

.timeline__item[data-company="CX"] .timeline_card__content {
    background-image: url("images/cx.jpg");
}

.timeline__item[data-company="LINKR"] .timeline_card__content {
    background-image: url("images/linkr.png");
}

.timeline__item[data-company="HITACHI"] .timeline_card__content {
    background-image: url("images/hitachi.jpg");
}

.timeline__item[data-company="AWS"] .timeline_card__content {
    background-image: url("images/aws.png");
}

.timeline__item[data-company="KPMG"] .timeline_card__content {
    background-image: url("images/kpmg.png");
}

/* Remove logos when card is expanded */
.timeline__item[data-company="DRX"] .timeline_card__content.show,
.timeline__item[data-company="PWC"] .timeline_card__content.show,
.timeline__item[data-company="CX"] .timeline_card__content.show,
.timeline__item[data-company="LINKR"] .timeline_card__content.show,
.timeline__item[data-company="HITACHI"] .timeline_card__content.show,
.timeline__item[data-company="AWS"] .timeline_card__content.show,
.timeline__item[data-company="KPMG"] .timeline_card__content.show {
    background-image: none;
}

/* =============== BREAKPOINTS ===============*/
/* For small devices */
@media (max-width: 640px){
    header {
        margin-top: 0;
    }

    body {
        padding: 0.75em;
    }

    section {
        padding: 1.5em 1em;
    }

    h2 {
        font-size: 1.5rem;
    }

    header section {
        margin: 1em auto;
    }

    .hero__text p {
        font-size: 1rem;
    }

    .nav__item{
        display: none;
    }

    .nav__item__first, .nav__item__last {
        display: block
    }

    .cta-button {
        margin-top: .5em;
        width: 100%;
    }

    .card__container{
        grid-template-columns: repeat(1, 1fr);
        column-gap: 1.5rem;
    }

    .hero__image{
        width: 200px;
        height: 300px;
    }

    .hero__text p {
        font-size: 1rem;
    }

    .about__image {
        display: none;
    }

    .card__article:hover{
        animation: none;
    }

    .card__article:not(:hover){
        animation:none;
    }

    .card__article:hover .card__content{
        animation: show-data 1s forwards;
    }

    .card__article:not(:hover) .card__content{
        animation: remove-data 1s forwards;
    }
}

/* For medium devices */
@media(min-width: 768px){
    header {
        text-align: justify;
    }

    header .hero__text {
        padding-top: 0;
    }
}

/* For large devices */
@media screen and (min-width: 1120px){
    .container{
        height: 100vh;
    }

    .card__container{
        grid-template-columns: repeat(3, 1fr);
    }

    .card__thumbnail{
        width: 348px;
        height:400px;
        border-radius: 1.5rem;
        object-fit: cover;
        object-position: bottom;
    }

    .card__content{
        width: 316px;
        padding: 2.5rem;
    }
}

