* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC",
    "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zoomable {
  cursor: zoom-in;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #0a0a0a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1000;
}

.sidebar-top h1 {
  margin: 0 0 28px;
  font-size: 1.3rem;
}

.sidebar-top nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-top nav a {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-top nav a:hover {
  color: #fff;
}

.sidebar-bottom {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* 右側內容 */
.main {
  margin-left: 240px;
  padding: 28px;
}

/* Hero */
.hero {
  position: relative;
  height: 80vh;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
}

.hero-text {
  position: absolute;
  bottom: 20px;
  left: 20px;
}

/* Grid */
.works-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.work-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.work-card.large { grid-column: span 7; }
.work-card.tall { grid-column: span 5; }
.work-card.small { grid-column: span 4; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9999;
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  width: auto;
  height: auto;
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 42px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  user-select: none;
}

/* 手機 */
@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .main {
    margin-left: 0;
  }

  .work-card {
    grid-column: span 12 !important;
  }

  .hero {
    height: 52vh;
  }
}

/* Homepage */
.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
}

.home-text {
  flex: 1;
  max-width: 560px;
}

.home-text h2 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.home-text p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1.8;
}

.home-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.home-image img {
  width: min(720px, 100%);
  max-height: 78vh;
  border-radius: 28px;
  object-fit: cover;
}

@media (max-width: 900px) {
  .home-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    min-height: auto;
  }

  .home-image {
    justify-content: flex-start;
  }

  .home-image img {
    width: 100%;
    max-height: none;
    border-radius: 22px;
  }
}