/* ======================================================== */
/* Variables                                                */
/* ======================================================== */

:root {
    --teal: rgb(1, 165, 149);
    --text: #111111;
    --light-gray: #f5f5f5;
}


/* ======================================================== */
/* General                                                  */
/* ======================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    font-family: "Inter", sans-serif;
    font-weight: 400;

    color: var(--text);
    background: white;

    overflow-x: hidden;
}

img,
video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

p {
    line-height: 1.7;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}


/* ======================================================== */
/* Layout                                                   */
/* ======================================================== */

.container {
    display: flex;
    justify-content: center;

    width: 100%;
}

.container-inner {
    width: 80%;
    max-width: 1200px;
}

.section {
    padding: 110px 0;
}

.bg-teal {
    color: white;
    background-color: var(--teal);
}

.centered-section {
    padding: 110px 0;

    text-align: center;
}

.section-title {
    margin-bottom: 70px;

    font-size: 44px;
    font-weight: 800;

    text-align: center;
}


/* ======================================================== */
/* Header                                                   */
/* ======================================================== */

#header {
    display: flex;
    align-items: center;

    min-height: 100px;

    gap: 30px;
}

#logo-link {
    margin-right: auto;
}

#cd-logo {
    width: 50px;

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

#logo-link:hover #cd-logo {
    transform: scale(1.07);
}

#nav-links {
    display: flex;
    align-items: center;

    gap: 32px;
}

#nav-links a {
    position: relative;

    font-size: 15px;
    font-weight: 500;

    text-decoration: none;

    transition: color 0.2s ease;
}

#nav-links a:not(#contact-nav)::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: -5px;

    width: 100%;
    height: 2px;

    background: var(--teal);

    transform: scaleX(0);
    transform-origin: right;

    transition: transform 0.25s ease;
}

#nav-links a:not(#contact-nav):hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

#nav-links a:hover {
    color: var(--teal);
}

#contact-nav {
    padding: 7px 15px;

    color: var(--teal);

    border: 1px solid var(--teal);
    border-radius: 30px;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

#contact-nav:hover {
    color: white !important;
    background: var(--teal);

    transform: translateY(-2px);
}


/* ======================================================== */
/* Hero                                                     */
/* ======================================================== */

#hero {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 650px;

    padding: 80px 0 120px;

    text-align: center;
}

#hero h1 {
    margin-bottom: 20px;

    font-size: clamp(60px, 8vw, 105px);
    font-weight: 800;
    line-height: 0.95;

    letter-spacing: -5px;

    animation: hero-enter 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#hero > p {
    margin-bottom: 0;

    font-size: clamp(20px, 2vw, 26px);
    font-weight: 400;

    animation: hero-enter 0.8s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#panda {
    width: 150px;
    height: 150px;

    margin-top: 60px;

    border-radius: 50%;

    object-fit: cover;

    animation: panda-enter 0.9s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

#panda:hover {
    transform: translateY(-5px) rotate(2deg);

    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

@keyframes hero-enter {

    from {
        opacity: 0;

        transform: translateY(35px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }
}

@keyframes panda-enter {

    from {
        opacity: 0;

        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;

        transform: translateY(0) scale(1);
    }
}


/* ======================================================== */
/* Scroll Indicator                                         */
/* ======================================================== */

.scroll-indicator {
    position: absolute;

    bottom: 35px;

    width: 25px;
    height: 40px;

    border: 2px solid var(--teal);
    border-radius: 20px;

    opacity: 0;

    animation: indicator-enter 0.6s 1s ease forwards;
}

.scroll-indicator span {
    position: absolute;

    top: 8px;
    left: 50%;

    width: 4px;
    height: 7px;

    background: var(--teal);

    border-radius: 10px;

    transform: translateX(-50%);

    animation: scroll-dot 1.8s infinite;
}

@keyframes indicator-enter {

    to {
        opacity: 0.7;
    }
}

@keyframes scroll-dot {

    0% {
        opacity: 0;

        transform: translate(-50%, 0);
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;

        transform: translate(-50%, 14px);
    }
}


/* ======================================================== */
/* About                                                    */
/* ======================================================== */

#about h2 {
    margin-bottom: 40px;

    font-size: 40px;
    font-weight: 700;
}

.about-text {
    max-width: 850px;

    margin: 0 auto;
}

.about-text p {
    margin-bottom: 25px;

    font-size: 17px;
}

.about-text p:last-child {
    margin-bottom: 0;
}


/* ======================================================== */
/* Skills                                                   */
/* ======================================================== */

.skills-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 50px;

    text-align: center;
}

.skill-group {
    padding: 20px 10px;

    border-radius: 10px;

    transition:
        transform 0.25s ease,
        background-color 0.25s ease;
}

.skill-group:hover {
    background: var(--light-gray);

    transform: translateY(-5px);
}

.skill-group h3 {
    margin-bottom: 25px;

    color: var(--teal);

    font-size: 19px;
    font-weight: 700;
}

.skill-group p {
    margin: 7px 0;

    font-size: 15px;
}


/* ======================================================== */
/* Projects                                                 */
/* ======================================================== */

.project {
    display: grid;

    grid-template-columns: 1.3fr 1fr;

    align-items: center;

    gap: 70px;

    padding: 80px 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.project:first-of-type {
    padding-top: 0;
}

.project:last-child {
    padding-bottom: 0;

    border-bottom: none;
}

.project-media {
    width: 100%;

    min-width: 0;
}

.project-media img,
.project-media video {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 10px;

    background: white;

    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

.project-media:hover img,
.project-media:hover video {
    transform: translateY(-6px) scale(1.01);

    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.2);
}

.project-info {
    min-width: 0;
}

.project-label {
    margin-bottom: 10px;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 2px;
    text-transform: uppercase;

    opacity: 0.75;
}

.project-info h3 {
    margin-bottom: 20px;

    font-size: 32px;
    font-weight: 700;
}

.project-info > p {
    font-size: 16px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin: 25px 0;
}

.project-tech span {
    padding: 6px 12px;

    font-size: 12px;
    font-weight: 600;

    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 30px;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.project-tech span:hover {
    color: var(--teal);
    background: white;

    transform: translateY(-2px);
}


/* ======================================================== */
/* Buttons                                                  */
/* ======================================================== */

.button {
    display: inline-block;

    padding: 10px 20px;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    border-radius: 30px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.button:hover {
    transform: translateY(-3px);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.white-button {
    color: var(--teal);

    background: white;
}

.outline-white-button {
    color: white;

    border: 1px solid white;
}

.outline-white-button:hover {
    color: var(--teal);

    background: white;
}


/* ======================================================== */
/* Experience                                               */
/* ======================================================== */

.experience-item {
    display: grid;

    grid-template-columns: 1fr 2fr;

    gap: 70px;

    max-width: 1000px;

    margin: 0 auto;
}

.experience-heading h3 {
    margin-bottom: 7px;

    font-size: 23px;
}

.experience-heading p {
    color: var(--teal);

    font-weight: 600;
}

.experience-content p {
    margin-bottom: 20px;

    font-size: 16px;
}


/* ======================================================== */
/* Education                                                */
/* ======================================================== */

.education-list {
    max-width: 900px;

    margin: 0 auto;
}

.education-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 50px;

    padding: 30px 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.education-item:first-child {
    padding-top: 0;
}

.education-item:last-child {
    padding-bottom: 0;

    border-bottom: none;
}

.education-item h3 {
    margin-bottom: 8px;

    font-size: 21px;
}

.education-item p {
    margin-bottom: 0;
}

.education-date {
    white-space: nowrap;

    font-weight: 600;
}


/* ======================================================== */
/* Contact                                                  */
/* ======================================================== */

.contact-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 500px;

    text-align: center;
}

.contact-section h2 {
    margin-bottom: 20px;

    font-size: clamp(40px, 6vw, 70px);
    font-weight: 800;

    letter-spacing: -3px;
}

.contact-section > p {
    max-width: 600px;

    font-size: 17px;
}

.contact-links {
    display: flex;

    gap: 30px;

    margin-top: 25px;
}

.contact-links a {
    position: relative;

    color: var(--teal);

    font-weight: 600;

    text-decoration: none;
}

.contact-links a::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: -4px;

    width: 100%;
    height: 2px;

    background: var(--teal);

    transform: scaleX(0);

    transition: transform 0.2s ease;
}

.contact-links a:hover::after {
    transform: scaleX(1);
}


/* ======================================================== */
/* Footer                                                   */
/* ======================================================== */

.footer {
    padding: 25px 0;

    border-top: 1px solid #ddd;

    text-align: center;
}

.footer p {
    margin: 0;

    font-size: 12px;

    opacity: 0.6;
}


/* ======================================================== */
/* Scroll Animations                                        */
/* ======================================================== */

.scroll-animation {
    opacity: 0;

    transform: translateY(45px);

    transition:
        opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-animation.show {
    opacity: 1;

    transform: translateY(0);
}


/* Enter from left */

.scroll-animation.scroll-left {
    transform: translateX(-70px);
}

.scroll-animation.scroll-left.show {
    transform: translateX(0);
}


/* Enter from right */

.scroll-animation.scroll-right {
    transform: translateX(70px);
}

.scroll-animation.scroll-right.show {
    transform: translateX(0);
}


/* Staggered entrances */

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}


/* ======================================================== */
/* Tablet                                                   */
/* ======================================================== */

@media (max-width: 900px) {

    .container-inner {
        width: 85%;
    }

    #nav-links {
        gap: 18px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);

        row-gap: 50px;
    }

    .project {
        grid-template-columns: 1fr;

        gap: 35px;
    }

    /*
        Once projects stack vertically, horizontal entrances
        aren't as useful. Let both parts rise from below.
    */

    .scroll-animation.scroll-left,
    .scroll-animation.scroll-right {
        transform: translateY(45px);
    }

    .scroll-animation.scroll-left.show,
    .scroll-animation.scroll-right.show {
        transform: translateY(0);
    }

    .experience-item {
        grid-template-columns: 1fr;

        gap: 15px;
    }
}


/* ======================================================== */
/* Mobile                                                   */
/* ======================================================== */

@media (max-width: 650px) {

    .container-inner {
        width: calc(100% - 40px);
    }

    .section,
    .centered-section {
        padding: 75px 0;
    }


    /* Header */

    #header {
        min-height: 80px;
    }

    #cd-logo {
        width: 42px;
    }

    #nav-links a:not(#contact-nav) {
        display: none;
    }


    /* Hero */

    #hero {
        min-height: 550px;

        padding: 60px 0 90px;
    }

    #hero h1 {
        font-size: clamp(55px, 17vw, 80px);

        letter-spacing: -3px;
    }

    #hero > p {
        font-size: 19px;
    }

    #panda {
        width: 120px;
        height: 120px;

        margin-top: 50px;
    }

    .scroll-indicator {
        display: none;
    }


    /* About */

    #about h2 {
        font-size: 32px;
    }

    .about-text p {
        font-size: 15px;
    }


    /* Sections */

    .section-title {
        margin-bottom: 45px;

        font-size: 36px;
    }


    /* Skills */

    .skills-grid {
        grid-template-columns: 1fr 1fr;

        gap: 40px 20px;
    }


    /* Projects */

    .project {
        padding: 55px 0;
    }

    .project-info h3 {
        font-size: 27px;
    }


    /* Education */

    .education-item {
        flex-direction: column;

        gap: 5px;
    }


    /* Contact */

    .contact-section {
        min-height: 450px;
    }

    .contact-section h2 {
        letter-spacing: -2px;
    }
}


/* ======================================================== */
/* Reduced Motion                                           */
/* ======================================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .scroll-animation,
    .scroll-animation.scroll-left,
    .scroll-animation.scroll-right {
        opacity: 1;

        transform: none;
    }
}