/* =================== GOOGLE FONTS ========================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&family=Roboto+Mono:wght@100..700&display=swap');

/* =================== VARIABLES CSS ========================== */
:root {
    --header-height: 3.5rem;
    /* ==========Colors========== */
    /*Color mode HSL(hue, saturation, lightness)*/
    --container-color: hsl(0, 0%, 11%);
    --box-color: hsla(0, 0%, 22%, .35);

    --black-color: hsl(0, 0%, 7%);
    --black-color-light: hsl(0, 0%, 22%);
    --white-color: hsl(0, 0%, 96%);
    --white-color-alt: hsl(0, 0%, 86%);

    --scroll-track-color: hsla(0, 0%, 20%);
    --scroll-thumb-color: hsla(0, 0%, 40%);

    --shadow-button: 0 2px 24px 4px hsla(0, 0%, 96%, .4);
    --shadow-box: 0 2px 16px hsla(0, 0%, 100%, .4);
    --shadow-img: drop-shadow(0 2px 12px hsla(0, 0%, 100%, .4));
    --shadow-portrait: drop-shadow(0, 0, 16px, hsla(0, 0%, 0%, .65));
    --shadow-title: drop-shadow(0px 0px 16px hsla(0, 0%, 96%, .4));


    /* ========== Font and typography ========== */
    --body-font: "Noto Sans TC", "Roboto Mono", serif;
    --title-font: "Roboto Mono", "Noto Sans TC", serif;

    /* phone size */
    --biggest-font-size: 2.5rem;
    --h1-font-size: 2rem;
    --h2-font-size: 1.25rem;
    --h3-font-size: 1rem;
    --normal-font-size: .938rem;
    --smaller-font-size: .75rem;

    /* ========== Font weight ========== */
    --font-regular: 400;
    --font-medium: 500;
    --font-semi-bold: 600;
    --font-bold: 700;
    --font-extra-bold: 800;

    /* ========== z index ========== */
    --z-back: -10;
    --z-normal: 1;
    --z-tooltip: 10;
    --z-fixed: 100;
    --z-modal: 1000;

}

/* =================== Responsive typography ========================== */
/* desktop size 968 / 1150 */
@media screen and (min-width: 1150px) {
    :root {
        --biggest-font-size: 4rem;
        --h1-font-size: 2.5rem;
        --h2-font-size: 1.5rem;
        --h3-font-size: 1.25rem;
        --normal-font-size: 1rem;
        --smaller-font-size: .813rem;
    }
}


/* ================== CSS RESET / BASE ========================= */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

body,
input,
textarea,
button {
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
}

body {
    background-color: var(--black-color);
    color: var(--white-color);
    cursor: auto;
}

input,
button,
textarea {
    border: none;
    outline: none;
}

button {
    cursor: pointer;
}

h1,
h2,
h3 {
    color: var(--title-color);
    font-weight: var(--font-medium);
    font-family: var(--title-font);
}


p {
    letter-spacing: .1rem;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    /* replace display block */
    font-style: italic;
    /* img alt */
    object-fit: cover;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.section {
    padding: 7.5rem 0 3.5rem;
}

.section__title {
    font-size: var(--h2-font-size);
    text-align: center;
    text-transform: capitalize;
    margin-bottom: 2rem;
    color: var(--black-color);
    text-shadow:
        -1px -1px 0 var(--white-color),
        /* 左上 */
        1px -1px 0 var(--white-color),
        /* 右上 */
        -1px 1px 0 var(--white-color),
        /* 左下 */
        1px 1px 0 var(--white-color);
    /* 右下 */
    filter: var(--shadow-title);
    -webkit-user-select: none;
    /*Chrome, Opera (older versions), IOS Safari*/
    -webkit-touch-callout: none;
    /*Safari*/
    -moz-user-select: none;
    /*Mozilla*/
    -ms-user-select: none;
    user-select: none;

}

.container {
    max-width: 1120px;
    margin-left: 1.5rem;
    margin-right: 1.5rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.main {
    overflow: clip;
}

/*button style*/
.button {
    background-color: var(--white-color);
    color: var(--black-color);
    box-shadow: var(--shadow-button);
    padding: .5rem 1.5rem;
    border-radius: .25rem;
    font-size: var(--h3-font-size);
    font-family: var(--title-font);
    font-weight: var(--font-medium);
    transition: background-color .4s;
}

.button:hover {
    background-color: var(--white-color-alt);
}

/*=============== HEADER ===============*/
.header {
    position: fixed;
    z-index: var(--z-fixed);
    width: 100%;
    top: 0;
    left: 0;
    background-color: transparent;
    transition: box-shadow .4s;
}

.nav {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo{
    width: 40px;
}

.nav__toggle,
.nav__close {
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
}

/*Navigation for mobile devices*/
@media screen and (max-width: 1150px) {
    .nav__menu {
        position: fixed;
        z-index: var(--z-fixed);
        width: 100%;
        padding-block: 4rem;
        top: -120%;
        left: 0;
        background-color: hsla(0, 0%, 7%, .4);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 4px 32px hsl(0, 0%, 96%, .45);
        transition: top .4s;
    }
}

.nav__list {
    display: flex;
    flex-direction: column;
    row-gap: 2.5rem;
    text-align: center;
}

.nav__link {
    color: var(--white-color);
    font-weight: var(--font-semi-bold);
    font-family: var(--h3-font-size);
    transition: color .4s;
}

.nav__link:hover {
    color: var(--white-color-alt);
    text-decoration: underline;
}

.nav__close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
}

/*show menu*/
.show {
    top: 0;
}

/*scroll header*/
.scroll-header::after {
    content: ' ';
    position: absolute;
    z-index: var(--z-back);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: hsla(0, 0%, 7%, .65);
    box-shadow: 0 4px 16px hsla(0, 0%, 96%, .25);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/*active link*/
.active-link {
    text-decoration: underline;
}

/*=============== HOME ===============*/
.home {
    position: relative;
    padding-block: 8.25rem 2.5rem;
    overflow: clip;
}

.home__bg {
    height: 100%;
    position: absolute;
    z-index: var(--z-back);
    top: 0;
    left: 0;
}

.home__container {
    grid-template-rows: max-content 400px;
    justify-content: center;
}

.home__data {
    width: 360px;
    text-align: center;
    position: relative;
}

.home__title {
    font-size: var(--biggest-font-size);
    font-weight: var(--font-bold);
    margin-bottom: .5rem;
}

.home__subtitle {
    font-size: var(--normal-font-size);
    font-family: var(--body-font);
    font-weight: var(--font-regular);
    margin-bottom: 2rem;
}

.home__button {
    display: inline-flex;
}

.home__mouse {
    width: 30px;
    position: absolute;
    rotate: -35deg;
    bottom: -2rem;
    right: 4rem;
}

.home__social{
    display: none;
}


.home__images {
    position: relative;
}

.home__img {
    position: absolute;
    filter: var(--shadow-img);
}

.home__computer {
    width: 320px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.home__cloud {
    top: 2rem;
    right: -6rem;
    width: 200px;
}

.home__phone {
    width: 60px;
    right: 0rem;
    bottom: 3rem;
}

.home__document {
    width: 72px;
    top: 2rem;
    left: 0rem;
}

/*=============== WORK ===============*/
.work {
    background-color: var(--container-color);
}

.work__container {
    gap: 2.5rem;
    justify-content: center;
}

.work__card {
    width: 320px;
    background-color: var(--black-color);
    padding: 1.25rem;
    border-radius: .5rem;
    box-shadow: var(--shadow-box);
}

.work__title {
    font-size: var(--h2-font-size);
    margin-bottom: .25rem;
}

.work__description {
    margin-bottom: 1.5rem;
}

.work__image {
    position: relative;
    display: flex;
}

.work__image::after {
    content: ' ';
    position: absolute;
    border: solid 2px transparent;
    opacity: 1;
    inset: 0px;
    transition: border-color .4s, opacity .4s, inset .4s;
    pointer-events: none;
}

.work__img {
    width: 100%;
    height: 240px;
    transition: filter .4s;
}

.work__icon {
    background-color: hsla(0, 0%, 7%, .65);
    display: flex;
    border-radius: 100%;
    padding: .75rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s;
}

.work__icon i {
    font-size: 1.5rem;
    color: var(--white-color);
    transform: rotate(45deg);
    transition: transform .4s;
}

/*card hover effect*/
.work__image:hover .work__icon {
    opacity: 1;
    pointer-events: auto;
}

.work__image:hover .work__icon i {
    transform: rotate(0);
}

.work__image:hover::after {
    border-color: var(--white-color);
    opacity: 1;
    inset: 10px;
}

.work__image:hover .work__img {
    filter: grayscale(100%) brightness(40%);
}

/*=============== INFO ===============*/
.info__container {
    row-gap: 4rem;
}

.info__portrait {
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, hsla(0, 0%, 7%, .9) 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, hsla(0, 0%, 7%, .9) 60%, transparent 100%);
}

.info__button {
    text-align: center;
}

.skills__title {
    font-size: var(--h3-font-size);
    margin-bottom: 2rem;
    position: relative;
    display: inline-flex;
}

.skills__title::after {
    content: ' ';
    position: absolute;
    bottom: -.25rem;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--white-color);
}

.skills__content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.skills__box {
    display: grid;
    place-items: center;
    row-gap: .5rem;
    transition: transform .4s;
}

.skills__box:hover {
    transform: translateY(-.25rem);
}

.skills__img {
    height: 56px;
}

.skills__name {
    width: fit-content;
    font-size: var(--smaller-font-size);
}

/*=============== SERVICE ===============*/
.service {
    background-color: var(--container-color);
}

.service__box {
    background-color: var(--box-color);
    padding: 1rem;
    border: solid 1px var(--white-color);
    box-shadow: var(--shadow-box);
}

.service__subtitle {
    font-size: var(--smaller-font-size);
}

.service__title {
    font-size: var(--h2-font-size);
    margin-bottom: .5rem;
}

.service__description {
    text-align: justify;
}

/*=============== CONTACT ===============*/
.contact {
    padding-block: 7.5rem;
}

.contact__titles,
.contact__container {
    position: relative;
}

.contact__titles {
    width: max-content;
    margin: auto;
}

.contact__form {
    gap: 1.25rem;
}

.contact__content {
    row-gap: .75rem;
}

.contact__box {
    position: relative;
    background-color: var(--black-color-light);
    display: flex;
    align-items: center;
    border-radius: .5rem;
}

.contact__input {
    width: 100%;
    padding: 1rem 4rem 1.5rem 1rem;
    background-color: transparent;
    color: var(--white-color);
    font-weight: var(--font-medium);
    border-radius: .5rem;
    border: solid 1px transparent;
    transition: border-color .4s, padding-block .4s;
}

.contact__input:autofill {
    transition: background-color 6000s, color 6000s;
}

.contact__label {
    position: absolute;
    left: 1rem;
    color: hsla(0, 0%, 96%, .4);
    font-weight: var(--font-medium);
    transition: transform .4s, font-size .4s, color .4s;
}

.contact__icon {
    position: absolute;
    right: 1rem;
    font-size: 1.5rem;
    color: hsla(0, 0%, 96%, .4);
    transition: color .4s;
}

.contact__textarea {
    padding: 1rem;
    font-size: var(--h3-font-size);
    color: var(--white-color);
    font-weight: var(--font-medium);
    background-color: var(--black-color-light);
    border-radius: .5rem;
    height: 160px;
    resize: none;
}

.contact__message {
    position: absolute;
    bottom: -2rem;
    z-index: var(--z-tooltip);
}

/*input focus color*/
.contact__input:focus {
    border-color: var(--white-color);
}

.contact__input:focus~.contact__icon,
.contact__input:focus~.contact__label {
    color: var(--white-color);
}

/*input focus move up label*/
.contact__input:focus~.contact__label {
    transform: translateY(-1rem);
    font-size: var(--smaller-font-size);
}

.contact__input:focus {
    padding-block: 1.5rem 1rem;
}

/*input focus sticky top label*/
.contact__input:not(:placeholder-shown).contact__input:not(:focus)~.contact__label {
    transform: translateY(-1rem);
    font-size: var(--smaller-font-size);
}

.contact__input:not(:placeholder-shown).contact__input:not(:focus) {
    padding-block: 1.5rem 1rem;
}

/*Lottie Position*/
.lottie__email {
    position: absolute;
    z-index: var(--z-tooltip);
    width: 72px;
    transform: rotate(10deg);
    right: -6rem;
    top: -3rem;
}

.lottie__sendEmail {
    width: 160px;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--white-color);
    border-radius: 100%;
    box-shadow: var(--shadow-box);
    pointer-events: none;
    opacity: 0;
    transition: opacity .4s, top .4s;
}

.show-sendEmail {
    opacity: 1;
    top: 50%;
}

/*=============== FOOTER ===============*/
.footer {
    background-color: var(--container-color);
    padding: 2.5rem 1.5rem;
}

.footer__container {
    row-gap: 2rem;
}

.footer__links {
    display: flex;
    column-gap: 2.5rem;
    justify-content: center;
}

.footer__link {
    color: var(--white-color);
    transition: color .4s;
}

.footer__link:hover {
    color: var(--white-color-alt)
}

.footer__resource {
    font-size: var(--smaller-font-size);
    letter-spacing: .1rem;
    text-align: center;
    line-height: 200%;
}

.footer__resource-link {
    color: var(--white-color-alt);
    text-decoration: underline;
}

.footer__right {
    font-size: var(--smaller-font-size);
    letter-spacing: .1rem;
    text-align: center;
}

/*=============== SCROLL UP ===============*/
.scroll__up {
    position: fixed;
    z-index: var(--z-fixed);
    right: 1.5rem;
    bottom: -50%;
    background-color: var(--container-color);
    padding: .75rem;
    border-radius: .25rem;
    box-shadow: var(--shadow-box);
    display: inline-flex;
    transition: bottom .4s;
}

.scroll__up i {
    font-size: 1.25rem;
    color: var(--white-color)
}

/*show scroll*/
.show-scroll {
    bottom: 3rem;
}

/*=============== CURSOR ===============*/
.cursor {
    width: 54px;
    height: 54px;
    box-shadow: 0 0 16px 4px hsla(0, 0%, 96%, .6);
    background-color: transparent;
    border-radius: 100%;
    pointer-events: none; /*這要記得加*/
    position: fixed;
    z-index: var(--z-fixed);
    transform: translate(-50%, -50%); /*滑鼠左標為元素左上角，因此需要置中*/
    transition: width .4s, height .4s, background-color .4s;
    display: none;
    opacity: 0;
}

.cursor__small {
    width: 34px;
    height: 34px;
}

/*change cursor style*/
.focus {
    width: 16px;
    height: 16px;
    background-color: var(--black-color);
}

/*=============== BREAKPOINTS ===============*/
/*For small devices*/
@media screen and (max-width: 320px) {
    .container {
        margin-inline: 1rem;
    }

    .home__data {
        width: 280px;
    }

    .home__title {
        font-size: var(--h1-font-size);
    }

    .home__mouse {
        right: 2.5rem
    }

    .work__container {
        gap: 1.5rem;
    }

    .work__card {
        width: 260px;
    }

    .work__title {
        font-size: var(--h3-font-size);
    }

    .work__img {
        height: 200px;
    }
}

/*For medium devices*/
@media screen and (min-width: 540px) {

    .info__container,
    .contact__container {
        width: 420px;
        margin: auto;
    }

    .service__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 768px) {
    .home {
        padding-block: 8.5rem 5rem;
    }

    .home__container,
    .info__data {
        grid-template-columns: repeat(2, 350px);
    }

    .home__container {
        grid-template-rows: 320px;
    }

    .home__bg {
        width: 100%;
    }

    .home__data {
        width: initial;
        text-align: initial;
        align-self: center;
    }

    .home__mouse {
        right: initial;
        left: 9rem;
    }

    .home__social{
        display: inline-flex;
        column-gap: 1.25rem;
    }
    
    .home__social-link{
        display: grid;
        width: 32px;
        height: 32px;
        place-items: center;
        background-color: var(--white-color);
        box-shadow: var(--shadow-button);
        border-radius: 50%;
        transition: transform .4s;
    }
    
    .home__social-link i{
        font-size: 1.5rem;
        color: var(--black-color);
    }
    
    .home__social-link:hover{
        transform: translateY(-.25rem);
    }

    .work__container {
        grid-template-columns: repeat(2, max-content);
    }

    .info__container {
        width: initial;
        margin-inline: 1.5rem;
        justify-content: center;
    }

    .info__data {
        align-items: flex-end;
    }
}


/*For large devices*/
@media screen and (min-width: 1150px) {
    .cursor{
        display: block;
        opacity: 1;
    }
    .section {
        padding-block: 7.5rem 5rem;
    }

    .container {
        margin: auto;
    }

    .section__title {
        margin-bottom: 2.5rem;
    }

    .nav {
        height: calc(var(--header-height) + 2rem);
    }

    .nav__logo{
        width: 56px;
    }

    .nav__close,
    .nav__toggle {
        display: none;
    }

    .nav__list {
        flex-direction: row;
        column-gap: 3rem;
    }

    .home {
        height: 100dvh;
        display: grid;
        align-items: center;
    }

    .home__container {
        width: 100%;
        grid-template-columns: max-content 500px;
        justify-content: space-between;
    }

    .home__computer {
        width: 420px;
    }

    .home__cloud {
        width: 240px;
        top: 0;
    }

    .home__phone {
        width: 92px;
        bottom: 0;
    }

    .home__document {
        width: 92px;
        top: 0;
    }

    .work__card {
        width: 380px;
    }

    .info__data {
        grid-template-columns: 480px 350px;
        align-items: center;
    }

    .service__container {
        grid-template-columns: repeat(4, 1fr)
    }

    .contact {
        padding-block: 10rem;
    }

    .contact__container {
        width: 540px;
    }

    .footer {
        padding-block: 3rem;
    }

    .footer__container {
        grid-template-columns: repeat(3, max-content);
        justify-content: space-between;
    }
}

/*=============== SCROLL BAR ===============*/
::-webkit-scrollbar {
    width: .5rem;
}

::-webkit-scrollbar-track {
    background-color: var(--scroll-track-color);
}

::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb-color);
}

