/* ===== GUSTE.DESIGN 正確版本 ===== */

:root {
  --black: #2c3e50;
  --white: #f8fdff;
  --light-blue: #e8f4f8;
  --blue: #a8d5e2;
  --dark-blue: #7bb3c7;
  --accent: #5a9fd4;
  --gray: #5a6c7d;
  --light-gray: #8fa5b2;
  --border: 2px solid var(--black);
  --border-light: 2px solid var(--dark-blue);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Lexend', -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--blue) 0%, var(--white) 100%);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== 導航列 - 整個在框框內 ===== */
.navbar {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  background: var(--light-blue);
  border: var(--border);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  height: 60px;
  backdrop-filter: blur(10px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  padding: 0 30px;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  border-right: var(--border);
  gap: 12px;
}

.navbar-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  transition: var(--transition);
}

.navbar-brand:hover .navbar-logo {
  transform: rotate(5deg) scale(1.1);
}

.navbar-menu {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  padding: 0 30px;
  position: relative;
}

.navbar-menu-list {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.navbar-menu-list a {
  color: var(--gray);
  text-decoration: none;
  font-size: 1rem;
  transition: var(--transition);
  position: relative;
}

.navbar-menu-list a:hover {
  color: var(--accent);
}

.navbar-menu-list a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.navbar-menu-list a:hover::after {
  width: 100%;
}

/* 漢堡選單 - 經典三線設計 */
.hamburger-container {
  display: none;
  padding: 0 20px;
  border-left: var(--border-light);
}

.hamburger {
  width: 24px;
  height: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  position: relative;
  padding: 3px;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--black);
  border-radius: 1px;
  transition: var(--transition);
  left: 50%;
  transform: translateX(-50%);
}

.hamburger::before {
  top: 3px;
}

.hamburger::after {
  bottom: 3px;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--black);
  border-radius: 1px;
  transition: var(--transition);
  position: relative;
}

/* 點擊動畫 */
.hamburger.active::before {
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
}

.hamburger.active span {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active::after {
  bottom: 50%;
  transform: translateX(-50%) translateY(50%) rotate(-45deg);
}

/* ===== Hero 區域 - 50vh 高度 ===== */
.hero {
  margin-top: 100px;
  height: 50vh;
  min-height: 400px;
  border: var(--border-light);
  margin-left: 20px;
  margin-right: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-blue);
  overflow: hidden;
}

.hero-content {
  text-align: center;
  z-index: 2;
  position: relative;
  pointer-events: none; /* 讓文字區域不阻擋背景點擊 */
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 20px;
  position: relative;
  color: var(--black);
  text-shadow: 
    2px 2px 0 rgba(255, 248, 230, 0.9),
    -2px -2px 0 rgba(255, 248, 230, 0.9),
    2px -2px 0 rgba(255, 248, 230, 0.9),
    -2px 2px 0 rgba(255, 248, 230, 0.9),
    3px 3px 10px rgba(123, 179, 199, 0.5);
}

.hero-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 2px;
  background: var(--black);
}

.hero-description {
  font-size: 1.25rem;
  color: var(--black);
  margin-bottom: 30px;
  font-weight: 500;
  background: rgba(255, 248, 230, 0.85);
  padding: 10px 25px;
  display: inline-block;
  border-radius: 25px;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 10px rgba(123, 179, 199, 0.2);
}

.btn-connect {
  display: inline-block;
  padding: 12px 30px;
  border: var(--border);
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  pointer-events: auto; /* 讓按鈕可以點擊 */
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.06);
  border-radius: 4px;
}

.btn-connect:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 var(--black);
}

/* Hero 背景互動區 */
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  opacity: 0.8;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 25px;
}

.hero-grid-item {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--accent);
  transition: var(--transition);
  cursor: pointer;
  min-height: 80px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(90, 159, 212, 0.2);
}

.hero-grid-item:hover {
  background: var(--dark-blue);
  border-color: var(--black);
  box-shadow: 0 4px 8px rgba(90, 159, 212, 0.4);
  transform: translateY(-2px);
}

/* ===== 專案預覽區 ===== */
.projects {
  padding: 80px 20px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  border: var(--border-light);
  background: var(--light-blue);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.project-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 var(--dark-blue);
}

.project-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-bottom: var(--border-light);
}

.project-placeholder {
  width: 100%;
  height: 250px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--dark-blue) 100%);
  border-bottom: var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--white);
  font-size: 3rem;
}

.project-placeholder::after {
  content: attr(data-text);
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--white);
  opacity: 0.8;
  text-align: center;
}

.project-info {
  padding: 20px;
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.project-description {
  color: var(--light-gray);
  font-size: 0.875rem;
}

/* ===== 關於區塊 ===== */
.about {
  padding: 80px 20px;
  background: linear-gradient(180deg, var(--light-blue) 0%, var(--blue) 100%);
}

.about-container {
  max-width: 800px;
  margin: 0 auto;
  border: var(--border-light);
  background: var(--white);
  padding: 40px;
  position: relative;
}

.about-container::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: -10px;
  bottom: -10px;
  border: var(--border-light);
  z-index: -1;
  background: var(--dark-blue);
  opacity: 0.3;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.about h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--accent);
}

/* ===== Footer ===== */
.footer {
  margin: 20px;
  border: var(--border-light);
  padding: 40px;
  background: var(--light-blue);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
}

.footer-left p {
  color: var(--gray);
  margin-bottom: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  display: block;
  width: 40px;
  height: 40px;
  border: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--gray);
  font-weight: bold;
  transition: var(--transition);
  background: var(--white);
}

.social-links a:hover {
  background: var(--dark-blue);
  color: var(--white);
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 var(--accent);
}

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
  .navbar {
    top: 10px;
    left: 10px;
    right: 10px;
    height: auto;
    min-height: 90px;
    padding: 10px 0;
  }
  
  .navbar-brand {
    padding: 0 15px;
    font-size: 1.1rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .navbar-logo {
    width: 72px;
    height: 72px;
  }
  
  .navbar-menu-list {
    display: none !important;
  }
  
  .hamburger-container {
    display: flex !important;
    align-items: center;
    padding: 0 15px;
  }
  
  /* 手機版選單 */
  .navbar-menu-list.active {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: -2px;
    right: -2px;
    background: var(--light-blue);
    border: var(--border-light);
    border-top: none;
    flex-direction: column;
    padding: 20px;
    align-items: flex-start;
    z-index: 999;
  }
  
  .navbar-menu-list.active li {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .navbar-menu-list.active a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid rgba(123, 179, 199, 0.3);
  }
  
  .hero {
    margin-left: 10px;
    margin-right: 10px;
    margin-top: 130px;
  }
  
  .hero-title::after {
    width: 300px;
  }
  
  .hero-description {
    font-size: 1rem;
    padding: 8px 16px;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  /* 行動裝置上的合成器控制和提示文字 */
  #synth-button {
    bottom: 10px !important;
    right: 10px !important;
    font-size: 0.7rem !important;
    padding: 8px 14px !important;
    min-width: 100px !important;
    min-height: 48px !important;
    touch-action: manipulation;
  }
  
  /* 移動端隱藏提示文字，避免重疊 */
  .audio-tip {
    display: none !important;
  }
  
  .hero-grid-item {
    touch-action: manipulation;
    min-height: 60px;
  }
  
  .hero-background {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    padding: 15px;
  }
}