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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #ffffff;
  color: #333333;
  line-height: 1.6;
  font-size: 16px;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* Header Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-bottom: 1px solid #f0f0f0;
  z-index: 1000;
  padding: 20px 40px;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  width: 40px;
  height: 40px;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: #A1A1A1;
  font-size: 16px;
  transition: color 0.3s ease;
}

.nav-links a.active {
  color: #000000;
}

.nav-links a:hover {
  color: #666666;
}

/* Main Content */
.main-content {
  margin-top: 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 40px;
  position: relative;
}

.hero {
  position: relative;
  overflow: hidden; /* 讓飄動圖片維持在區塊內 */
}

/* 飄動 PNG */
.floating-img {
  position: absolute;
  width: 480px; /* 你可以改大小 */
  top: 0;
  left: 0;
  opacity: 0.8; /* 建議淡淡的比較不搶戲 */
  pointer-events: none;
  user-select: none;
  transform: translate(0, 0);
  z-index: 1; /* 在 Hej! 文字下方，作為底色 */
}

.hero-background-image {
  position: absolute;
  top: 0;
  right: 40px;
  width: 458px;
  height: 363px;
  z-index: 0;
  object-fit: contain;
}

/* Hero Section */
.hero {
  padding: 64px 0 40px 0;
  position: relative;
  z-index: 1;
  border-radius: 12px;
}

.hero-content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  position: relative;
  z-index: 2;
}

.hero-text-content {
  position: relative;
  z-index: 2;
}

.hero-hej {
  font-size: 120px;
  font-weight: 700;
  color: #ffffff;
  opacity: 0.5;
  line-height: 1;
  position: relative;
  z-index: 2; /* 在 floating-img 上方 */
  pointer-events: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 200px; /* 確保有足夠高度 */
}

.hero h1,
.page-title {
  font-size: 48px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 0;
  line-height: 1.2;
}

.hero h1 {
  color: #AAAAAA;
}

.hero .subtitle {
  font-size: 48px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 30px;
}

.hero .description {
  font-size: 1.1rem;
  color: #555555;
  max-width: 600px;
  line-height: 1.7;
}

/* Section Titles */
.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #808080;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 80px 0 40px 0;
}

/* Featured Projects */
.featured-projects {
  margin-bottom: 80px;
}

.project {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 80px;
}

.project:last-child {
  margin-bottom: 0;
}

.project-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 15px;
  display: block;
}

.project-text h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 15px;
}

.project-text p {
  font-size: 1rem;
  color: #555555;
  margin-bottom: 15px;
  line-height: 1.6;
}

.project-tags {
  display: inline;
  color: #AAAAAA;
  font-size: 0.95rem;
}

.project-tag {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
}

.project-tag + .project-tag::before {
  content: " \2022 "; /* bullet */
  margin: 0 6px;
  color: inherit;
}

.project-link {
  display: block;
  color: inherit;
  margin-bottom: 80px;
}

.project-image {
  overflow: hidden; /* 防止圖片放大時超出容器 */
  display: block; /* 確保容器穩定 */
  width: 100%;
  height: 100%;
  position: relative;
}

.project-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #EBEEF5;
  z-index: 0;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 確保圖片填充方式一致 */
  display: block; /* 移除 inline 元素的額外空間 */
  transition: transform 0.3s ease; /* 平滑過渡效果 */
  transform-origin: center center; /* 從中心點放大 */
  will-change: transform; /* 優化動畫性能 */
  position: relative;
  z-index: 1;
}

.project-link:hover .project-image img {
  transform: scale(1.1); /* hover 時放大 10% */
}

/* Side Projects */
.side-projects {
  margin-bottom: 80px;
}

.side-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.side-card {
  overflow: hidden;
  transition: transform 0.3s ease;
}

.side-card:hover {
  transform: translateY(-2px);
}

.side-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top;
}

.side-card-video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Coming Soon Styles */
.side-card.coming-soon {
  cursor: default;
  pointer-events: none;
}

.side-card.coming-soon:hover {
  transform: none;
}

.side-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.side-card-image-wrapper img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top;
  display: block;
}

.coming-soon-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.coming-soon-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333333;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.side-card-content {
  padding: 20px;
}

.side-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 10px;
}

.side-card p {
  font-size: 0.9rem;
  color: #555555;
  margin-bottom: 10px;
  line-height: 1.5;
}

.side-card .tag {
  font-size: 0.8rem;
  color: #888888;
}

/* Footer */
.footer {
  background-color: #f8f8f8;
  padding: 60px 40px 40px 40px;
  margin-top: 100px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.footer-left h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 10px;
}

.footer-left p {
  color: #555555;
  margin-bottom: 20px;
}

.footer-left .copyright {
  font-size: 0.9rem;
  color: #888888;
}

.footer-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.footer-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 8px;
}

.footer-section a {
  color: #333333;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: #666666;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content {
    padding: 0 30px;
  }

  .hero-hej {
    font-size: 100px;
  }

  .hero h1,
  .hero .subtitle,
  .page-title {
    font-size: 40px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 15px 20px;
  }

  .nav-container {
    flex-direction: column;
    gap: 15px;
  }

  .nav-links {
    gap: 20px;
  }

  .main-content {
    margin-top: 120px;
    padding: 0 20px;
  }

  .hero {
    padding: 40px 0 80px 0;
  }

  .hero-content-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-hej {
    font-size: 80px;
    order: -1;
    margin-bottom: 20px;
    min-height: 150px;
  }

  .floating-img {
    width: 288px; /* 480px * 60% = 288px */
  }

  .hero h1,
  .hero .subtitle,
  .page-title {
    font-size: 32px;
  }

  .project {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .side-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-right {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 480px) {
  .hero-hej {
    font-size: 60px;
    min-height: 120px;
  }

  .hero h1,
  .hero .subtitle,
  .page-title {
    font-size: 28px;
  }

  .project-text h3 {
    font-size: 1.2rem;
  }
}
