/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body,
h1,
h2,
h3,
h4,
h5,
p,
ul,
ol,
li,
dl,
dt,
dd,
blockquote,
figure,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

li {
  list-style: none;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* sr-only */
.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* UI */
html {
  scroll-behavior: smooth;
}

body {
  background-color: #242424;
  color: #f2f2f2;
  font-family: "Pretendard", sans-serif;
  line-height: 1.6;
}

.header {
  position: fixed;
  left: 50%;
  top: -7rem;
  transform: translateX(-50%);
  z-index: 10;
  transition: top 0.3s ease;

  .nav__list {
    display: flex;
    gap: 1rem;

    .nav__item {
      border-radius: 100%;
      overflow: hidden;
      background-color: rgba(255, 255, 255, 0.06);
      backdrop-filter: blur(10px) saturate(1.4);
      -webkit-backdrop-filter: blur(10px) saturate(1.4);
      border: 1px solid rgba(255, 255, 255, 0.12);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08),
        0 8px 32px rgba(0, 0, 0, 0.35);
      transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;

      &:hover {
        background-color: rgba(255, 255, 255, 0.11);
        border-color: rgba(255, 255, 255, 0.22);
        box-shadow:
          inset 0 1px 0 rgba(255, 255, 255, 0.2),
          0 12px 40px rgba(0, 0, 0, 0.4),
          0 0 0 1px rgba(138, 180, 248, 0.15);
      }

      a {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 5rem;
        height: 5rem;
        font-family: "Roboto Slab", sans-serif;
        font-size: 0.875rem;
        color: #d4d4d4;
        text-align: center;

        &:hover {
          color: #f2f2f2;
        }
      }
    }
  }
}

section {
  padding: 8rem 1rem;
  max-width: 64rem;
  margin: 0 auto;

  .section-title {
    margin-bottom: 8rem;
    font-family: "Roboto Slab", sans-serif;
    font-size: 3rem;
    text-align: center;
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.8s ease, transform 0.8s ease;

    &.section-title--wide {
      width: 100%;
    }

    &.is-visible {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* intro section */
.intro {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;

  .intro__title {
    margin-bottom: 4rem;
    font-family: "Paperlogy", sans-serif;
    font-size: 4rem;
    line-height: 1.4;

    .intro__title-line {
      display: block;
      overflow: hidden;

      .intro__title-text {
        display: block;
        transform: translateY(100%);
        transition: transform 1.4s ease;
      }
    }

    .intro__greeting {
      display: inline-block;
      transform-origin: 50% 80%;
      animation-delay: 0.5s;

      &.is-initial {
        animation: wave 1.4s ease-in-out 2;
      }

      &:hover {
        animation: wave 1s ease-in-out;
      }
    }
  }

  .intro__description {
    color: #d4d4d4;
    font-size: 1.125rem;

    .intro__description-line {
      display: block;
      overflow: hidden;

      .intro__description-text {
        display: block;
        opacity: 0;
        transition: opacity 1.4s 1s ease;
      }
    }
  }

  .intro__scroll {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    padding: 2rem;
    opacity: 0;
    animation: scroll 1s infinite;
    transition: opacity 0.2s ease;

    &.is-initial {
      transition: opacity 1s 1.4s ease;
    }

    &.is-active {
      opacity: 1;
    }

    &.is-hidden {
      opacity: 0;
      pointer-events: none;
    }

    &::before {
      content: '';
      position: absolute;
      left: calc(50% + 1px);
      bottom: 1rem;
      transform: translateX(-50%) rotate(-44deg);
      transform-origin: bottom;
      display: block;
      width: 0.25rem;
      height: 1rem;
      background-color: #f2f2f2;
      border-radius: 3.125rem;
    }

    &::after {
      content: '';
      position: absolute;
      left: calc(50% - 1px);
      bottom: 1rem;
      transform: translateX(-50%) rotate(44deg);
      transform-origin: bottom;
      display: block;
      width: 0.25rem;
      height: 1rem;
      background-color: #f2f2f2;
      border-radius: 3.125rem;
    }
  }

  &.is-active {
    .intro__title {
      .intro__title-line {
        .intro__title-text {
          transform: translateY(0);
        }
      }
    }

    .intro__description {
      .intro__description-line {
        .intro__description-text {
          opacity: 1;
        }
      }
    }
  }
}

/* about section */
.about {
  
  .about__item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 8rem;
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.8s ease, transform 0.8s ease;

    &.is-visible {
      opacity: 1;
      transform: translateY(0);
    }
  
    &:last-of-type {
      margin-bottom: 0;
    }
  }
  
  .about__header {
    display: flex;
    align-items: center;
    gap: 1rem;

    &.about__header--reverse {
      flex-direction: row-reverse;

      .about__subtitle {
        text-align: right;
      }

      .about__label {
        text-align: right;
      }
    }

    .about__image-box {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 4rem;
      height: 4rem;
      overflow: hidden;
      background-color: #f2f2f2;
      border-radius: 100%;

      .about__image--profile {
        transform: translateY(10px);
      }
    }

    .about__text-box {

      .about__subtitle {
        font-family: "Roboto Slab", sans-serif;
        font-weight: 400;
        font-size: 1.25rem;
      }

      .about__label {
        font-size: 1.125rem;

        .about__label-sub {
          display: inline-block;
          margin-left: 0.5rem;
          color: #8a8a8a;
        }
      }
    }
  }

  .about__description {
    align-self: flex-start;
    padding: 2rem;
    margin: 0 5rem;
    background-color: #2a2a2a;
    border-radius: 2rem;
    border-top-left-radius: 0;

    &.about__description--reverse {
      align-self: flex-end;
      border-top-left-radius: 2rem;
      border-top-right-radius: 0;
    }

    &.about__description--wide {
      width: calc(100% - 10rem);
    }

    .about__text {
      margin-bottom: 1.5rem;
      color: #d4d4d4;

      &:last-of-type {
        margin-bottom: 0;
      }
    }
  }

  .about__list {
    display: flex;
    justify-content: space-between;
    gap: 2rem;

    .about__list-item {

      .about__list-text {
        margin-top: 0.5rem;
        color: #d4d4d4;
      }

      .about__list-text--muted {
        color: #8a8a8a;
      }
    }
  }
}

/* skills section */
.skills {

  .skills__category {
    display: flex;
    gap: 2rem;
    margin-bottom: 8rem;
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.8s ease, transform 0.8s ease;

    &.is-visible {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .skills__category-title {
    width: 14rem;
    margin-bottom: 1rem; 
    font-family: "Roboto Slab", sans-serif;
    font-size: 1.5rem;
  }

  .skills__items {
    width: calc(100% - 16rem);

    .skills__item {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin-bottom: 1rem;
      padding: 1.25rem;
      background-color: #2a2a2a;
      border-radius: 1rem;

      &:last-child {
        margin-bottom: 0;
      }

      .skills__icon {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 3.25rem;
        height: 3.25rem;

        img {
          border-radius: 0.5rem;
        }
      }

      .skills__content {
        width: calc(100% - 3.25rem);
      }

      .skills__name {
        font-family: "Roboto Slab", sans-serif;
        font-weight: 400;
        font-size: 1.125rem;
        letter-spacing: 0.02rem;
      }

      .skills__description {
        color: #d4d4d4;
      }
    }
  }

  .skills__note {
    padding: 2rem;
    color: #d4d4d4;
    text-align: center;
    background-color: #2a2a2a;
    border-radius: 1rem;
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.8s ease, transform 0.8s ease;

    &.is-visible {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* projects section */
.projects {

  .projects__item {
    display: flex;
    flex-flow: row wrap;
    gap: 4rem;
    width: 100%;
    margin-bottom: 8rem;
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.8s ease, transform 0.8s ease;

    &.is-visible {
      opacity: 1;
      transform: translateY(0);
    }

    &:last-child {
      margin-bottom: 0;
    }
  }

  .projects__separated-description {
    margin-bottom: 8rem;
    padding: 2rem;
    color: #d4d4d4;
    text-align: center;
    background-color: #2a2a2a;
    border-radius: 1rem;
  }

  .projects__image {
    width: calc((100% - 4rem) / 2);
    height: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.15),
      inset 0 -1px 0 rgba(0, 0, 0, 0.08),
      0 8px 16px rgba(0, 0, 0, 0.35);
  }

  .projects__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: center;
    width: calc((100% - 4rem) / 2);
  }

  .projects__title {
    font-weight: 600;
    font-size: 1.5rem;

    .projects__title-meta {
      display: inline-block;
      margin-left: 0.75rem;
      color: #8a8a8a;
      font-size: 0.875rem;
    }
  }

  .projects__description {
    color: #d4d4d4;

    &.projects__description--muted {
      color: #8a8a8a;
    }

    .projects__description-bar {
      display: inline-block;
      margin: 0 0.5rem;
    }
  }

  .projects__description-list {
    .projects__description-list-item {
      position: relative;
      padding-left: 1.625rem;
      color: #d4d4d4;

      &::before {
        content: '-';
        position: absolute;
        left: 0.5rem;
      }
    }
  }

  .projects__stack {
    display: flex;
    flex-flow: row wrap;
    gap: 0.75rem;
    width: calc(100% - 7rem);

    .projects__stack-item {
      padding: 0.375rem 1.25rem;
      color: #d4d4d4;
      background-color: #2a2a2a;
      border-radius: 50px;
    }
  }

  .projects__link {
    display: flex;
    gap: 1rem;
    width: 100%;

    .projects__link-item {
      width: calc((100% - 1rem) / 2);
      background-color: #2a2a2a;
      border-radius: 0.625rem;

      &.projects__link-item--wide {
        width: 100%;
      }

      a {
        display: block;
        padding: 1rem;
        color: #d4d4d4;
        text-align: center;
      }
    }
  }

  .projects__section {
    width: 100%;
    
    .projects__section-title {
      margin-bottom: 2rem;
    }

    .projects__section-image {
      border: 1px solid rgba(255, 255, 255, 0.12);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.35);
    }
  }

  .projects__feature {
    display: flex;
    gap: 4rem;

    .projects__feature-item {
      width: calc((100% - 4rem) / 2);
    }

    .projects__section-image {
      margin-bottom: 2rem;
    }

    .projects__feature-description {
      margin-bottom: 1rem;
      color: #d4d4d4;

      &:last-of-type {
        margin-bottom: 0;
      }
    }
  }

  .projects__trouble {
    display: flex;
    gap: 4rem;
    
    .projects__trouble-item {
      width: calc((100% - 4rem) / 2);
    }

    .projects__trouble-title {
      margin-bottom: 2rem;
      font-size: 1rem;
    }

    .projects__trouble-description {
      color: #d4d4d4;
    }

    .projects__trouble-detail {

      .projects__trouble-row {
        display: flex;
        margin-bottom: 1rem;

        dt {
          width: 4rem;
        }

        dd {
          width: calc(100% - 4rem);
        }
      }
    }
  }
}

/* thanks section */
.thanks {
  
  .thanks__title {
    font-family: "Paperlogy", sans-serif;
    font-size: 4rem;
    font-weight: 600;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.8s ease;

    &.is-visible {
      opacity: 1;
    }
  }

  .thanks__message {
    margin: 4rem 0;
    color: #d4d4d4;
    font-size: 1.125rem;
    opacity: 0;
    transition: opacity 0.8s ease;

    &.is-visible {
      opacity: 1;
    }
  }

  .contact__links {
    display: flex;
    gap: 2rem;
    opacity: 0;
    transition: opacity 0.8s ease;

    &.is-visible {
      opacity: 1;
    }

    .contact__links-item {

      a {
        text-decoration: underline;
        text-underline-offset: 2px;
        text-decoration-thickness: 2px;
      }

      .contact__email-button {
        padding: 0;
        color: #f2f2f2;
        background-color: transparent;
        border: none;
        cursor: pointer;
        text-decoration: underline;
        text-underline-offset: 2px;
        text-decoration-thickness: 2px;
      }
    }
  }
  
  .toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    z-index: 100;
    padding: 0.875rem 1.25rem;
    color: #242424;
    font-weight: 600;
    background-color: #f2f2f2;
    border-radius: 50px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .toast.is-visible {
    opacity: 1;
    visibility: visible;
  }
}

footer {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem;

  .copyright {
    color: #8a8a8a;
  }
}

@keyframes scroll {
  0%   { bottom: 0; }
  50%  { bottom: 0.5rem; }
  100% { bottom: 0; }
}

@keyframes wave {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(15deg); }
  50%  { transform: rotate(-10deg); }
  75%  { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}

@media (max-width: 768px) {
  section {
    padding: 6rem 1.25rem;

    .section-title {
      margin-bottom: 4rem;
      font-size: 2.25rem;
    }
  }
  
  .header {
    .nav__list {
      gap: 0.375rem;

      .nav__item {
        a {
          width: 3.6rem;
          height: 3.6rem;
          font-size: 0.75rem;
        }
      }
    }
  }

  .intro {
    .intro__title {
      margin-bottom: 2rem;
      font-size: 2.75rem;
    }

    .intro__description {
      font-size: 1rem;
    }

    .intro__scroll {
      &::before,
      &::after {
        height: 0.875rem;
      }
    }
  }

  .about {
    .about__item {
      margin-bottom: 4rem;
    }

    .about__description {
      margin: auto;
      padding: 1.25rem;
      border-radius: 1.5rem;
      border-top-left-radius: 0;

      &.about__description--wide {
        width: 100%;
      }

      &.about__description--reverse {
        border-radius: 1.5rem;
        border-top-right-radius: 0;
      }

      .about__text {

        br {
          display: none;
        }
      }
    }

    .about__list {
      flex-direction: column;
    }
  }

  .skills {
    .skills__category {
      flex-direction: column;
      gap: 1rem;
      margin-bottom: 4rem;
    }
    
    .skills__category-title {
      width: 100%;
      margin-bottom: 0;
      font-size: 1.25rem;

      br {
        display: none;
      }
    }
    
    .skills__items {
      width: 100%;

      .skills__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;

        .skills__icon {
          width: 2.25rem;
          height: 2.25rem;
        }

        .skills__content {
          width: 100%;
        }
      }
    }

    .skills__note {
      padding: 1.5rem;
    }
  }

  .projects {
    .projects__item {
      flex-direction: column;
      gap: 2rem;
      margin-bottom: 4rem;
    }

    .projects__separated-description {
      padding: 1.5rem;
    }

    .projects__title {
      font-size: 1.25rem;
    }

    .projects__image {
      width: 100%;
    }

    .projects__content {
      width: 100%;
    }

    .projects__section {
      margin-top: 2rem;
    }

    .projects__feature {
      flex-direction: column;
      gap: 2rem;

      .projects__feature-item {
        width: 100%;
      }
    }

    .projects__trouble {
      flex-direction: column;
      gap: 2rem;

      .projects__trouble-item {
        width: 100%;
      }
    }
  }

  .thanks {

    .thanks__title {
      font-size: 2.75rem;
      line-height: 1.4;
    }

    .thanks__message {
      margin: 2rem 0;
      font-size: 1rem;

      br {
        display: none;
      }
    }
  }

  .footer {
    padding: 1rem 1.25rem;
  }
}

/* 애니메이션 비활성화 */
@media (prefers-reduced-motion: reduce) {
  .intro__title-text {
    transform: translateY(0);
    transition: none;
  }

  .intro__description-text {
    opacity: 1;
    transition: none;
  }

  .intro__greeting {
    animation: none !important;
  }
  
  .section-title {
    opacity: 1;
    transform: translateY(0);
    transition: none;
  }

  .about__item {
    opacity: 1;
    transform: translateY(0);
    transition: none;
  }

  .skills__category {
    opacity: 1;
    transform: translateY(0);
    transition: none;
  }

  .skills__note {
    opacity: 1;
    transform: translateY(0);
    transition: none;
  }

  .projects__item {
    opacity: 1;
    transform: translateY(0);
    transition: none;
  }

  .thanks__title,
  .thanks__message,
  .contact__links {
    opacity: 1;
    transition: none;
  }
}