/* ============================================================
   Indading 디자인 시스템 — 에디토리얼 매거진 컨셉
   페이지 인라인 스타일을 대체하는 공용 모듈 모음.
   토큰(색상·폰트)은 styles/theme.css에서 관리한다.
   ============================================================ */

/* ---------- 1. Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ---------- 2. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
}

/* 섹션: 헤어라인으로 구분되는 에디토리얼 블록 */
.section {
  padding-top: 88px;
  padding-bottom: 96px;
}

.section + .section,
.section.ruled {
  border-top: 1px solid var(--divider);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

/* 스택형 섹션 헤드: 아이브로우 위 + 타이틀 아래 (앱 상세용) */
.section-head.stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

/* ---------- 3. Typography ---------- */
/* 아이브로우: 짧은 악센트 라인 + 소형 대문자 라벨 */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

/* 초대형 디스플레이 타이틀 (히어로) */
.display {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

/* 중형 디스플레이 (섹션/CTA 타이틀) */
.display-sm {
  font-size: clamp(32px, 5.5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

/* 컬러 악센트: 타이틀 핵심 단어를 포인트 색상으로만 강조 */
.display em,
.display-sm em {
  font-style: normal;
  color: var(--accent);
}

/* 리드 문단 */
.lede {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 620px;
}

.lede strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* 텍스트 링크: 밑줄 + 화살표 이동 */
.text-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--divider-strong);
  padding-bottom: 3px;
  transition: color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- 4. 히어로 ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 68vh;
  padding-top: 180px;
  padding-bottom: 100px;
  gap: 28px;
}

/* 컴팩트 히어로: 목록형 페이지 상단 헤드용 */
.hero.compact {
  min-height: 0;
  padding-bottom: 28px;
}

/* 풀스크린 히어로: 랜딩처럼 히어로 단독으로 화면을 채울 때 */
.hero.full {
  min-height: calc(100vh - var(--header-height));
  justify-content: center;
  padding-top: 96px;
  padding-bottom: 96px;
}

@media (max-width: 480px) {
  /* 모바일 헤더는 2단 스택(104px) 높이 기준으로 보정 */
  .hero.full {
    min-height: calc(100vh - 104px);
  }
}

/* 히어로 바로 아래에 이어지는 섹션: 위 여백 축소, 헤어라인 없음 */
.section.flush-top {
  padding-top: 44px;
  border-top: none;
}

/* ---------- 5. 구분선 인덱스 리스트 (카드 대체) ---------- */
.index-list {
  border-top: 1px solid var(--divider);
}

.index-row {
  display: grid;
  /* 기본: 본문 | 메타 | 화살표 */
  grid-template-columns: 1fr auto 32px;
  align-items: center;
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--divider);
  text-decoration: none;
  color: inherit;
}

/* 아이콘이 있는 행 (Apps 목록) */
.index-row.has-icon {
  grid-template-columns: 56px 1fr auto 32px;
}

.index-row .row-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
}

.row-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: color 0.25s ease;
}

.row-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 6px;
  max-width: 520px;
}

.row-meta {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-align: right;
}

.row-arrow {
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.25s ease;
}

a.index-row:hover .row-title {
  color: var(--accent);
}

a.index-row:hover .row-arrow {
  transform: translateX(6px);
  color: var(--accent);
}

/* ---------- 6. 피처 행 (앱 상세: 좌측 제목 / 우측 설명) ---------- */
.feature-list {
  border-top: 1px solid var(--divider);
}

.feature-row {
  display: grid;
  /* 좌측 제목 | 우측 설명 */
  grid-template-columns: 1fr 1.4fr;
  align-items: baseline;
  gap: 28px;
  padding: 36px 0;
  border-bottom: 1px solid var(--divider);
}

/* 피처 소형 라벨: 제목 위 카테고리 표기 */
.feature-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.feature-title {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.feature-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- 7. 스펙 그리드 (소형 항목: 헤어라인 위주) ---------- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 48px;
}

.spec-item {
  border-top: 1px solid var(--divider);
  padding: 22px 0 30px;
}

.spec-item h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.spec-item p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- 8. 스크린샷 ---------- */
.shots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.shot {
  width: 320px;
  max-width: 100%;
  border-radius: 18px;
  border: 1px solid var(--divider);
  transition: transform 0.3s ease, border-color 0.3s ease;
  cursor: zoom-in;
}

.shot:hover {
  transform: translateY(-4px);
  border-color: var(--divider-strong);
}

/* 라이트박스: 스크린샷 탭/클릭 시 크게 보기 (scripts/site.js에서 생성) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
}

/* ---------- 9. 버튼 / 스토어 배지 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid var(--divider-strong);
  border-radius: 980px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: border-color 0.25s ease, color 0.25s ease,
    background 0.25s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.store-badge {
  height: 44px;
  opacity: 0.92;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.store-badge:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* ---------- 10. 앱 상세 히어로 / CTA ---------- */
.app-hero {
  padding-top: 170px;
  padding-bottom: 90px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
}

.app-hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
}

.cta {
  border-top: 1px solid var(--divider);
  padding: 110px 0 120px;
}

.cta .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
}

.legal-links {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.legal-links a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.legal-links a:hover {
  color: var(--text-secondary);
  border-bottom-color: var(--divider-strong);
}

/* ---------- 11. 페이드인 ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 접근성: 모션 최소화 선호 시 애니메이션 생략 */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 12. 반응형 ---------- */
@media (max-width: 900px) {
  .spec-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0 32px;
  }

  /* 태블릿 이하: 설명이 제목 아래로 내려오는 세로 스택 */
  .feature-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 30px 0;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 22px;
  }

  .hero {
    padding-top: 150px;
    padding-bottom: 70px;
    min-height: 0;
    gap: 22px;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 72px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 36px;
  }

  .index-row {
    grid-template-columns: 1fr 24px;
    gap: 18px;
    padding: 26px 0;
  }

  .index-row.has-icon {
    grid-template-columns: 48px 1fr 24px;
  }

  /* 모바일: 메타는 숨겨 밀도 낮춤 */
  .row-meta {
    display: none;
  }

  .index-row .row-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .app-hero {
    padding-top: 140px;
    padding-bottom: 64px;
  }

  .cta {
    padding: 80px 0 90px;
  }

  /* 모바일: 스크린샷은 2열 그리드, 탭하면 라이트박스로 확대 */
  .shots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .shot {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* 모바일 헤더가 2단 스택(100px)이 되는 만큼 여백 추가 */
  .hero {
    padding-top: 170px;
  }

  .app-hero {
    padding-top: 160px;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .legal-links {
    flex-wrap: wrap;
  }
}
