/* Reset 基本樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  :root {
    --mouseX: 0;
    --mouseY: 0;
    --BGcolor: #0f0f0f;
    --Maincolor: #c9c9c9;
    --primary-color: rgb(207, 6, 6);
    /* Navbar animation settings */
    --nav-duration: 420ms;
    --nav-ease: cubic-bezier(.2,.9,.2,1);
    /* Logotype set */
    --filter-normal: blur(0px) invert(95%);
    --filter-hover: blur(5px) invert(100%);
  }

  body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--BGcolor);
    color: var(--Maincolor);
    line-height: 1;
    margin: 0;
    transition: all 400ms ease;
    cursor: none;
  }

  .mouse {
    position: fixed;
    left: var(--mouseX);
    top: var(--mouseY);
    width: 3px;
    height: 3px;
    border-radius: 100%;
    background-color: var(--Maincolor);
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: 1px double var(--BGcolor);
    z-index: 999;
    transition: all 10ms ease-out, background-color 10ms linear;
}

.ghost {
  position: fixed;
  opacity: 0.6;
    left: var(--mouseX);
    top: var(--mouseY);
    transition: all 500ms ease-out, background-color 10ms linear; 
    transform: translate(-50%, -50%);
    pointer-events: none;
    overflow: visible;
    width: 2rem;
    height: auto;
}

.ghost svg {
  fill: var(--Maincolor);
  stroke: var(--BGcolor);
  stroke-width: 0px;
  stroke-linecap: round;
  width: 2rem;
  height: auto;
}


::selection {
  background: var(--Maincolor);
  color: var(--BGcolor);
  }
  ::-moz-selection {
    background: var(--Maincolor);
    color: var(--BGcolor);
  }
  img::selection {
  background: transparent;
  }
  img::-moz-selection {
  background: transparent;
  }

  /* NAVBAR 共用樣式 */
.navbar {
  position: fixed;
  overflow: hidden;
  pointer-events: none;
    transition: width var(--nav-duration) var(--nav-ease),
                height var(--nav-duration) var(--nav-ease),
                border-radius var(--nav-duration) var(--nav-ease),
                padding var(--nav-duration) var(--nav-ease),
                top var(--nav-duration) var(--nav-ease),
                right var(--nav-duration) var(--nav-ease),
                left var(--nav-duration) var(--nav-ease),
                box-shadow var(--nav-duration) var(--nav-ease);
  transform-origin: top right; /* 右上角展開來源 */
  will-change: width, height, border-radius, transform, top, right, left;
  z-index: 1000;
}

/* === 桌面版 === */
.NavbarContainer {
  color: var(--Maincolor);
  display: flex;
  min-height: 100vh;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.namecard {
  position: fixed;
  left: 16px;
  top: 20dvh;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  pointer-events: auto;
  width: auto;
}

.logo {
  width: 72dvw;
  pointer-events: auto;
  cursor: pointer;
}

.logo svg {
  fill: var(--Maincolor)
}

.lang-switch {
  position: fixed;
  left: 45dvw;
  top: 20dvh;
  font-size: 0.8rem;
  margin: 0.5rem 0 2rem;
  font-weight: 700;
  bottom: auto;
  pointer-events: auto; 
}

.lang-switch span {
  cursor: pointer;
  transition: all 0.3s ease;
}

#lang-toggle span.active {
  font-weight: 900;
}

.lang-switch a,.lang-switch a:visited {
  color: var(--Maincolor);
}

.lang-switch a:hover {
    font-family: 'Libre Caslon Display', 'Noto Serif TC';
    font-weight: 900;
}

.lang-switch svg {
   fill: var(--Maincolor);
}



.intro {
  position: fixed;
  left: 16px;
  top: 25dvh;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
  pointer-events: auto;
}

.intro h3 {
  font-size: 1.4rem;
  font-weight: 400;
  margin: 0rem;
}

.intro p {
  margin-top: 1.4rem;
  font-size: 0.8rem;
  margin: 0.4rem 0 ;
  width: 20dvw;
  line-height: 1.5;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: absolute;
  width: 30dvw;
  left: 16px;
  text-align: left;
  bottom: 12dvh;
}

.sidebar h3 {
  margin: 1.5rem 0 0.2rem 0;
  font-size: 0.7rem;
  font-weight: 600;
  pointer-events: auto;
  
}

.sidebar p {
  font-size: 0.7rem;
  font-weight: 300;
  line-height: 1.5;
  pointer-events: auto;
  
}

.navbar button {
  all: unset;              /* 移除 button 的預設樣式 */
  font: inherit;           /* 字體樣式跟父層一致 */
  color: var(--Maincolor); /* 可以配合你的 dark/light 變數 */
  transition: letter-spacing 0.3s ease-in-out; /* 平滑動畫 */
}

.navbar button:hover {
  font-weight: 900;
  font-family: 'Libre Caslon Display', 'Noto Serif TC';
}

.contact {
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
  width: 10dvw;
  font-size: 0.7rem;
  justify-self: start;
  text-align: left;
}

.ProjectList  {
  position: fixed;
  left: 52dvw;
  top: 60dvh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  font-size: 0.7rem;
  pointer-events: auto;
  transition: all 1s ease;
  text-align: left;
  line-height: 1.1;
}

.ProjectList .unhover {
  opacity: 0.1;
}

/* 你原本的 hover */
.ProjectList li:hover {
  font-family: 'Libre Caslon Display', 'Noto Serif TC';
  font-weight: 900;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

/* 給 JS 用的 class，效果跟 :hover 一樣 */
.ProjectList li.hover {
  font-family: 'Libre Caslon Display', 'Noto Serif TC';
  font-weight: 900;
  font-size: 0.8rem;
}

.ProjectList li.active {
  font-family: 'Libre Caslon Display', 'Noto Serif TC';
  font-weight: 900;
  text-decoration: underline;
  font-size: 0.8rem;
}


.project-list li.active {
  font-family: 'Libre Caslon Display', 'Noto Serif TC';
  font-weight: 900;
  text-decoration: underline;
  font-size: 0.8rem;
}

.social-icons {
  position: relative;
  display: flex;
  justify-content: start;
  left: 0px;
  width: auto;
  min-width: 10rem;
  margin-bottom: 4px;
  pointer-events: auto;
}

.social-icons a{
  width: auto;
  margin: 0 1rem 0 0;
  pointer-events: auto;
}

.social-icons svg{
  position: relative;
  height: 100%;
  width: 1rem;
  fill: var(--Maincolor);
}

.social-icons svg:hover{
  fill: var(--primary-color)
}

footer {
  margin: 5rem;
}

footer:hover {
  color: var(--primary-color);
}

/* === 手機版 === */
@media (max-width: 768px) {
  .navbar {
    position: fixed;
    top: 0;
    pointer-events: none;
    z-index: 1000;
  }

  .NavbarContainer {
    pointer-events: none;
    flex-direction: column;
    justify-self: center;
    width: 100dvw;
    padding: 8px;
    margin: 0;
  }

  .namecard {
  position: fixed;
  left: 8px;
  top: 10dvh;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  width: 5rem;
  text-align: left;
}

  .logo {
    position: fixed;
    width: calc(100dvw - 16px);
  }

  .lang-switch {
    position: fixed;
    display: flex;
    flex-direction: row;
    height: auto;
    top: auto;
    bottom: 10dvh;
    left: 8px;
    text-align: center;
    z-index: 10;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
  }

  .intro {
    width: auto;
    position: absolute;
    left: 20dvw;
    top: 10dvh;
    right: 16px;
    text-align: left;
    margin: 0;
    padding: 0;
  }

  .intro h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0rem;
  }

  .intro p {
    position: relative;
    margin-top: 1.4rem;
    font-size: 0.8rem;
    width: auto;
    margin: 0.4rem 0 ;
    line-height: 1.2;
    word-spacing:normal;
    letter-spacing: normal;
    text-overflow : ellipsis;
    text-wrap: pretty;
    word-break: break-word;
  }

  .sidebar {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 25dvh;
    bottom: auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 0.7rem 1rem;
    line-height: 1.2;
  }

  .sidebar h3 {
    margin: 0rem 0;
    font-weight: 600;
  }

  .favorites,
  .skills,
  .awards {
    margin-bottom: 0;
  }

  .awards {
    grid-column: span 2;
  }

  .awards p {
    font-size: 0.8rem;
  }

  .ProjectList {
   position: fixed;
   left: 24px;
   top: 60dvh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  font-size: 0.7rem;
  }

.contact {
    position: fixed;
    display: flex;
    bottom: 1dvh;
    left: 8px;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 1.5rem;
  }
}

/* 模糊效果樣式 */
.blur {
    filter: blur(6px);
  }

  /* 滾動條的整體樣式 */
::-webkit-scrollbar {
  width: 0.8vw;  /* 設置滾動條的寬度 */
  display: none;
}

/* 滾動條軌道 */
::-webkit-scrollbar-track {
  background: var(--BGcolor);  /* 設置軌道的背景色 */
  border-radius: 5px;  /* 設置軌道的圓角 */
  transition: all 0.5s ease;
}

/* 滾動條滑塊 */
::-webkit-scrollbar-thumb {
  background: var(--Maincolor);  /* 設置滑塊的背景色 */
  border-radius: 5px;  /* 設置滑塊的圓角 */
  border: 2px solid #ffffff;  /* 設置滑塊的邊框，與軌道背景色相同 */
  transition: all 0.5s ease;
}

/* 滾動條滑塊在懸停時的樣式 */
::-webkit-scrollbar-thumb:hover {
  background: #777777;  /* 設置滑塊在懸停時的背景色 */
}

/* 滾動條滑塊在活動時的樣式 */
::-webkit-scrollbar-thumb:active {
  background: #777777;  /* 設置滑塊在活動時的背景色 */
}

