/* ===== 전역 ===== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #fff;
  color: #111;
}

/* ===== 섹션 1: 히어로 ===== */
.MainBack {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* 어두운 오버레이 — 마퀴 위에 살짝 깔아 텍스트 가독성 확보 */
.MainBack::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

/* ===== 마퀴 전체 영역: 히어로 100vh를 꽉 채움 ===== */
.photo-marquee-area {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 0; /* 텍스트·오버레이보다 뒤 */
}
/* 마퀴 한 줄: 각 줄이 50vh씩 차지 */
.photo-marquee-row {
  height: 25vh; /* 4줄로 100vh를 균등 분할 */
  display: flex;
  width: max-content;
  animation: marqueeLeft 40s linear infinite;
}
/* 2번 줄: 반대 방향으로 흐름 */
.photo-marquee-row--reverse {
  animation-direction: reverse;
}
/* 트랙: 사진 박스들을 가로로 나열 */
.photo-marquee-track {
  display: flex;
  gap: 14px;
  padding-right: 14px;
}
/* 사진 박스: 16:9 비율로 고정해 세로 짤림 최소화, 줄 안에서 세로 중앙 정렬 */
.photo-marquee-card {
  width: 240px;
  height: 150px; /* 16:9 근사 → 대부분 사진이 자연스럽게 들어옴 */
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0.8;
  align-self: center; /* 50vh 행 안에서 세로 중앙 */
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.photo-marquee-card:hover {
  opacity: 1;
  transform: translateY(-6px);
}

/* 왼쪽으로 흐르는 애니메이션 */
@keyframes marqueeLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* 히어로 텍스트: 마퀴 위에 absolute로 화면 정중앙 배치 */
.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  color: #fff;
  white-space: nowrap;
}
.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}
.hero-title {
  margin: 0 0 1.2rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 400; /* Bebas Neue는 단일 웨이트라 400으로 */
  line-height: 0.95;
  letter-spacing: 0.03em;
}
.hero-title span { color: #fff; }
.hero-sub {
  margin: 0;
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.06em;
}

/* 스크롤 힌트 */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
}
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.45), transparent);
  animation: lineDown 1.6s ease-in-out infinite;
}
@keyframes lineDown {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ===== 비하인드 스토리 섹션 ===== */
.story-wrap {
  max-width: 900px;
  margin: 0 auto;
}
/* 스토리 항목 목록 */
.story-entries {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.story-entry {
  padding: 3rem 0;
  border-top: 1px solid #e0e0e0;
}
.story-entry:last-child {
  border-bottom: 1px solid #e0e0e0;
}
/* 에피소드 태그 */
.story-entry-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #aaa;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}
.story-entry-title {
  margin: 0 0 1.2rem;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
}
/* 본문(좌) + 사진(우) 2단 배치 */
.story-entry-content {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}
.story-entry-body {
  margin: 0;
  flex: 1;               /* 남는 가로 공간을 본문이 차지 */
  min-width: 0;          /* flex 항목이 내용 때문에 넘치지 않도록 */
  font-size: 1rem;
  color: #444;
  line-height: 2;
  max-width: 760px;
  white-space: pre-wrap; /* 줄바꿈 그대로 반영 */
}
/* 사진 자리: img에 src가 없어도 회색 박스 + 안내 문구가 대신 보인다.
   안내 문구는 ::after(z-index 0)로 뒤에 깔고 img를 그 위(z-index 1)에 올려서,
   나중에 src를 채우면 사진이 문구를 자연스럽게 가리도록 했다 (JS 감지 로직 불필요) */
.story-entry-photo {
  position: relative;
  flex: 0 0 300px;       /* 사진 칸 고정 폭 */
  aspect-ratio: 4 / 3;
  background: #f2f2f2;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}
.story-entry-photo::after {
  content: "사진을 넣어주세요";
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #bbb;
  letter-spacing: 0.05em;
}
.story-entry-image {
  position: relative;
  z-index: 1;            /* 안내 문구 위에 사진을 올린다 */
  width: 100%;
  height: 100%;
  object-fit: cover;     /* 사진 비율이 달라도 칸을 꽉 채우도록 */
  display: block;
}

/* ===== 기술 스택 섹션 ===== */
.tech-wrap {
  max-width: 1100px;
  margin: 0 auto;
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
.tech-item {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 1.5rem 1.8rem;
  display: flex;
  flex-direction: row;   /* 아이콘(좌) + 텍스트(우) 가로 배치 */
  align-items: center;
  gap: 1.2rem;
  transition: border-color 0.3s, background 0.3s;
}
.tech-item:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
}
/* devicon <i> 태그 공통 크기 */
.tech-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
  width: 2.6rem;
  text-align: center;
  /* devicon colored가 없는 아이콘(express 등)은 흰색으로 */
  color: #fff;
}
/* img 태그 아이콘 (OpenAI, Claude 등 devicon 미지원 브랜드) */
.tech-icon--img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
}
.tech-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.tech-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.tech-role {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
}

/* ===== 타임라인 섹션 ===== */
.timeline-wrap {
  max-width: 800px;
  margin: 0 auto;
}
.timeline {
  margin-top: 3rem;
  position: relative;
  padding-left: 2rem;
}
/* 세로 선 */
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e0e0e0;
}
.timeline-item {
  position: relative;
  padding: 0 0 3rem 2.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -0.45rem;
  top: 0.3rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #111;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #111;
}
.tl-date {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: #aaa;
  font-weight: 600;
}
.tl-content h3 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.tl-content p {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
}
/* 타임라인 bullet 목록 */
.tl-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tl-bullets li {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  padding-left: 1.1rem;
  position: relative;
}
.tl-bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: #aaa;
  font-weight: 700;
}

/* ===== 로드맵 섹션 ===== */
.plan-wrap {
  max-width: 800px;
  margin: 0 auto;
}
.plan-list {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.plan-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
}
.plan-status {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  min-width: 60px;
  text-align: center;
}
.plan-status--done { background: #2ecc71; color: #fff; }
.plan-status--wip  { background: #f39c12; color: #fff; }
.plan-status--todo { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.6); }
.plan-text {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
}

/* ===== 섹션 2·3: 좌우 분할 ===== */
.content-section {
  padding: 120px 8vw;
  background: #fff;
}
.content-section--dark {
  background: #111;
  color: #fff;
}
.content-section--dark .section-desc { color: rgba(255,255,255,0.6); }
.content-section--dark .section-label { color: #fff; }

.split-wrap {
  display: flex;
  align-items: center;
  gap: 6vw;
  max-width: 1200px;
  margin: 0 auto;
}
.split-wrap--reverse { flex-direction: row-reverse; }

.split-img {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  height: 420px;        /* 컨테이너 높이 고정 — 패럴랙스 시 이미지가 삐져나오지 않도록 */
}
.split-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  will-change: transform; /* 패럴랙스 GPU 가속 */
  transform: scale(1.08); /* 초기 여유 공간 확보 (패럴랙스 이동폭만큼) */
}

.split-text {
  flex: 1;
}

/* ===== 섹션 4: 센터 ===== */
.content-section--center {
  background: #f5f5f5;
  text-align: center;
  padding: 160px 8vw;
}
.center-block { max-width: 640px; margin: 0 auto; }

/* ===== 공통 텍스트 ===== */
.section-label {
  margin: 0 0 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: #111;
  font-weight: 700;
}
h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
}
.section-desc {
  margin: 0 0 2rem;
  font-size: 1rem;
  color: #555;
  line-height: 1.7;
}
.cta-btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border: 2px solid #111;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: background 0.3s, color 0.3s;
}
.cta-btn:hover { background: #111; color: #fff; }

/* ===== 스크롤 애니메이션 ===== */
/* 초기 상태: 숨김 */
.reveal {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal[data-dir="left"]  { transform: translateX(-50px); }
.reveal[data-dir="right"] { transform: translateX(50px); }
.reveal[data-dir="up"]    { transform: translateY(50px); }

/* 뷰포트 진입 시: 보임 */
.reveal.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* 히어로 자체 페이드업 */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* hero-content는 translate(-50%,-50%) 중앙 정렬 사용 중이라
   fade-up의 transform이 덮어쓰지 않도록 별도로 정의 */
.hero-content.fade-up {
  transform: translate(-50%, calc(-50% + 30px));
}
.hero-content.fade-up.visible {
  transform: translate(-50%, -50%);
}

/* ===== 모바일 반응형 ===== */
@media (max-width: 768px) {
  /* --- 히어로 마퀴: 카드 크기 축소, 줄당 높이 유지하되 카드 비율 조정 --- */
  .photo-marquee-card {
    width: 240px;          /* 모바일 마퀴 카드 크기 확대 */
    height: 160px;
  }
  /* 마퀴 흐름 속도 빠르게(좁은 화면에선 같은 거리라도 답답해 보임) */
  .photo-marquee-row {
    animation-duration: 25s;
  }

  /* --- 히어로 텍스트: 줄바꿈 허용, 좌우 여백 확보 --- */
  .hero-content {
    white-space: normal;
    width: 90%;
  }
  .hero-eyebrow {
    letter-spacing: 0.2em;
    font-size: 0.7rem;
  }

  /* --- 공통 섹션 패딩 축소 --- */
  .content-section {
    padding: 70px 6vw;
  }
  .content-section--center {
    padding: 80px 6vw;
  }

  /* --- 좌우 분할 → 세로 단일 컬럼 (reverse도 동일하게 이미지 위) --- */
  .split-wrap,
  .split-wrap--reverse {
    flex-direction: column;
    gap: 2rem;
  }
  .split-img {
    width: 100%;
    height: 240px;         /* 모바일에서 이미지 높이 축소 */
  }

  /* --- 기술 스택: 3열 → 2열, 카드 크기 축소해서 한 눈에 보이도록 --- */
  .tech-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 1.5rem;
  }
  .tech-item {
    padding: 1rem;
    gap: 0.5rem;
    flex-direction: column; /* 모바일: 아이콘 위 + 텍스트 아래 */
    align-items: center;   /* 아이콘·텍스트 가운데 정렬 */
    text-align: center;
  }
  .tech-icon {
    font-size: 1.8rem;
    width: auto;
  }
  .tech-icon--img {
    width: 1.8rem;
    height: 1.8rem;
  }
  .tech-name {
    font-size: 0.95rem;
  }
  .tech-role {
    font-size: 0.7rem;
  }

  /* --- 비하인드 스토리: 챕터 번호와 날짜 한 줄 유지 --- */
  .story-entry-date {
    display: inline; /* 날짜를 챕터 번호와 같은 줄에 표시 */
    white-space: nowrap; /* 날짜 중간 줄바꿈 방지 */
  }

  /* --- 비하인드 스토리: 항목 패딩 축소, 제목 크기 다운 --- */
  .story-entry {
    padding: 2rem 0;
  }
  .story-entry-title {
    font-size: 1.2rem;
  }
  .story-entry-body {
    font-size: 0.95rem;
    line-height: 1.8;
  }
  /* --- 비하인드 스토리: 본문 옆 사진 → 본문 아래로 세로 배치 --- */
  .story-entry-content {
    flex-direction: column;
    gap: 1.2rem;
  }
  .story-entry-photo {
    flex: none;
    width: 100%;         /* 모바일에선 사진이 가로 전체를 사용 */
  }

  /* --- 타임라인: 좌측 들여쓰기 축소, 글씨 줄여서 줄바꿈 최소화 --- */
  .timeline {
    padding-left: 1rem;
    margin-top: 2rem;
  }
  .timeline-item {
    padding: 0 0 2.2rem 1.8rem;
  }
  .tl-content h3 {
    font-size: 0.95rem;
  }
  .tl-bullets li {
    font-size: 0.82rem;
  }

  /* --- 로드맵: 상태 뱃지 위, 텍스트 아래로 세로 배치 --- */
  .plan-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 1rem 1.2rem;
  }
  .plan-text {
    font-size: 0.95rem;
  }
}
