@import url('https://fonts.googleapis.com/css2?family=Trocchi&display=swap');

* {
    margin: 0;
    padding: 0;
    min-width: 0;
}

:root {
    --font-family: Trocchi, serif;
    --landing-font-size: min(12vw, 12rem);
    --heading-font-size: min(8vw, 8rem);
    --font-size: min(6vw, 1.8rem);
    --small-font-size: min(5vw, 1.4rem);

    --section-width: 100%;
    --section-padding: 0 var(--medium-unit);
    --section-max-width: 1000px;

    --accent-color: #f39c12;
    --bubble-background-color: #f3f3f3;
    --chat-user-background-color: #f8efba;
    --chat-bot-background-color: #f3f3f3;

    --small-unit: 1rem;
    --medium-unit: 2rem;
    --large-unit: 4rem;

    font-family: var(--font-family);
    font-size: 62.5%;
}

hr {
    width: min(50rem, 40%);
    height: 4px;
    background-color: black;
    margin: var(--large-unit) auto;
    border: 1px solid black;
    border-radius: var(--small-unit);
}

h1,
h2 {
    font-weight: inherit;
    font-size: inherit;
}

a,
a:visited,
a:focus {
    color: var(--accent-color);
    text-decoration: none;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
}

a:hover {
    text-decoration: underline;
}

a[target="_blank"]::after {
    content: url(../assets/new-tab.svg);
    margin-left: 2px;
}

section {
    min-height: 100svh;
    width: var(--section-width);
    max-width: var(--section-max-width);
    margin: auto;
    margin-bottom: var(--large-unit);
    font-size: var(--font-size);
    box-sizing: border-box;
    padding: var(--section-padding);
    overflow-x: hidden;
}

section>header {
    font-size: var(--heading-font-size);
    display: inline;
}

section .bubble {
    position: relative;
    background: var(--bubble-background-color);
    border-radius: var(--small-unit);
    font-size: var(--font-size);
    max-width: min(100%, 50rem);
    padding: var(--small-unit) var(--medium-unit);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, .2);
    hyphens: auto;
}

section .bubble:after {
    content: '';
    position: absolute;
    top: 0;
    left: var(--large-unit);
    width: 0;
    height: 0;
    border: var(--small-unit) solid transparent;
    border-bottom-color: var(--bubble-background-color);
    border-top: 0;
    margin-left: calc(-1 * var(--small-unit));
    margin-top: calc(-1 * var(--small-unit));
}

.animate {
    transition: all 1s ease;
    transition-delay: 400ms;
}

.animate-out {
    filter: blur(100%);
    transform: translateX(var(--large-unit));
    opacity: 0;
}

.animate-in {
    filter: blur(0%);
    transform: translateX(0%);
    opacity: 1;
}

/* 
    ----------------------------------------------------
    LANDING SECTION CSS BELOW
    ----------------------------------------------------
*/

section.landing {
    display: flex;
    flex: auto 1;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: hidden;
}

section.landing>header {
    font-size: var(--landing-font-size);
    margin: auto 0;
}

section.landing>header span.landing__wave {
    display: inline-block;
    transform-origin: 90% 90%;
    animation: wave-animation 1.5s infinite;
}

@keyframes wave-animation {
    0% {
        transform: rotate(-6.125deg);
    }

    50% {
        transform: rotate(6.125deg);
    }

    100% {
        transform: rotate(-6.125deg);
    }
}

section.landing>footer {
    align-self: center;
}

section.landing>footer>button {
    cursor: pointer;
    background: none;
    border: none;
    font-size: var(--landing-font-size);
    padding: var(--large-unit) 0;
    animation: scroll-down-icon-animation 1.5s infinite;
}

@keyframes scroll-down-icon-animation {

    from,
    to {
        transform: translateY(0%);
    }

    50% {
        transform: translateY(var(--medium-unit));
    }
}

/* 
    ----------------------------------------------------
    ABOUT SECTION CSS BELOW
    ----------------------------------------------------
*/

section.about {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--large-unit);
}

/* 
    ----------------------------------------------------
    INTERNSHIP SECTION CSS BELOW
    ----------------------------------------------------
*/

section.internship {
    display: flex;
    flex-direction: column;
    gap: var(--large-unit);
}

.chat-bubble {
    position: relative;
    max-width: min(100%, 50rem);
    font-size: var(--font-size);
    padding: var(--small-unit) var(--medium-unit);
    margin-bottom: var(--large-unit);
    border-radius: var(--small-unit);
    box-shadow: 0px 2px 4px rgba(0, 0, 0, .2);
    hyphens: auto;
}

.chat-bubble:after {
    content: '';
    position: absolute;
    bottom: var(--small-unit);
    width: 0;
    height: 0;
    border: var(--small-unit) solid transparent;
    margin-top: calc(-1 * var(--small-unit));
}

.chat-bubble-user {
    background: var(--chat-user-background-color);
    margin-left: auto;
}

.chat-bubble-user:after {
    right: 0;
    border-left-color: var(--chat-user-background-color);
    margin-right: calc(-2 * var(--small-unit));
}

.chat-bubble-bot {
    background: var(--chat-bot-background-color);
    margin-right: auto;
}

.chat-bubble-bot:after {
    left: 0;
    border-right-color: var(--chat-bot-background-color);
    margin-left: calc(-2 * var(--small-unit));
}

.chat-bubble>div.chat-bubble__header {
    font-family: monospace;
    font-size: var(--small-font-size);
    margin-bottom: var(--small-unit);
}

.chat-bubble>p.chat-bubble__body {
    display: inline;
}

div.chat-bubble>span.caret {
    color: var(--accent-color);
    font-weight: bolder;
    animation: blink-caret .75s ease-in-out infinite;
}

@keyframes blink-caret {

    from,
    to {
        opacity: 0.1;
    }

    50% {
        opacity: 1;
    }
}

/* 
    ----------------------------------------------------
    PROJECTS SECTION CSS BELOW
    ----------------------------------------------------
*/

section.projects {
    display: flex;
    flex-direction: column;
    gap: var(--large-unit);
}

section.projects>main div.projects__project {
    display: flex;
    flex-direction: column;
    gap: var(--medium-unit);
    padding: var(--large-unit) 0;
}

section.projects>main div.slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: mandatory;
}

section.projects>main div.slides::-webkit-scrollbar {
    width: var(--small-unit);
    height: var(--small-unit);
}

section.projects>main div.slides::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: var(--small-unit);
}

section.projects>main div.slides::-webkit-scrollbar-track {
    background: transparent;
}

section.projects>main div.slides>div.slide {
    position: relative;
    display: flex;
    margin: 0 var(--medium-unit) var(--medium-unit) 0;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    border-radius: var(--small-unit);
    transform-origin: center center;
    transform: scale(1);
    transition: transform 0.5s;
    width: min(60rem, 100%);
    background-image: var(--background-url);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    overflow: hidden;
}

section.projects>main div.slides>div.slide-16-9 {
    aspect-ratio: 16/9;
}

section.projects>main div.slides>div.slide-4-3 {
    aspect-ratio: 4/3;
}

/* 
    ----------------------------------------------------
    HOBBY SECTION CSS BELOW
    ----------------------------------------------------
*/

section.hobby {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--large-unit);
}

/* 
    ----------------------------------------------------
    CONTACT SECTION CSS BELOW
    ----------------------------------------------------
*/

section.contact {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--large-unit);
}

section.contact>main p>i {
    color: var(--accent-color);
}