/* ══════════════════════════════════════════
   UnoWorship — 예배 자막 랜딩 (jitter.video 구조 클론)
   ══════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --ink: #19171c;
  --muted: #8a868f;
  --line: #ececef;
  --accent: #6c4bff;      /* 예배용 퍼플 액센트 (더미 브랜드 컬러) */
  --accent-2: #ff5da2;
  --radius: 18px;
  --maxw: 1160px;
  --font: "Inter", "Noto Sans KR", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  /* 한 인터랙션 = 한 화면. 고정 헤더 높이만큼 스냅 위치 보정 */
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--topbar-h, 96px);
}

/* 각 인터랙션 섹션이 뷰포트 높이를 채우도록 */
.screen {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-snap-align: start;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── 공용 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 20px;
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--lg { font-size: 19px; padding: 16px 29px; }

/* ── 스크롤 리빌 ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
}
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ══ 인터랙션 1 · 공지 바 + 내비 ══ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: -.4px;
}
.nav__mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.nav__links { display: flex; gap: 26px; font-size: 15px; color: #4a4650; }
.nav__links a:hover { color: var(--ink); }
.nav__mobile-login, .nav__toggle { display: none; }
.nav__actions { display: flex; align-items: center; gap: 18px; }
.nav__login { font-size: 15px; font-weight: 500; }
@media (max-width: 720px) {
  .nav { position: relative; padding: 12px 20px; }
  .nav__actions { display: none; }
  .nav__toggle {
    display: flex;
    width: 44px;
    height: 44px;
    padding: 11px 9px;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }
  .nav__toggle:hover, .nav__toggle:focus-visible { background: #f1f0f3; }
  .nav__toggle span { width: 23px; height: 2px; border-radius: 2px; background: currentColor; }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 12px 20px 20px;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(25,23,28,.1);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { display: block; padding: 13px 4px; }
  .nav__links a + a { border-top: 1px solid var(--line); }
  .nav__mobile-login { display: block; }
}

/* ══ 인터랙션 2 · 히어로 ══ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
/* 히어로 상단 얇은 pill 배지 (jitter "Superagents" 스타일) */
.hero__pill {
  align-self: center;            /* flex 늘어남 방지 → 내용 폭에 맞춤 */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 8px 16px;
  border-radius: 999px;          /* 얇은 알약형 (레디우스 많이) */
  background: #f1f0f3;
  font-size: 14px;
  color: #4a4650;
  white-space: nowrap;
  transition: background .2s ease;
}
.hero__pill:hover { background: #e9e8ec; }
.hero__pill-label { font-weight: 700; color: var(--ink); }
.hero__pill-link { color: var(--accent); font-weight: 600; }

.hero__title {
  font-weight: 800;
  font-size: clamp(44px, 8vw, 82px);
  line-height: 1.35;             /* 줄 간격 키움 */
  letter-spacing: -.03em;
}
.hero__accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .btn { margin-top: 34px; align-self: center; }  /* flex 늘어남 방지 → 글자 폭에 맞춤 */
.hero__proof {
  margin-top: 26px;
  color: var(--muted);
  font-size: 15px;
}

/* ══ 인터랙션 3 · 템플릿 마퀴 ══ */
.marquee {
  padding: 20px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee__row { display: flex; width: max-content; }
.marquee__track {
  display: flex;
  gap: 36px;                     /* 개별 박스 간 간격 2배 */
  padding-right: 36px;
}
.marquee__row--left .marquee__track  { animation: scroll-left 62s linear infinite; }
.marquee__row--right .marquee__track { animation: scroll-right 68s linear infinite; }
@keyframes scroll-left  { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes scroll-right { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none !important; }
}

/* 템플릿 카드 (더미) — jitter "The Stack: Sale" 프레임 스타일
   · 외곽 박스: 배경 #f2f1f3, radius 40px(비율 유지)
   · 내부 프리뷰: 4:5 세로, 넉넉한 여백으로 가운데 배치
   · 메타: 원형 아바타 + 제목 + 작성자 (프리뷰보다 바깥쪽 정렬) */
.card {
  width: 463px;                  /* 397 × 7/6 (실측 Jitter ≈ 460) */
  flex: 0 0 auto;
  background: #f2f1f3;            /* 외곽 박스 배경색 */
  border-radius: 41px;           /* 외곽 박스 라운드 (그대로 주목) */
  padding-bottom: 39px;
  overflow: hidden;
}
.card__thumb-wrap {
  padding: 79px 104px 24px;      /* 내부 박스 여백 충분히 (× 7/6) */
}
.card__thumb {
  position: relative;
  aspect-ratio: 4 / 5;           /* 세로형 프리뷰 (사이즈 그대로) */
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.16);
}
.card__thumb::after {
  content: "더미 · DUMMY";
  position: absolute;
  top: 10px; left: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  padding: 3px 7px; border-radius: 6px;
  background: rgba(0,0,0,.28); backdrop-filter: blur(4px);
}
.card__label {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.02em;
  text-align: center;
  padding: 0 18px;
  text-shadow: 0 2px 14px rgba(0,0,0,.25);
}
.card__open {
  position: absolute;
  bottom: 14px; right: 14px;
  font-size: 15px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: var(--ink);
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .2s;
}
.card:hover .card__open { opacity: 1; transform: none; }

.card__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 35px 0;           /* 메타는 프리뷰보다 작은 인셋 */
}
.card__avatar {
  width: 51px; height: 51px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 20px;
}
.card__meta-text { display: flex; flex-direction: column; min-width: 0; }
.card__title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.card__author { font-size: 17px; color: var(--muted); margin-top: 2px; }

/* ══ 인터랙션 4 · 미션 스테이트먼트 ══ */
.statement {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
.statement__text {
  font-size: clamp(24px, 3.4vw, 38px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -.02em;
}
/* 타이핑 리빌: 각 단어가 회색 → 검정으로 순차 전환 */
.statement__text .word {
  color: #d0ced5;                 /* 시작: 연한 회색 */
  transition: color .3s ease;
}
.statement__text.typed .word {
  color: var(--ink);              /* 진입 시: 검정 (단어별 delay 로 타이핑 웨이브) */
}
@media (prefers-reduced-motion: reduce) {
  .statement__text .word { transition: none; }
  .statement__text.typed .word { color: var(--ink); }
}

/* ══ 인터랙션 5 · 기능 인트로 ══ */
.feature-intro {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
  margin-bottom: 20px;
}
.feature-intro__title {
  font-weight: 800;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1;
  letter-spacing: -.03em;
}
.feature-intro__sub {
  margin: 26px auto 0;
  max-width: 640px;
  font-size: 18px;
  color: #4a4650;
  line-height: 1.6;
}

/* ══ 인터랙션 6 · 기능 카드 (3장 포스터 스택 자동 교체) ══ */
.feature-card { padding: 0 24px; }
.fcard {
  align-self: center;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  background: #eeedf1;             /* 외곽 카드 (연회색) */
  border-radius: 32px;
  padding: 48px 48px 44px;
}
.fcard__pill {
  display: inline-block;
  background: var(--ink);          /* 검정 pill 라벨 */
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.01em;
  padding: 5px 11px;
  border-radius: 8px;
}
.fcard__desc {
  margin-top: 20px;
  max-width: 470px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}
/* 포스터 무대 — 3장 겹쳐 쌓기 */
.fcard__stage {
  position: relative;
  height: 400px;
  margin-top: 40px;
  border-radius: 20px;
  background: rgba(255,255,255,.5);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.poster {
  grid-area: 1 / 1;               /* 같은 칸에 겹쳐 쌓기 → place-items:center 로 중앙 정렬 */
  position: relative;            /* 배지 기준점 */
  width: 230px;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  padding: 18px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(150deg, var(--g1), var(--g2));
  color: #fff;
  box-shadow: 0 24px 44px rgba(0,0,0,.24);
  /* 위치는 바로 슬라이드, z(앞뒤)는 이동 시작 직후(.1s) 스텝 전환
     → 센터가 왼쪽으로 움직이자마자 오른쪽 카드가 전면(센터)을 차지 */
  transition: transform .85s cubic-bezier(.45,.05,.25,1),
              filter .85s ease,
              z-index 0s linear .1s;
  will-change: transform;
}
/* 3개의 슬롯 · 레이어: 센터(맨 위) → 왼쪽 → 오른쪽(맨 뒤)
   회전 방향: 오른쪽(뒤) → 센터 → 왼쪽 (시계방향 느낌)
   뒤 두 장은 더 작게(scale .78) → 원근감 */
.poster.pos-0 { transform: translateX(0)    rotate(0deg)  scale(1);   z-index: 3; filter: none; }              /* 센터 · 맨 위 */
.poster.pos-1 { transform: translateX(-40%) rotate(-8deg) scale(.78); z-index: 2; filter: brightness(.88); }   /* 왼쪽 · 중간 */
.poster.pos-2 { transform: translateX(40%)  rotate(8deg)  scale(.78); z-index: 1; filter: brightness(.88); }   /* 오른쪽 · 맨 뒤 */

.poster__badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  padding: 3px 6px; border-radius: 5px;
  background: rgba(0,0,0,.3); backdrop-filter: blur(4px);
}
.poster__title {
  font-size: 30px; font-weight: 800;
  letter-spacing: -.02em; line-height: 1.05;
  text-shadow: 0 2px 14px rgba(0,0,0,.25);
}
.poster__foot {
  margin-top: auto;
  font-size: 12px; font-weight: 600;
  opacity: .9;
}
@media (prefers-reduced-motion: reduce) {
  .poster { transition: none; }
}
@media (max-width: 720px) {
  .fcard { padding: 32px 26px 30px; border-radius: 26px; }
  .fcard__desc { font-size: 16px; }
  .fcard__stage { height: 340px; margin-top: 28px; }
  .poster { width: 190px; }
  .poster__title { font-size: 25px; }
}

/* ══════════════════════════════════════════
   모바일: 두 번째 인터랙션(마퀴)을 수동 스와이프 캐러셀로
   · 카드 하나가 화면 너비에 딱 맞음
   · 자동 슬라이드 정지 → 손가락 스와이프로 수동 전환
   ══════════════════════════════════════════ */
@media (max-width: 720px) {
  .marquee {
    padding: 0;
    -webkit-mask-image: none;
            mask-image: none;
  }
  /* 행(row)을 가로 스크롤 컨테이너로 */
  .marquee__row {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;   /* 한 칸씩 스냅 */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;           /* 스크롤바 숨김 (Firefox) */
  }
  .marquee__row::-webkit-scrollbar { display: none; } /* Chrome/Safari */

  .marquee__track {
    animation: none !important;      /* 자동 슬라이드 정지 */
    gap: 16px;                       /* 카드 사이 간격 */
    padding: 0 9vw;                  /* 첫/마지막 카드도 가운데 정렬 + 좌우 여백 */
    width: max-content;
  }
  #track-a2 { display: none; }       /* 복제본 숨김 — 수동이라 무한루프 불필요 */

  .card {
    width: 82vw;                     /* 화면보다 좁게 → 좌우로 다른 카드가 살짝 보임 */
    scroll-snap-align: center;       /* 스와이프 시 가운데로 스냅 */
    border-radius: 24px;
    padding-bottom: 26px;
  }
  .card__thumb-wrap { padding: 40px 44px 16px; }  /* 프레임 여백 모바일에 맞게 축소 */
  .card__label { font-size: 20px; }
  .card__meta  { padding: 6px 26px 0; }

  /* pill 배지를 좁은 화면 폭에 맞게 축소 */
  .hero__pill {
    font-size: 12px;
    gap: 6px;
    padding: 7px 13px;
    max-width: calc(100vw - 40px);
  }
}
