/*--------------------------------------------------------------
# 메인 페이지 (index.html) — 통이미지 대신 HTML 텍스트 + 분리한 사진/배경
--------------------------------------------------------------*/

/* 1. 히어로 */
.home.bc-section {
  min-height: max(560px, 51vw);
  background: #03030f url("../img/home/hero-bg.webp") right center / cover no-repeat;
  color: #fff;
}

.home.bc-section h1 {
  font-size: clamp(34px, 4.4vw, 68px);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.home.bc-section p {
  max-width: 640px;
  margin: 28px 0 0;
  font-size: clamp(15px, 1.2vw, 19px);
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 899px) {
  .home.bc-section {
    min-height: 100svh;
    align-items: flex-end;
    padding-bottom: 18vh;
    background-position: 62% center;
  }

  .home.bc-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(3, 3, 15, 0.92) 30%, rgba(3, 3, 15, 0.1));
  }

  .home.bc-section .container {
    position: relative;
  }
}

/* 2. CODE로 재미있게 만들자
   원래 디자인 비율: 사진은 화면 폭의 42%(오른쪽 끝까지), 가로:세로 = 1.13,
   왼쪽 위 설명문과 왼쪽 아래 제목이 사진 위·아래 끝에 맞춰 붙는다. */
.home-second.bc-section {
  --code-photo-w: 42vw;
  --code-photo-h: calc(var(--code-photo-w) / 1.13);
  position: relative;
  min-height: 0;
  display: block;
  padding: clamp(80px, 10.9vw, 190px) 0;
  background: #fff;
  color: var(--bc-text);
  overflow: hidden;
}

.code-grid {
  display: block;
}

.code-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* 사진 + 세로 CODE 글자 자리를 빼고 남는 폭 */
  width: calc(100% - var(--code-photo-w) - var(--code-photo-h) / 3.1 * 0.8 + (100vw - 100%) / 2 - 24px);
  min-height: var(--code-photo-h);
}

.code-copy .bc-lead {
  font-size: clamp(17px, 1.6vw, 26px);
  font-weight: 500;
  line-height: 1.6;
}

.code-copy .bc-title {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 80px);
  font-weight: 600;
}

/* 세로 가운데 정렬은 transform 대신 top/bottom + margin:auto로 (AOS 애니메이션이 transform을 덮어씀) */
.code-visual {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--code-photo-w);
  height: var(--code-photo-h);
  margin: auto 0;
}

.code-visual::before {
  content: "CODE";
  position: absolute;
  left: 0;
  bottom: 0;
  transform: translateX(-100%) rotate(180deg);
  writing-mode: vertical-rl;
  /* 세로 CODE 글자가 사진 높이만큼 차도록 */
  font-size: calc(var(--code-photo-h) / 3.1);
  font-weight: 700;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px #d9d9d9;
}

.code-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px 0 0 24px;
}

@media (max-width: 899px) {
  .code-copy {
    width: auto;
    min-height: 0;
    gap: 40px;
  }

  .code-visual {
    position: relative;
    top: auto;
    bottom: auto;
    width: auto;
    height: auto;
    margin: 40px calc(50% - 50vw) 0 0;
  }

  .code-visual img {
    aspect-ratio: 1.13;
  }

  .code-visual::before {
    display: none;
  }
}

/* 3. 핵심역량 */
.home-third.bc-section {
  min-height: 0;
  display: block;
  padding: clamp(80px, 8vw, 130px) 0 clamp(140px, 16vw, 260px);
  background:
    url("../img/home/ability-top.webp") center top / 100% auto no-repeat,
    url("../img/home/ability-bottom.webp") center bottom / 100% auto no-repeat,
    var(--bc-navy);
  color: #fff;
  text-align: center;
}

.ability-intro {
  margin: 0 0 clamp(120px, 12vw, 230px);
  font-size: clamp(22px, 2.3vw, 36px);
  font-weight: 500;
  line-height: 1.5;
}

.ability-intro .bc-blue {
  color: #4d8bff;
}

.home-third .bc-eyebrow {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.home-third .bc-title .bc-blue {
  color: #4d8bff;
}

.home-third .bc-lead {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.service-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 6%;
  row-gap: 40px;
  max-width: 1080px;
  margin: 72px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

/* 지그재그: 오른쪽 카드를 아래로 (AOS가 transform을 쓰므로 top으로 민다) */
.service-list li:nth-child(even) {
  position: relative;
  top: clamp(80px, 15vw, 230px);
}

.service-list img {
  display: block;
  width: 100%;
  aspect-ratio: 900 / 585;
  object-fit: cover;
  border-radius: 12px;
}

.service-name {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 22px;
}

.service-name i {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fff;
  font-size: 22px;
  color: var(--bc-blue);
}

.service-name h3 {
  margin: 0 0 4px;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 600;
  color: #fff;
}

.service-name p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 767px) {
  .service-list {
    grid-template-columns: 1fr;
  }

  .service-list li:nth-child(even) {
    top: 0;
  }
}

@media (min-width: 768px) {
  /* 지그재그 배치 때문에 마지막 카드가 아래로 밀린 만큼 여백 */
  .service-list {
    padding-bottom: clamp(80px, 15vw, 230px);
  }
}

/* 4. 파트너사 */
.home-fourth.bc-section {
  min-height: 0;
  display: block;
  padding: clamp(80px, 9vw, 140px) 0;
  background: linear-gradient(135deg, #ebebee, #f7f7f8 45%, #ececef);
  color: var(--bc-text);
  text-align: center;
}
