
* { margin:0; padding:0; box-sizing:border-box; }
html, body {
  width:100%;
  height:100%;
  overflow-x: hidden;
  overflow-y: hidden;
  font-family: 'Chiron GoRound TC', 'Nunito', 'sans-serif';
  background-color: #000; /* Prevent white flash */
  font-size: 16px; /* 設定基準字體大小，確保 rem 計算正確 */
}

::-webkit-scrollbar {
  width: 2rem; /* 30px → 32px */
}

::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 1rem; /* 15px → 16px */
  margin: 0 0;
  border-right: 0.5rem solid transparent; /* 10px → 8px */
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb {
  background: #fff;
  border-radius: 1rem; /* 15px → 16px */
  border: 0.5rem solid transparent; /* 3px → 8px */
  border-right-width: 0.5rem; /* 10px → 8px */
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.95);
  background-clip: padding-box;
}

/* Firefox 滾動條樣式 */
* {
  scrollbar-width: auto;
  scrollbar-color: #fff rgba(255, 255, 255, 0.3);
}

/* === 主頁面 === */
#main-page {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #ffbb56;
  color: white;
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  z-index: 75;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  scroll-behavior: smooth;
}
#main-page.active { transform: translateX(0); }

.main-content { padding-top: 0%; padding-bottom: 0%; }
.main-content h1 { font-size: 3rem; margin-bottom: 1.5rem; } /* 20px → 24px */

/* === About Me === */
.about-me {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  align-items: center;
  color: white;
}

.about-me-bg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  object-fit: cover;

  z-index: 0;
}

.about-center-block {
  text-align: justify;
  position: absolute;
  left: 10%;
  top: 50%;

  max-width: 40.5rem; /* 650px → 648px */
  z-index: 2;
}


.about-center-block h1 {
  margin: 0 0 0;
  font-size: 6rem;
}

.about-center-block p {
  padding-top: 10%;
  line-height: 1.8;
  font-size: 1rem;
  text-align: justify;
}

.about-right-block {
  width: 100%;
  margin-top: 1rem;
  padding-right: 7.5rem; /* 120px */
}

.about-right-block p {
  margin: 0;
  line-height: 1.8;
  font-size: 1rem;
  text-align: justify;
}

/* === Awards === */
.awards { 
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;

  color: white;
}

.awards-bg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  object-fit: cover;

  z-index: 0;
}

/* 文字層 */
.awards-text {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  gap: 2%;

  padding-top: 15%;
  padding-left: 10%;
}

/* 標題 */
.awards h1 {
  font-size: 6rem;
}

/* 清單 */
.awards ul {
  font-size: 1rem;
  list-style-type: disc;
  padding-left: 1.5rem; /* 20px → 24px */
}

.awards ul p {
  margin-bottom: 0.5rem; /* 10px → 8px */
}



/* === Works === */
.works { 
  position: relative;
  width: 100%;
  min-height: 100vh;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 5% 5vh 2%; 
}
 
/* === 職涯垂直跑馬燈 === */
.work-ticker {
  position: absolute;
  top: 0;
  right: 5%;
  height: 100%;
  width: 6.5rem; /* 100px → 104px */
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

.ticker-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15.5rem; /* 250px → 248px */
  animation: tickerMoveDown 25s linear infinite;
}

.ticker-inner span {
  display: inline-block;
  font-size: 5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.401);
  transform: rotate(-90deg);
  white-space: nowrap;
  letter-spacing: 0.5rem; /* 5px → 8px */
  text-transform: uppercase;
  line-height: 1;
}

@keyframes tickerMoveDown {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}

.works-info {
  position: relative;
  width: 100%; 
  max-width: 100%;
  z-index: 50;
  pointer-events: auto;
  padding-left: 5%;
  padding-right: 5%;
}

.works-right-side {
  flex: 0 0 50%;
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.works h1{
  font-size: 6rem;
  text-align: left;
  padding-left: 0; 
  margin-bottom: 2rem;
  line-height: 1; 
}

.works-content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem; /* 50px → 48px */
  width: 100%;
}

.works-list {
  flex: 0 0 40%;
  position: relative;
  padding-top: 1rem;
  padding-left: 0; 
}

.works-list::before {
  content: '';
  position: absolute;
  top: 0;
  left: 3rem; /* 50px → 48px */
  width: 0.5rem; /* 4px → 8px */
  height: 100%;
  background-color: #fff;
  opacity: 0.3;
  display: none;
}

.work-item {
  position: relative;
  margin-bottom: 5rem; /* 80px */
  padding-left: 0;
  text-align: justify;
}

.work-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 3rem; /* 50px → 48px */
  width: 1.5rem; /* 20px → 24px */
  height: 1.5rem; /* 20px → 24px */
  background-color: #fff;
  border-radius: 50%;
  transform: translateX(-50%);
  display: none;
}

.work-item h2 {
  margin-bottom: 0.5rem; /* 10px → 8px */
}

.work-item p {
  margin-bottom: 0.5rem; /* 5px → 8px */
  line-height: 1.6;
}

/* === 職涯區塊淡入動畫 === */
.works h1,
.work-item {
  opacity: 0;
  transform: translateX(-6rem); /* -100px → -96px */
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.works.fade-in h1 {
  opacity: 1;
  transform: translateX(0);
}

.works.fade-in .work-item {
  opacity: 1;
  transform: translateX(0);
}

/* work delay in */
.works.fade-in .work-item:nth-child(1) {
  transition-delay: 0.2s;
}

.works.fade-in .work-item:nth-child(2) {
  transition-delay: 0.4s;
}

.works.fade-in .work-item:nth-child(3) {
  transition-delay: 0.6s;
}

/* === About Me delay in === */
.about-center-block {
  opacity: 0;
  transform: translateX(-6rem); /* -100px → -96px */
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.about-right-block {
  opacity: 0;
  transform: translateX(-6rem); /* -100px → -96px */
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.about-me.fade-in .about-center-block {
  opacity: 1;
  transform: translateX(0);
}

.works.fade-in .about-right-block {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.8s;
}

/* === Awards delay in === */
.awards-text h1,
.awards-text ul {
  opacity: 0;
  transform: translateX(-6rem); /* -100px → -96px */
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.awards.fade-in .awards-text h1 {
  opacity: 1;
  transform: translateX(0);
}

.awards.fade-in .awards-text ul {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.3s;
}

/* === Photography delay in === */
.photography h1 {
  opacity: 0;
  transform: translateX(-6rem); /* -100px → -96px */
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.photography.fade-in h1 {
  opacity: 1;
  transform: translateX(0);
}

/* === Photography === */
.photography {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

.photography h1{
  font-size: 6rem;
  padding-left: 5%;
  padding-top: 5%;
}

/* === Contact === */
.contact-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;

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

  color: white;
  text-align: center;
}

.contact-bg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  object-fit: cover;

  z-index: 0;
}

/* 主要內容 */
.contact-content {
  position: relative;
  z-index: 2;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 標題與文字 */
.contact-section h1 {
  font-size: 3rem;
  margin-bottom: 3rem;
}

.contact-section .name {
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  padding-bottom: 3rem;
}

.contact-section .email {
  font-size: 1rem;
  margin-top: 0.5rem; /* 8px */
}

/* 社群連結 */
.social-links {
  display: flex;
  gap: 1.5rem; /* 20px → 24px */
  padding: 3rem 0;
}

.social-links a {
  color: #f4f4f4;
  width: 2.5rem; /* 40px */
  height: 2.5rem; /* 40px */

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

  border-radius: 50%;
  background: rgba(255,255,255,0.1);

  transition: color .3s ease, transform .3s ease, background .3s ease;
}

.social-links a:hover {
  color: #ffd54f;
  transform: translateY(0); /* -3px → 0px */
  background: rgba(255,255,255,0.2);
}

.social-links svg {
  width: 1.5rem; /* 20px → 24px */
  height: 1.5rem; /* 20px → 24px */
  fill: currentColor;
}

/* footer  */
.contact-footer {
  position: absolute;
  bottom: 2rem;
  width: 100%;

  text-align: center;
  font-size: 1rem;
  z-index: 2;
}


/* === 箭頭 === */
.return-arrow-projects, .project .arrow, #projects-back, .detail-content .back {
  position: absolute;
  width: 3rem; /* 50px → 48px */
  height: 5.5rem; /* 90px → 88px */
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(0.5rem); /* 10px → 8px */
  border-radius: 0.5rem; /* 8px */
  transition: background 0.3s ease, transform 0.3s ease;
}

/* === Menu Toggle Button === */
.menu-btn {
  position: fixed;
  top: 2rem; /* 30px → 32px */
  right: 2rem; /* 30px → 32px */
  width: 4rem; /* 60px → 64px */
  height: 4rem; /* 60px → 64px */
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(0.5rem); /* 10px → 8px */
  -webkit-backdrop-filter: blur(0.5rem); /* 10px → 8px */
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 0.5rem solid rgba(255, 255, 255, 0.2); /* 1px → 8px */
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.burger {
  width: 2rem; /* 25px → 24px */
  height: 1.5rem; /* 3條線(0.5×3) + 2個間隔(1×2) = 3.5rem */
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger span {
  display: block;
  width: 100%;
  height: 0.2rem; /* 2px → 2.4px */
  background: white;
  border-radius: 0.5rem; /* 2px → 2.4px */
  transition: all 0.3s ease;
}

/* Open State for Burger */
.menu-btn.open .burger span:nth-child(1) {
  transform: translateY(0.65rem) rotate(45deg); /* 移動到中心 */
}
.menu-btn.open .burger span:nth-child(2) {
  opacity: 0;
  transform: translateX(-0.5rem); /* -10px → -8px */
}
.menu-btn.open .burger span:nth-child(3) {
  transform: translateY(-0.65rem) rotate(-45deg); /* 移動到中心 */
}

/* === Navigation Overlay === */
.nav-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(1rem); /* 15px → 16px */
  -webkit-backdrop-filter: blur(1rem); /* 15px → 16px */
  z-index: 900;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

.nav-content ul {
  list-style: none;
  text-align: center;
  padding: 0;
}

.nav-content li {
  margin: 1.5rem 0; /* 25px → 24px */
  overflow: hidden;
}

.nav-link {
  display: inline-block;
  color: white;
  text-decoration: none;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.5rem; /* 4px → 8px */
  transition: all 0.4s ease;
  transform: translateY(100%);
  opacity: 0;
}

.nav-overlay.open .nav-link {
  transform: translateY(0);
  opacity: 1;
}

/* Stagger animation for links */
.nav-overlay.open li:nth-child(1) .nav-link { transition-delay: 0.1s; }
.nav-overlay.open li:nth-child(2) .nav-link { transition-delay: 0.2s; }
.nav-overlay.open li:nth-child(3) .nav-link { transition-delay: 0.3s; }
.nav-overlay.open li:nth-child(4) .nav-link { transition-delay: 0.4s; }
.nav-overlay.open li:nth-child(5) .nav-link { transition-delay: 0.5s; }
.nav-overlay.open li:nth-child(6) .nav-link { transition-delay: 0.6s; }
.nav-overlay.open li:nth-child(8) .nav-link { transition-delay: 0.7s; }

.nav-link:hover {
  letter-spacing: 1rem; /* 12px → 16px */
  color: #ffbb56;
}

.separator {
  width: 2.5rem; /* 40px */
  height: 0.5rem; /* 2px → 8px */
  background: rgba(255, 255, 255, 0.3);
  margin: 2.5rem auto !important; /* 40px */
  transform: scaleX(0);
  transition: transform 0.6s ease 0.6s;
}

.nav-overlay.open .separator {
  transform: scaleX(1);
}

.projects-link {
  font-size: 2rem;
  color: #ffbb56;
}

.projects-link:hover {
  color: white;
}

.project .arrow {
  bottom: 1.5rem; /* 20px → 24px */
  right: 0;
  border-top-left-radius: 0.5rem; /* 8px */
  border-bottom-left-radius: 0.5rem; /* 8px */
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.project .arrow:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-0.5rem); /* -5px → -8px */
}

#projects-back {
  bottom: 1.5rem; /* 20px → 24px */
  left: 0;
  z-index: 60;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0.5rem; /* 8px */
  border-bottom-right-radius: 0.5rem; /* 8px */
}

#projects-back:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(0.5rem); /* 5px → 8px */
}

.detail-content .back {
  bottom: 1.5rem; /* 20px → 24px */
  left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0.5rem; /* 8px */
  border-bottom-right-radius: 0.5rem; /* 8px */
  z-index: 200; /* Ensure it stays above scrolling content */
}

.detail-content .back:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(0.5rem); /* 5px → 8px */
}

.project .arrow span,
#projects-back span,
.detail-content .back span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem; /* 30px → 32px */
  height: 2rem; /* 30px → 32px */
  border: 0 solid #fff; /* 基礎設為 0，由各別設定 */
  transform: translate(-50%, -50%) rotate(45deg);
  transition: transform 0.3s ease;
}

.project .arrow span {
  left: 35%;
  border-top-width: 0.2rem; /* 3px → 3.2px */
  border-right-width: 0.2rem; /* 3px → 3.2px */
}

#projects-back span,
.detail-content .back span {
  left: 65%;
  border-bottom-width: 0.2rem; /* 3px → 3.2px */
  border-left-width: 0.2rem; /* 3px → 3.2px */
}

.project .arrow:hover span {
  transform: translate(-55%, -50%) rotate(45deg);
}

#projects-back:hover span,
.detail-content .back:hover span {
  transform: translate(-45%, -50%) rotate(45deg);
}

/* === Projects 容器 === */
#projects {
  position: fixed; top:0; left:0; width:100%; height:100%;
  overflow: hidden; transition: transform 0.5s ease; z-index: 50;
}
#projects.detail-open { transform: translateX(-100%); }
#projects.main-open { transform: translateX(100%); }

.project {
  position: absolute; top:0; left:0; width:100%; height:100%;
  display: flex; justify-content: flex-start; align-items: flex-start;
  transition: transform 0.7s ease; color: white; overflow: hidden;
}

.project .overlay { width:100%; height:100%; padding:5%; position:relative; }

.project .content h1 { position:absolute; top:5%; left:5%; font-size:4rem; }
.project .content p { position:absolute; top:12%; left:5%; font-size:2rem; max-width:50%; padding-top:3rem; }

.project .center_content {
  position: absolute; top: 50%; left: 45%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 1.5rem; font-size: 2rem; /* 20px → 24px, 30px → 32px */
}
.project .center_block { background: rgba(255,255,255,0.1); padding: 0.5rem 1.5rem; border-radius: 0.5rem; } /* 10px → 8px, 20px → 24px, 8px */

.project .right_content {
  position: absolute; bottom: 6.5rem; left: 45%; width: 40%; /* 100px → 104px */
  max-height: 35vh; overflow-y: auto; line-height: 2;
}
.project .right-block { font-size: 1rem; text-align: justify; } /* 20px → 24px */

/* === 進度條 === */
#progress-bar {
  position: fixed; right: 2%; width: 2rem; height: 12.5rem; /* 30px → 32px, 200px */
  background: rgba(255,255,255,0.3); border-radius: 1rem; /* 15px → 16px */
  z-index: 60; transition: top 0.5s ease;
}
#progress-bar::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 100%;
  background: #fff; border-radius: 1rem; transition: height 0.3s ease; /* 15px → 16px */
}

/* === 詳細頁 === */
.detail {
  position: fixed; top:0; left:0; width:100%; height:100%;
  overflow: hidden; transform: translateX(100%);
  transition: transform 0.5s ease; z-index: 100;
}
.detail.active { transform: translateX(0); }

.detail-scroll {
  height:100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding:5%;
  scroll-behavior: smooth;
}
.detail-content { 
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.long-section { height:125rem; background: rgba(255,255,255,0.1); margin:2.5rem 0; } /* 2000px, 40px */

/* === 詳細頁排版優化 === */
.project-description {
  position: relative;
  width: 100%;
  max-width: 56.5rem; /* 900px → 904px */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  padding: 0.5rem 0; /* 10px → 8px */
  box-shadow: none;
  text-align: left;
}

/* 專案大標題 (description 內) */
.project-title {
  text-align: left;
  margin-bottom: 3rem;
}

.project-title h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 0.5rem 0.5rem rgba(0,0,0,0.1); /* 4px → 8px, 10px → 8px */
  letter-spacing: 0; /* 2px → 0px */
}

.project-title h2 {
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.9;
  letter-spacing: 0; /* 1px → 0px */
}

/* 內容標題 */
.project-description h1 {
  font-size: 5rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.project-description h1::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.5rem; /* -8px */
  width: 100%;
  height: 0.5rem; /* 4px → 8px */
  /* background: rgba(255,255,255,0.8); */
  border-radius: 0.5rem; /* 2px → 8px */
}

.project-description h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  padding-left: 1rem; /* 15px → 16px */
  border-left: 0.5rem solid #fff; /* 5px → 8px */
}

/* 內文 & 自定義標籤 */
.project-description p {
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
  text-align: justify;
  opacity: 0.95;
  letter-spacing: 0; /* 0.5px → 0px */
}

.project-description p1 {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #fff;
  border-bottom: 0.5rem dashed rgba(255,255,255,0.5); /* 1px → 8px */
  padding-bottom: 0.5rem; /* 5px → 8px */
  width: fit-content;
}

/* 列表優化 */
.project-description ul {
  padding-left: 1.5rem; /* 20px → 24px */
  margin-bottom: 2rem;
}

.project-description li {
  position: relative;
  font-size: 1rem;
  line-height: 1.8;
  padding-left: 0.5rem; /* 5px → 8px */
  margin-bottom: 1rem;
}

/* 圖片樣式 */
.project-image img, .qrcode img{ 
  width: 100%; 
  height: auto; 
  object-fit: cover; 
  border-radius: 1rem; /* 16px */
  display: block; 
  margin: 2.5rem 0; /* 40px */
  box-shadow: 0 0.5rem 2rem rgba(0,0,0,0.15); /* 10px → 8px, 30px → 32px */
  transition: transform 0.4s ease;
}

.project-image img:hover {
  transform: scale(1.02);
}

.qrcode img { width: 12.5rem; margin: 1.5rem auto; } /* 200px, 20px → 24px */



/* === Footer === */
footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 1.5rem; /* 20px → 24px */
  background: transparent;
  color: #a8a8a8;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0; /* 1px → 0px */
}

/* === 手機版 RWD === */
@media (max-width: 768px) {
  :root { --vh: 1vh; }
  html, body, #projects, .detail { 
    height: calc(var(--vh, 1vh) * 100); 
    overflow-x: hidden;
  }
  
  #main-page {
    height: calc(var(--vh, 1vh) * 100); 
    overflow: hidden !important;
    touch-action: none; /* Prevent native scrolling/zooming interference */
  }

  .main-content { padding: 0; }

  /* 確保每個 Section 都能 100% 顯示於畫面並置中 */
  #main-page section, 
  .about-me, .awards, .works, .skills-section, .main-projects, .photography, .contact-section {
    min-height: calc(var(--vh, 1vh) * 100) !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 5rem 8% 2.5rem !important; /* 80px → 80px, 40px */
    box-sizing: border-box !important;
    position: relative !important;
    overflow-y: visible !important;
  }

  /* 標題與內文自動縮放 */
  h1 { 
    font-size: 2.5rem !important; 
    margin-bottom: 1.2rem !important; /* 20px → 24px */
    width: 100%;
    word-break: break-all;
  }
  p, li, .work-item p, .about-right-block p { 
    font-size: 1rem !important; 
    line-height: 1.2 !important;
    text-align: justify !important;
  }

  /* --- About Me 手機版 --- */
  .about-me { justify-content: center !important; }
  .about-center-block {
    padding-top: 50%;
    position: static !important;
    max-width: 100% !important;
    transform: none !important;
    text-align: justify !important;
    margin-bottom: 2rem !important; /* 30px → 32px */
  }
  
  .about-right-block {
    position: static !important;
    max-width: 100% !important;
    transform: none !important;
    padding: 0 !important;
    text-align: justify !important;
    margin-bottom: 2rem !important; /* 30px → 32px */
  }
  .about-center-block p { padding-top: 1rem !important; line-height: 1.5 !important; font-size: .8rem !important; } /* 15px → 16px */
  .work-ticker { display: none !important; }
  .project-tags { display: none !important; }

  /* --- Awards 手機版 --- */
  .awards { justify-content: flex-start !important; padding-top: 50% !important; }
  .awards-text {
    flex-direction: column !important;
    padding: 0 !important;
    gap: 0 !important;
    text-align: justify !important;
  }
  .awards ul { padding: 0 !important; list-style: none !important; }
  .awards ul p { margin-bottom: 0.5rem !important; font-size: .8rem !important; } /* 8px, 0.75rem → 1rem */

  /* --- Career (Works) 手機版 --- */
  .works { 
    justify-content: center !important; 
    padding: 0 8% !important; /* Reduce top/bottom padding to optimize space */
  }
  .works h1 { text-align: left !important; margin-bottom: 0.5rem !important; } /* 10px → 8px */
  .works-info { width: 100% !important; max-width: 100% !important; }
  .works-content-wrapper {
    flex-direction: column !important;
    gap: 0.5rem !important; /* 5px → 8px - Minimize gap */
    width: 100% !important;
  }
  .works-list { padding: 0 !important; width: 100% !important; }
  .work-item { margin-bottom: 0.5rem !important; text-align: justify !important; } /* 10px → 8px */
  .work-item h2 { font-size: clamp(1rem, 2.2vh, 1.2rem) !important; margin-bottom: 0 !important; } /* 2px → 0px */
  .work-item p { font-size: clamp(0.75rem, 1.8vh, 0.9rem) !important; margin-bottom: 0 !important; line-height: 1.4 !important; } /* 2px → 0px */
  .about-right-block { margin-top: 0.5rem !important; } /* 5px → 8px */
  .about-right-block p { font-size: 0.9rem !important; line-height: 1.5 !important; }

  /* --- Skills 手機版 --- */
  .skills-grid { justify-content: flex-start !important; gap: 0.5rem !important; width: 100% !important; } /* 10px → 8px */
  .skill-tag { padding: 0.5rem 1.5rem !important; font-size: 1rem !important; } /* 10px → 8px, 20px → 24px, 0.9rem → 1rem */
  .logo-carousel { margin-top: 1.5rem !important; } /* 20px → 24px */
  .logo-track img { width: 3rem !important; height: 3rem !important; } /* 45px → 48px */
  
  /* --- Main Projects Entrance --- */
  .main-projects { 
    background-image: none !important; 
    background-color: #ffbb56 !important; 
    align-items: center !important; 
    flex-direction: column !important;
    justify-content: center !important;
  }
  
  .main-projects-visual {
    display: block !important;
    width: 100% !important;
    height: 50vh !important;
    order: -1 !important; /* Move to top */
    margin-left: 0 !important;
    margin-bottom: 1.5rem !important; /* 20px → 24px */
  }
  
  .project-tags {
     display: none !important;
  }
  .main-projects-info { text-align: left !important; }
  .main-projects-info h1 { text-align: center !important; } /* 2px → 0px */  
  .main-projects-link p { font-size: 1rem !important; margin-bottom: 2rem !important; opacity: 0.9; } /* 30px → 32px */
  .projects-entrance-btn { 
    font-size: 1.5rem !important; 
    padding: 1rem 2rem !important; /* 15px → 16px, 30px → 32px */
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  /* --- Photography 手機版 --- */
  .photography { justify-content: flex-start !important; padding-top: 50% !important; }
  .photography h1 { padding-left: 0 !important; padding-top: 0 !important; margin-bottom: 0 !important; }
  .horizontal-gallery { height: 40vh !important; padding-top: 0 !important; margin-top: -12.5rem !important; } /* -200px */
  .track img { height: 35vh !important; }

  /* --- Contact 手機版 --- */
  .contact-section { gap: 2rem !important; padding-bottom: 5rem !important; } /* 30px → 32px, 80px */
  .social-links { padding: 1.5rem 0 !important; } /* 20px → 24px */

  /* --- 專案列表 (Project List View) --- */
  .project .overlay { padding: 6.5rem 8% 2.5rem !important; display: flex !important; flex-direction: column !important; justify-content: flex-start !important; } /* 100px → 104px, 40px */
  .project .content h1 { font-size: 2rem !important; position: static !important; margin-bottom: 1rem !important; letter-spacing: 0 !important; } /* 2.2rem → 2.5rem, 15px → 16px, 1px → 0px */
  .project .content p { font-size: 1rem !important; position: static !important; padding: 0 !important; margin: 0.5rem 0 1.5rem !important; text-align: left !important; } /* 1.1rem → 1rem, 10px → 8px, 20px → 24px */
  .project .center_content { position: static !important; transform: none !important; font-size: 1rem !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 0.5rem !important; margin-bottom: 2.5rem !important; } /* 18px → 16px, 10px → 8px, 40px */
  .project .right_content { position: static !important; width: 100% !important; max-height: 35vh !important; }
  .project .right-block { font-size: 1rem !important; text-align: justify !important; } /* 0.95rem → 1rem */

  /* 專案詳細 */
  .detail-scroll { padding: 12%; }
  .project-title { padding-bottom: -2rem !important; }
  .project-description p{ font-size: 1rem !important; line-height: 1.5rem !important; }
  .project-description li { font-size: 1rem !important; line-height: 1.5rem !important;}
  .project-description .project-image .loaded { border-radius: 0.5rem !important; }

  /* --- UI 改進 --- */
  #progress-bar { width: 0.5rem !important; height: 6.5rem !important; right: 1rem !important; } /* 6px → 8px, 100px → 104px, 15px → 16px */
  .menu-btn { top: 1.5rem !important; right: 1.5rem !important; width: 3rem !important; height: 3rem !important; } /* 20px → 24px, 45px → 48px */
  .nav-link { font-size: 2rem !important; } /* 1.8rem → 2rem */
  .projects-link { font-size: 1.5rem !important; } /* 1.4rem → 1.5rem */
  .nav-content li { text-align: center !important; }
  .burger { width: 1rem !important; height: 1rem !important; } /* 30px → 32px, 45px → 48px */
  
  /* Mobile Burger Open State Centering */
  .menu-btn.open .burger span:nth-child(1) { transform: translateY(0.4rem) rotate(45deg); }
  .menu-btn.open .burger span:nth-child(3) { transform: translateY(-0.4rem) rotate(-45deg); }

  /* 天空元件縮放 */
  .sun { width: 2.5rem !important; height: 2.5rem !important; } /* 40px */
  .moon { width: 4rem !important; height: 4rem !important; } /* 60px → 64px */
  .moon::after { display: none; }

  /* Back Icon Mobile Size */
  .return-arrow-projects, .project .arrow, #projects-back, .detail-content .back {
    width: 2.5rem !important; /* 40px */
    height: 4rem !important; /* 60px → 64px */
  }
  
  .return-arrow-projects span, .project .arrow span, #projects-back span, .detail-content .back span {
    width: 1.5rem !important; /* 20px → 24px */
    height: 1.5rem !important; /* 20px → 24px */
  }
}

/* === 圖片載入優化 === */
img {
  transition: opacity 0.6s ease;
}
img[data-src] {
  opacity: 0;
}
img.loaded {
  opacity: 1;
}

/* === 下雨效果 === */
.rain-lines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 80;
}
.rain-lines .raindrop {
  position: absolute;
  top: -6.5rem; /* -100px → -104px */
  width: 0.02rem; /* 2px → 8px */
  background: rgba(255, 255, 255, 0.6);
  animation-name: rainFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes rainFall {
  0% { transform: translateY(-6.5rem); opacity: 0; } /* -100px → -104px */
  50% { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* === Horizontal Gallery === */
/* Container */
.horizontal-gallery {
  width: 100%;
  height: 70vh;
  display: flex;
  align-items: center;
}

/* Horizontal Track */
.track {
  display: flex;
  gap: 2.5rem; /* 40px */
  will-change: transform;
  padding-left: 2.5rem; /* 40px */
}

/* Photos */
.track img {
  height: 60vh; /* Adjusted to fit nicely */
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.4s ease;
  border-radius: 0.5rem; /* 8px */
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* === Skills Section (Independent) === */
.skills-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  color: white;
  padding: 0 5%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.skills-section h1 {
  font-size: 6rem;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateX(-6rem); /* -100px → -96px */
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.skills-section.fade-in h1 {
  opacity: 1;
  transform: translateX(0);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem; /* 20px → 24px */
  max-width: 75rem; /* 1200px */
}

.skill-tag {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(0.5rem); /* 5px → 8px */
  padding: 1rem 2rem; /* 15px → 16px, 30px → 32px */
  border-radius: 3rem; /* 50px → 48px */
  font-size: 1.5rem;
  font-weight: 500;
  border: 0.3rem solid rgba(255, 255, 255, 0.2); /* 1px → 8px */
  opacity: 0;
  transform: translateY(1.5rem); /* 20px → 24px */
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.skills-section.fade-in .skill-tag {
  opacity: 1;
  transform: translateY(0);
}

.skills-section.fade-in .skill-tag:nth-child(n) {
  transition-delay: calc(0.1s * var(--i));
}

/* === Logo Carousel inside Skills === */
.logo-carousel {
  width: 100%;
  overflow: hidden;
  padding: 2.5rem 0; /* 40px */
  margin-top: 1.5rem; /* 20px → 24px */
}

.logo-track {
  display: flex;
  gap: 2rem; /* 30px → 32px */
  will-change: transform;
}

.logo-track img {
  width: 6.5rem; /* 100px → 104px */
  height: 6.5rem; /* 100px → 104px */
  object-fit: contain;
  filter: none;
  opacity: 1;
  transition: all 0.3s ease;
}

.logo-track img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.2);
}

/* 共用背景 class */
.section-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Main Projects 區塊 */
.main-projects {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: flex-start;
  align-items: center;     /* 文字垂直置中 */
  padding: 0 10%;
  color: white;
  overflow: hidden;
}

/* 霧面遮罩 */
.main-projects::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3); /* 半透明黑色底 */
  backdrop-filter: blur(0.5rem);     /* 8px - 模糊濾鏡 */
  -webkit-backdrop-filter: blur(0.5rem); /* 8px */
  z-index: 1;
}

/* 文字層級 */
.main-projects-info {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateX(-6rem); /* -100px → -96px */
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.main-projects.fade-in .main-projects-info {
  opacity: 1;
  transform: translateX(0);
}

/* 標題 */
.main-projects-info h1 {
  font-size: 6rem;
  margin-bottom: 2rem;
}

/* 按鈕 */
.projects-entrance-btn {
  display: inline-block;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  padding: 1.5rem 3rem; /* 20px → 24px, 50px → 48px */
  border: 0.5rem solid #fff; /* 2px → 8px */
  border-radius: 3rem; /* 50px → 48px */
  letter-spacing: 0.5rem; /* 4px → 8px */
  transition: all 0.4s ease;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(0.5rem); /* 10px → 8px */
}

.projects-entrance-btn:hover {
  background: #fff;
  color: #ffbb56;
  box-shadow: 0 0 2rem rgba(255, 255, 255, 0.4); /* 30px → 32px */
}


/* 右側滿版圖片區塊 */
.main-projects-visual {
  height: 70vh;
  width: 35%; 
  position: relative;
  /* padding-left: 30%; Removed user hack */
  margin-left: auto; /* Push to the right */
  z-index: 2; /* Ensure it is above the matte overlay */
  opacity: 0;
  transform: translateX(6.5rem); /* 100px → 104px */
  transition: opacity 1.5s ease, transform 1.5s ease;
  overflow: hidden;
}

.main-projects.fade-in .main-projects-visual {
  opacity: 1;
  transform: translateX(0);
}

.main-projects-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 右上角的標籤 */
.project-tags {
  position: absolute;
  top: 5vh;
  right: 10%;
  z-index: 5;
  display: flex;
  gap: 2.5rem; /* 40px */
  font-size: 1.5rem;
  letter-spacing: 0; /* 2px → 0px */
  font-weight: 500;
  opacity: 0;
  transform: translateY(-1.5rem); /* -20px → -24px */
  transition: opacity 1.5s ease, transform 1.5s ease;
  font-size: 1rem;
}

.main-projects.fade-in .project-tags {
  opacity: 1;
  transform: translateY(0);
}


@media (max-width: 1400px) {
  .skill-title { font-size: 4rem; top: 10vh; }
  .text-layer { top: calc(10vh + 5rem); } /* 80px */
}


/* === Loading Screen === */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .6s ease, visibility .6s ease;
}

#loading-screen.hide {
  opacity: 0;
  visibility: hidden;
}

/* 簡約 loading 動畫 */
.loader span {
  color: #fff;
  font-size: 1.5rem;
  letter-spacing: 0.5rem; /* 4px → 8px */
  animation: blink 1.4s infinite both;
}

@keyframes blink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

/* 預設先隱藏整個網站 */
body.loading {
  overflow: hidden;
}

/* body.loading .main-content,
body.loading #projects,
body.loading .detail {
  opacity: 0;
} */
