/* ============================================================
   FocusDot 랜딩페이지 — 흑백 미니멀 (Simple · Clean · Quiet)
   모바일 세로 우선 / iOS Safari 대응 (100svh)
   ============================================================ */

:root {
  --bg: #ffffff;
  --ink: #111111;          /* 거의 검정, 눈에 부드럽게 */
  --ink-pure: #000000;     /* 점·검은 영역 */
  --muted: rgba(0, 0, 0, 0.58);
  --hairline: rgba(0, 0, 0, 0.16);
  --dot: 22px;             /* 점 지름 (앱 오프닝과 동일 톤) */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* scrub 애니메이션과 충돌 방지 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    Pretendard, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 26px;
}

/* ============================================================
   섹션 1 — 히어로 스크롤 시퀀스
   ============================================================ */
.hero {
  position: relative;
}

/* 트리거 재생 방식 — 스크롤 거리용 트랙은 불필요 (한 화면) */
.hero-track {
  height: auto;
}

/* 첫 화면을 가득 채우는 무대 */
.hero-stage {
  position: relative;
  height: 100vh;
  height: 100svh; /* iOS 주소창 버그 회피 */
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 검은 영역: 화면을 덮는 큰 원 → 점으로 "축소"하여 수렴.
   확대(scale up)는 가장자리가 깨지므로, JS가 width/height를 화면 크기로 키운 뒤
   scale을 1 → 점 크기로 "축소"한다. 축소는 항상 또렷함. */
.hero-black {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--ink-pure);
  /* 기본(무JS) 상태 = 중앙에 수렴한 점 */
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
}

/* 페인포인트 1줄 — 검은 화면 위 흰 글씨, 처음부터 또렷이
   (transform 미사용 → GSAP가 y/opacity를 자유롭게 제어) */
.hero-pain {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  margin: 0 auto;
  width: min(86%, 460px);
  text-align: center;
  color: #ffffff;
  font-size: clamp(20px, 6.4vw, 30px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.02em;
  z-index: 3;
  /* 기본(무JS) 상태에서는 숨김 (점만 보이게) */
  opacity: 0;
  pointer-events: none;
}

/* 흩뿌려진 할 일 파편 */
.hero-fragments {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0; /* 기본(무JS) 상태 숨김 */
  pointer-events: none;
}

.hero-fragments span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s));
  color: #ffffff;
  opacity: var(--o);
  font-size: clamp(13px, 3.6vw, 17px);
  font-weight: 400;
  white-space: nowrap;
  will-change: transform, translate, opacity;
  /* 둥둥 떠 있는 효과: independent translate 속성으로 GSAP transform과 충돌 없이 합성 */
  animation: fragFloat var(--fd, 4.8s) ease-in-out var(--fdl, 0s) infinite;
}

/* 머릿속에 떠다니는 할 일들 — 위아래로 천천히 부유 */
@keyframes fragFloat {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 var(--fy, -10px);
  }
}

/* 점 수렴 후 히어로 카피 (중앙의 점 바로 아래에 절대 배치) */
.hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 30px); /* 중앙의 점 아래 */
  z-index: 4;
  text-align: center;
  padding: 0 26px;
  /* 기본 상태 = 숨김 (GSAP/정적 폴백/noscript가 표시) */
  opacity: 0;
}

.hero-title {
  font-size: clamp(26px, 7.6vw, 38px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero-sub {
  margin-top: 18px;
  font-size: clamp(14px, 4vw, 17px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--muted);
}

.hero-scroll-hint {
  margin-top: 46px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero-scroll-hint::after {
  content: "";
  width: 1px;
  height: 28px;
  background: var(--hairline);
  animation: hintLine 1.8s var(--ease) infinite;
  transform-origin: top center;
}

@keyframes hintLine {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* 첫 화면 스크롤 유도 — 검은 배경 위 흰색, 통통 튀는 아래 화살표 */
.hero-cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 26px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  pointer-events: none;
  /* 기본(무JS) 상태 숨김 — JS가 표시하고, 스크롤 시작하면 페이드아웃 */
  opacity: 0;
}

.hero-cue-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.hero-cue-arrow {
  animation: cueBounce 1.5s var(--ease, ease-in-out) infinite;
}

@keyframes cueBounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(7px); opacity: 1; }
}

/* 정적 폴백: GSAP CDN 실패 또는 모션 최소화 시 최종(수렴) 상태로 표시 */
.hero.hero-static .hero-track {
  height: auto;
}
.hero.hero-static .hero-stage {
  position: relative;
  height: 100svh;
}
.hero.hero-static .hero-black {
  transform: scale(1);
}
.hero.hero-static .hero-pain,
.hero.hero-static .hero-fragments,
.hero.hero-static .hero-scroll-hint,
.hero.hero-static .hero-cue {
  display: none;
}
.hero.hero-static .hero-copy {
  opacity: 1;
}

/* ============================================================
   공통 — 진입 페이드업
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   섹션 2 — 해답
   ============================================================ */
.answer {
  padding: clamp(120px, 26vh, 220px) 0;
  text-align: center;
}

.answer-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-pure);
  margin: 0 auto 40px;
}

.answer-title {
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.answer-sub {
  margin-top: 20px;
  font-size: clamp(15px, 4.2vw, 18px);
  color: var(--muted);
  line-height: 1.7;
}

/* ============================================================
   섹션 3 — 기능 3개
   ============================================================ */
.features {
  padding: clamp(40px, 8vh, 80px) 0 clamp(80px, 14vh, 140px);
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(96px, 18vh, 160px);
}

.feature:last-child {
  margin-bottom: 0;
}

.feature-title {
  margin-top: 40px;
  font-size: clamp(22px, 6.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* 폰 목업 */
.feature-media {
  display: flex;
  justify-content: center;
}

.phone {
  position: relative;
  width: min(248px, 64vw);
  aspect-ratio: 300 / 620;
  border-radius: 38px;
  background: #ffffff;
  border: 1px solid var(--hairline);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 18px 50px rgba(0, 0, 0, 0.10);
  padding: 10px;
}

/* 노치 */
.phone::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.10);
  z-index: 3;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: #ffffff;
}

.screen-mock,
.screen-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 영상은 로드되기 전 숨김 → 로드되면 페이드인 (없으면 목업 SVG가 보임) */
.screen-video {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.screen-video.is-ready {
  opacity: 1;
}

/* ============================================================
   섹션 4 — 다운로드
   ============================================================ */
.signup {
  padding: clamp(120px, 24vh, 200px) 0 0;
  text-align: center;
}

.signup-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-pure);
  margin: 0 auto 40px;
}

.signup-title {
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.signup-sub {
  margin-top: 20px;
  font-size: clamp(15px, 4.2vw, 18px);
  color: var(--muted);
  line-height: 1.7;
}

.signup-cta {
  margin-top: 48px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 17px 34px;
  border-radius: 999px;
  background: var(--ink-pure);
  color: #ffffff;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.store-btn:hover {
  transform: translateY(-2px);
  opacity: 0.88;
}

.store-btn:active {
  transform: translateY(0);
}

.store-btn-logo {
  display: block;
  margin-top: -2px;
}

.signup-footnote {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
}

/* 푸터 */
.site-footer {
  margin-top: clamp(100px, 20vh, 180px);
  padding: 36px 0 calc(36px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-top: 1px solid var(--hairline);
}

.footer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-pure);
}

.footer-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ============================================================
   데스크탑 — 기능 섹션 좌우 분할
   ============================================================ */
@media (min-width: 860px) {
  .container {
    max-width: 980px;
  }

  .feature {
    flex-direction: row;
    text-align: left;
    gap: 64px;
    margin-bottom: clamp(120px, 16vh, 180px);
  }

  /* 짝수 기능은 좌우 반전 (지그재그) */
  .feature:nth-child(even) {
    flex-direction: row-reverse;
  }

  .feature-media {
    flex: 0 0 auto;
  }

  .feature-title {
    margin-top: 0;
    font-size: 30px;
    flex: 1;
  }

  .phone {
    width: 270px;
  }
}

/* ============================================================
   접근성 — 모션 최소화 선호 시
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-track {
    height: auto;
  }

  .hero-stage {
    position: relative;
    height: 100svh;
  }

  /* 최종 수렴 상태로 즉시 표시 */
  .hero-black {
    transform: scale(1);
  }

  .hero-pain,
  .hero-fragments {
    display: none;
  }

  .hero-copy {
    opacity: 1;
    transform: none;
  }

  .hero-scroll-hint,
  .hero-cue {
    display: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
