/* ========== HERO ========== */
.hero {
  position: relative;
  width: 100%;
  height: 720px;
  overflow: hidden;
  background-color: #5a5448;
}

/* --- Hero Slider --- */
.hero-track {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 800ms ease;
  display: block;
  cursor: default;
  z-index: 1;
}
.hero-slide[href] {
  cursor: pointer;
}
.hero-slide.prev {
  opacity: 1;
  z-index: 1;
  transition: none;
}
.hero-slide.active {
  opacity: 1;
  z-index: 2;
}
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition:
    opacity 200ms ease,
    background 200ms ease;
}
.hero-nav:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.45);
}
.hero-prev {
  left: 24px;
}
.hero-next {
  right: 24px;
}
.hero-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
  transition:
    width 240ms ease,
    background 240ms ease,
    border-radius 240ms ease;
}
.hero-dot.active {
  background: #fff;
  width: 24px;
  border-radius: 4px;
}
/* single-slide: hide nav + dots */
.hero-slider.single .hero-nav,
.hero-slider.single .hero-dots {
  display: none;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  /* L3: 상시 darkness 완화 (0.35 → 0.22). 텍스트 가독성은 h1/p text-shadow로 보상. */
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 0, 0, 0.06) 60%,
    transparent 100%
  );
}
.hero-text {
  position: absolute;
  bottom: 35%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
  z-index: 2;
}
.hero-text h1 {
  font-size: var(--font-size-hero);
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 12px;
  overflow-wrap: break-word;
  word-break: keep-all;
  /* overlay 완화 보상 — 밝은 배경 슬라이드에서도 텍스트 가독성 유지 */
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.hero-text p {
  font-size: var(--font-size-base);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
  letter-spacing: 1px;
  overflow-wrap: break-word;
  word-break: keep-all;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* ========== IMAGE GRID (3 columns) ========== */
.image-grid {
  padding: var(--section-padding) 0;
}
.image-grid .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}
.image-grid .grid-item {
  overflow: hidden;
  aspect-ratio: 5/6;
}
.image-grid .grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.image-grid .grid-item:hover img {
  transform: scale(1.03);
}

/* ========== ABOUT SECTION ========== */
.about-section {
  text-align: center;
  padding-bottom: var(--section-padding);
}
.about-section h2 {
  font-size: var(--font-size-xl);
  font-weight: 300;
  color: var(--color-brand-beige);
  letter-spacing: var(--letter-spacing-heading);
  margin-bottom: 20px;
}
.about-section .about-text {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  line-height: 1.8;
  margin-bottom: 32px;
}
.about-section .btn-primary {
  margin-top: 8px;
}

/* ========== FILTER TABS ========== */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px 0 40px;
}
.filter-tabs button {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--color-text-light);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.filter-tabs button.active {
  color: var(--color-text-heading);
  border-bottom-color: var(--color-text-heading);
}

/* ========== PROJECT SECTION (Portfolio Grid) ========== */
.project-section {
  padding: var(--section-padding) 0;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-width: 1220px;
  margin: 48px auto 0;
  padding: 0;
}
.project-grid.office-grid {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}
.office-grid .office-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.office-grid .project-card {
  aspect-ratio: auto;
  margin-bottom: 0;
}
.office-grid .project-card .img-after {
  height: auto;
}
.project-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  cursor: pointer;
}
.project-card .img-after {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-card .img-before {
  display: none;
}
.project-card .project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.project-card:hover .project-overlay {
  opacity: 1;
}
.project-overlay .project-name {
  font-size: 20px;
  color: #fff;
  letter-spacing: 2px;
  font-weight: 400;
}
.project-more {
  display: none;
}

/* "…" pagination button (home + portfolio): 2x10 initial, +2x5 per click */
.project-more-btn {
  display: block;
  margin: 48px auto 96px;
  padding: 14px 56px;
  background: transparent;
  border: 1px solid #d9d4c7;
  border-radius: 999px;
  color: var(--color-text-heading);
  font-size: 26px;
  letter-spacing: 6px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.project-more-btn:hover {
  background: var(--color-brand-grey);
  color: #fff;
  border-color: var(--color-brand-grey);
}

/* ========== BRAND FILM + CTA ========== */
.brandfilm-section {
  background: var(--color-bg-cream);
}
.brandfilm-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.brandfilm-media {
  display: flex;
  flex-direction: column;
}
.brandfilm-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.brandfilm-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.brandfilm-element {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brandfilm-player {
  cursor: pointer;
}
.brandfilm-player::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.18), transparent 34%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.brandfilm-player.controls-visible::after {
  opacity: 1;
}
.brandfilm-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}
.brandfilm-player.controls-visible .brandfilm-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.brandfilm-control {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 160ms ease;
}
.brandfilm-control:hover {
  background: rgba(255, 255, 255, 0.16);
}
.brandfilm-control svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brandfilm-control svg path:not(.sound-wave):not(.sound-x),
.brandfilm-control svg .play-shape,
.brandfilm-control svg .pause-shape path {
  fill: currentColor;
  stroke: none;
}
.brandfilm-player.is-loaded .brandfilm-control {
  display: inline-flex;
}
.brandfilm-play-toggle.is-playing .play-shape,
.brandfilm-play-toggle:not(.is-playing) .pause-shape,
.brandfilm-sound-toggle.is-muted .sound-wave,
.brandfilm-sound-toggle:not(.is-muted) .sound-x {
  display: none;
}
.brandfilm-player.is-mobile-muted .brandfilm-sound-toggle {
  display: none;
}
.brandfilm-caption {
  margin-top: 16px;
  font-family: var(--font-en), var(--font-kr);
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--color-text-light);
}
.brandfilm-copy {
  padding-left: 8px;
}
.brandfilm-lead {
  font-size: var(--font-size-xl);
  font-weight: 300;
  color: var(--color-text-heading);
  line-height: 1.5;
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.brandfilm-desc {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  line-height: 1.8;
  margin-bottom: 36px;
}
.brandfilm-cta {
  display: inline-block;
}

@media (max-width: 991px) {
  .brandfilm-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .brandfilm-copy {
    padding-left: 0;
    text-align: center;
  }
}
@media (max-width: 767px) {
  .brandfilm-lead {
    font-size: var(--font-size-lg);
  }
  .brandfilm-lead br,
  .brandfilm-desc br {
    display: none;
  }
}

/* ========== PROJECT MODAL (Grid Gallery) ========== */
.project-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 300;
  overflow-y: auto;
}
.project-modal-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 50px 20px;
}
.project-modal {
  max-width: 520px;
  width: 100%;
  background: #f0ece5;
  border-radius: 6px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.project-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  background: #f0ece5;
  z-index: 1;
}
.project-modal-header h2 {
  font-size: 14px;
  color: var(--color-text-heading);
  font-weight: 400;
  letter-spacing: 0.5px;
}
.project-modal-close {
  font-size: 22px;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.project-modal-close:hover {
  color: var(--color-text-heading);
}
.project-modal-grid {
  columns: 4;
  column-gap: 3px;
  padding: 8px 12px 20px;
}
.project-modal-grid img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 3px;
  break-inside: avoid;
  cursor: pointer;
}
@media (max-width: 767px) {
  .project-modal-grid {
    columns: 3;
  }
}

/* ========== LIGHTBOX 뷰어 ========== */
#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 400;
}
#lightbox.open {
  display: block;
}
.lb-counter {
  position: absolute;
  top: 16px;
  left: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  z-index: 2;
}
.lb-toolbar {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.lb-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 10px;
  transition: color 0.2s;
}
.lb-btn:hover {
  color: #fff;
}
.lb-btn:disabled {
  color: rgba(255, 255, 255, 0.2);
  cursor: default;
}
.lb-close {
  font-size: 28px;
}
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 32px;
  cursor: pointer;
  padding: 20px;
  z-index: 2;
  transition: color 0.2s;
}
.lb-arrow:hover {
  color: #fff;
}
.lb-prev {
  left: 8px;
}
.lb-next {
  right: 8px;
}
.lb-img-wrap {
  position: absolute;
  top: 50px;
  left: 80px;
  right: 80px;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.lb-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s;
  user-select: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
  .hero-text {
    bottom: 25%;
    padding: 0 20px;
  }
  .image-grid .container {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .hero {
    min-height: 500px;
  }
  .hero-text {
    bottom: 20%;
  }
  .image-grid .container {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}
