/* ========== Reset ========== */
/* 기본 스타일 초기화 및 다크모드 설정 */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    color-scheme: dark;
    scroll-behavior: smooth;
    height: 100%;
  }

  body {
    background: #0d0d0d;
    color: #e0e0e0;
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }

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

  ul {
    list-style: none;
  }
}

/* ========== Layout ========== */
/* 전체 페이지 구조 및 반응형 설정 */
@layer layout {
  main {
    flex: 1;
  }

  header {
    background: #111;
    padding: 1rem 2rem;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-links {
    display: flex;
    gap: 1.5rem;
  }

  .intro {
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
  }

  section {
    max-width: 960px;
    margin: auto;
    padding: 3rem 2rem;
    scroll-margin-top: 80px;
  }

  footer {
    background: #111;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #666;
    border-top: 1px solid #222;
    position: sticky;
    bottom: 0;
    z-index: 10;
  }

  .stack-logos,
  .contact-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
  }

  .stack-logos img,
  .contact-logos img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease;
  }

  .stack-logos img:hover,
  .contact-logos img:hover {
    transform: scale(1.1);
  }

  /* 모바일 레이아웃 */
  @media (max-width: 600px) {
    header {
      padding: 0.75rem 1.5rem;
    }

    section {
      scroll-margin-top: 60px;
    }

    .nav-links {
      display: none;
      flex-direction: column;
      width: 100%;
      background: #111;
      padding: 1rem 2rem;
      position: absolute;
      top: 100%;
      left: 0;
      z-index: 9;
    }

    .nav-links.open {
      display: flex;
    }

    .stack-logos img,
    .contact-logos img {
      width: 60px;
      height: 60px;
    }

    .stack-logos,
    .contact-logos {
      gap: 1.2rem;
    }
  }
}

/* ========== Components ========== */
/* 개별 요소 디자인 */
@layer components {
  .logo {
    font-size: 1.8rem;
    font-weight: bold;
  }

  .btn {
    background: linear-gradient(135deg, #7f00ff, #00bfff);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    margin: 0.5rem;
    display: inline-block;
    cursor: pointer;
  }

  .typing {
    font-family: monospace;
    font-size: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid white;
    width: fit-content;
    margin: 0 auto;
    display: inline-block;
  }

  #menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
  }

  /* 모바일에서 햄버거 메뉴 표시 */
  @media (max-width: 600px) {
    #menu-toggle {
      display: block;
    }
  }

  /* 배경 캔버스 스타일 */
  canvas#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
  }
}
