/* ============================================================
   FAIRPICK 홈페이지 (type02) — styles
   디자인: 1920 고정폭 / 콘텐츠 1440 (좌우 240 거터)
   ============================================================ */

:root {
  --content: 1440px;
  --gut: 40px;            /* 작은 화면 좌우 여백 */
  --gap: 30px;            /* 카드 간격 */
  --radius: 32px;

  --c-ink: #000000;
  --c-sub: #444444;
  --c-mut: #666666;
  --c-line: #e2e6ea;
  --c-primary: #2c3cff;
  --c-pink: #ff00ae;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* 텍스트 드래그/선택 방지 */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

img {
  display: block;
  max-width: 100%;
  /* 이미지 드래그 방지 */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  user-drag: none;
  pointer-events: none;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
/* 복사 폴백 등 폼 요소는 선택 허용 */
input, textarea { -webkit-user-select: text; user-select: text; }

/* 콘텐츠 래퍼: 1920에서 240 거터 = 1440 */
.wrap {
  width: min(var(--content), 100% - var(--gut) * 2);
  margin-inline: auto;
}

/* ---------- 공통 섹션 헤더 ---------- */
.eyebrow {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--c-sub);
}
.section-title {
  margin: 14px 0 0;
  font-size: clamp(36px, 4.2vw, 56px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--c-ink);
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  /* 페이지 상단에 배치 → 스크롤 시 히어로와 함께 위로 사라짐 (스티키 아님) */
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.6s var(--ease);
}
.nav.is-ready { transform: translateY(0); }
.nav__inner {
  width: min(var(--content), 100% - var(--gut) * 2);
  margin-inline: auto;
  height: 80px;
  display: flex;
  align-items: center;
}
.nav__logo {
  display: flex;
  align-items: center;
}
.nav__logo img { height: 24px; width: auto; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  aspect-ratio: 1920 / 1080;
  min-height: 460px;
  overflow: hidden;
  background: linear-gradient(180deg, #6fb3e3 41%, #629ef3 100%);
  display: grid;
  place-items: center;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(25, 72, 201, 0.12) 0%, rgba(60, 110, 220, 0.22) 100%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 1280px;
  transform: translateY(-4%);
}
.hero__title {
  margin: 0;
  min-height: 1.4em;
  font-size: clamp(28px, 4.6vw, 88px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: #fff;
  /* 가독성용 부드러운 그림자 한 겹 (입체효과 제거) */
  text-shadow: 0 2px 14px rgba(0, 30, 90, 0.35);
}
/* index2와 동일한 세로막대 타이핑 커서 (타이핑 중에만 노출, 끝나면 자동 제거) */
.hero__title.is-typing::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 6px;
  background: #2c3cff;
  vertical-align: -0.12em;
  animation: caret 0.8s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.hero__desc {
  margin: clamp(20px, 3vw, 40px) 0 0;
  font-size: clamp(16px, 2vw, 36px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: #fff;
  /* 가독성용 부드러운 그림자 한 겹 (입체효과 제거) */
  text-shadow: 0 2px 10px rgba(0, 30, 90, 0.3);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.hero__desc.is-in {
  opacity: 1;
  transform: none;
}
.hero__scroll {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: clamp(20px, 3.2vw, 44px);
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0.9;
  filter: drop-shadow(0 2px 10px rgba(0, 40, 120, 0.35));
  animation: heroChevron 1.1s ease-in-out infinite;
}
.hero__scroll svg { width: 46px; height: 46px; }
@keyframes heroChevron {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 9px); }
}

/* ============================================================
   About
   ============================================================ */
.about {
  background: #fff;
  padding-top: clamp(72px, 9vw, 116px);
  padding-bottom: clamp(56px, 7vw, 92px);
}
.about__cards {
  display: flex;
  gap: var(--gap);
  margin-top: clamp(36px, 4vw, 56px);
}
.about__card {
  flex: 1 1 0;
  min-width: 0;
}
.about__lift img {
  width: 100%;
  height: auto;
  aspect-ratio: 460 / 530;
  object-fit: cover;
  display: block;
}
/* 가운데 카드 48px 아래로 스태거 */
.about__card--mid { transform: translateY(48px); }

/* ============================================================
   Services (bento)
   ============================================================ */
.services {
  background: #fff;
  padding-top: clamp(48px, 6vw, 78px);
  padding-bottom: clamp(64px, 8vw, 104px);
}
.bento {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin-top: clamp(36px, 4vw, 56px);
}
.bento__row {
  display: flex;
  gap: var(--gap);
}
.bento__card {
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.bento__card img { width: 100%; height: auto; }
/* 디자인 폭 비율로 flex 분배 (gap 제외 후 950:460) */
.b-stat     { flex: 950 1 0; }
.b-download { flex: 460 1 0; cursor: pointer; }
.b-trust    { flex: 460 1 0; }
.b-platform {
  flex: 950 1 0;
  aspect-ratio: 950 / 680;     /* 단일 이미지 대신 카드가 직접 비율 보유 */
  container-type: inline-size; /* 내부 텍스트를 카드 폭 비례(cqw)로 */
}
.b-stat img     { aspect-ratio: 950 / 440; object-fit: cover; }
.b-download img { aspect-ratio: 460 / 440; object-fit: cover; }
.b-trust img    { aspect-ratio: 460 / 680; object-fit: cover; }

/* 가챠팡 다운로드 카드: ↗ 화살표 호버 시 대각선(좌하→우상) 이동.
   베이크된 원본 아이콘은 카드 그라데이션과 같은 색의 패치로 덮음 */
.b-download .dl-arrow {
  position: absolute;
  left: 81.3%;     /* (378-4)/460 */
  top: 8.18%;      /* (40-4)/440  */
  width: 13.04%;   /* 60/460 */
  height: 13.64%;  /* 60/440 */
  background: linear-gradient(180deg, #ff22b9 0%, #ff12b4 100%);
  z-index: 3;
}
/* 패치 가운데에 52/60 비율로 아이콘 정렬 (정적 svg + Lottie 컨테이너) */
.b-download .dl-arrow__static,
.b-download .dl-arrow__lottie {
  position: absolute;
  left: 6.7%;
  top: 6.7%;
  width: 86.6%;
  height: 86.6%;
}
.b-download .dl-arrow__static { display: block; opacity: 1; transition: opacity 0.2s ease; }
.b-download .dl-arrow__lottie { opacity: 0; transition: opacity 0.2s ease; }
/* Lottie 로드되면(.dl-lottie-on) 정적 ↗ 숨기고 계속 재생되는 Lottie 노출
   (모션최소화 시엔 클래스 미부여 → 정적 ↗ 폴백) */
.b-download.dl-lottie-on .dl-arrow__static { opacity: 0; }
.b-download.dl-lottie-on .dl-arrow__lottie { opacity: 1; }

/* 카드 내부 오버레이(패치·Lottie·그라데이션 흐름) 기준 */
.about__card,
.bento__card { position: relative; }

/* ---- 신뢰할 수 있는 운영 카드: 폰 화면 피버 게이지를 Lottie로 교체 ---- */
.b-trust .fever-patch {
  position: absolute;
  left: 13.5%;
  top: 39.8%;
  width: 73%;     /* 폰 화면(12.4~87.8%) 안쪽 */
  height: 16.5%;
  background: #fbfbfc; /* 폰 화면 흰색과 동일 */
  z-index: 2;
}
.b-trust .fever-gauge {
  position: absolute;
  left: 13.5%;
  top: 42.1%;
  width: 73%;       /* 피그마 게이지에 맞춤(화면 안쪽 유지) */
  height: 11.55%;   /* 359:84 비율 (width 73% 기준) */
  z-index: 3;
}
/* 원본 글로우 재현 — Lottie 흰 카드 위치(컨테이너 대비 좌우 2.3%/상하 10% 안쪽)에 맞춰 그림자만 (연하게) */
.b-trust .fever-gauge::before {
  content: "";
  position: absolute;
  inset: 9.8% 2.5% 10.7% 2.2%;
  border-radius: 14px;
  box-shadow: 0 0 16px rgba(255, 90, 190, 0.3);
  pointer-events: none;
}

/* ---- 플랫폼(우측하단) 카드: 애니메이션 그라데이션 배경(bg_a/bg_b 크로스페이드)
       위에 텍스트(실제 HTML) + 폰 목업(투명 PNG)을 얹음 ---- */
.b-platform .plat-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.b-platform .plat-bg img {
  position: absolute;
  left: 0;
  top: -14.26%;     /* -97/680: 디자인 배치 그대로 */
  width: 100%;
  height: 133.2%;   /* 906/680 */
  object-fit: cover;
}
/* bg_a = 베이스(항상). bg_b = 무한 크로스페이드 */
.b-platform .plat-bg__b {
  animation: gachaCrossfade 6s ease-in-out infinite;
}
@keyframes gachaCrossfade {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}
.b-platform .plat-text {
  position: absolute;
  left: 5.89%;       /* 56/950 */
  bottom: 8.24%;     /* 56/680 */
  width: 32%;
  margin: 0;
  z-index: 2;
  color: #fff;
  font-weight: 800;
  font-size: 4.63cqw;  /* 44/950 → 카드 폭 비례 */
  line-height: 1.5;
  letter-spacing: -0.02em;
  text-shadow: 0 0 30px rgba(53, 38, 183, 1);
  /* 배경 크로스페이드(6s)와 동기화해 글로우 색이 함께 변함 (무한) */
  animation: platGlow 6s ease-in-out infinite;
}
@keyframes platGlow {
  0%, 100% { text-shadow: 0 0 30px rgba(53, 38, 183, 0.95); }  /* bg_a: 보라/블루 */
  50%      { text-shadow: 0 0 30px rgba(196, 18, 132, 0.95); } /* bg_b: 마젠타 */
}
.b-platform .plat-phone {
  position: absolute;
  left: 46.6%;       /* 443/950 */
  top: -3.97%;       /* -27/680 */
  width: 47.47%;     /* 451/950 */
  height: auto;
  z-index: 1;
}

/* ============================================================
   Contact
   ============================================================ */
.contact {
  background: #fff;
  padding-bottom: clamp(56px, 7vw, 92px);
}
.contact__card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1440 / 460;
  background: #171737;
}
/* 디자인 그대로의 contact 카드(색·글로우·텍스트) */
.contact__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 베이크된 이메일 위 투명 클릭영역(복사) — 배경 없이 커서만 포인터 */
.contact__copy {
  position: absolute;
  top: 44%;
  left: 47%;
  width: 47%;
  height: 26%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: #fff;
}
.footer__inner {
  border-top: 1px solid #ddd;      /* 피그마: 콘텐츠 폭 상단 구분선 */
  padding: clamp(40px, 4.5vw, 56px) 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}
.footer__left { display: flex; flex-direction: column; }
.footer__company {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--c-ink);
}
.footer__row {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 16px;
  letter-spacing: -0.015em;
  color: var(--c-sub);
}
.footer__bar {
  width: 1px;
  height: 12px;
  background: var(--c-sub);
  display: inline-block;
}
.footer__copy {
  margin: 24px 0 0;
  font-size: 16px;
  letter-spacing: -0.015em;
  color: var(--c-mut);
}
.footer__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  align-self: stretch;
  gap: 56px;
}
.footer__menu { display: flex; align-items: center; gap: 20px; }
.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: -0.015em;
  color: var(--c-sub);
  transition: color 0.2s ease;
}
.footer__link svg { width: 14px; height: 14px; }
.footer__logo { height: 24px; width: auto; }

/* ============================================================
   Scroll-to-top
   ============================================================ */
.to-top {
  position: fixed;
  right: clamp(20px, 3vw, 48px);
  bottom: clamp(20px, 3vw, 48px);
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease), visibility 0.3s,
    background 0.2s ease;
  box-shadow: 0 12px 30px rgba(44, 60, 255, 0.4);
  z-index: 90;
}
.to-top.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: #1f2bd6; }
.to-top svg { width: 24px; height: 24px; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 20px);
  background: rgba(20, 20, 28, 0.94);
  color: #fff;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s var(--ease), visibility 0.3s;
  z-index: 120;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}
.toast.is-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ============================================================
   Modal
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.modal.is-open { visibility: visible; opacity: 1; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 18, 0.5);
  backdrop-filter: blur(3px);
}
.modal__panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.3s var(--ease);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.modal.is-open .modal__panel { transform: translateY(0) scale(1); }
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--c-line);
}
.modal__head h3 { margin: 0; font-size: 20px; font-weight: 700; }
.modal__close {
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #888;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
}
.modal__close:hover { background: #f1f1f1; color: #333; }
.modal__body {
  padding: 26px;
  overflow-y: auto;
  line-height: 1.7;
  color: #333;
}
.modal__body h4 { margin: 20px 0 8px; font-size: 16px; }
.modal__body h4:first-child { margin-top: 0; }
.modal__body p { margin: 0 0 12px; font-size: 15px; color: #555; }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), box-shadow 0.35s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }
.about__card--mid.reveal { transform: translateY(82px); }      /* 34 + 48 stagger */
.about__card--mid.reveal.is-in { transform: translateY(48px); }

/* ============================================================
   카드 호버: 살짝 떠오름 + 그림자 + 빛 스윕 (about 카드만)
   안쪽 .about__lift만 떠오르고 hover 판정은 고정된 바깥 .about__card가
   받게 해 경계선에서 올라왔다내려왔다 하는 떨림(다다다)을 방지
   ============================================================ */
.about__lift {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.35s var(--ease);
}
.about__card:hover .about__lift {
  transform: translateY(-8px);
  box-shadow: 0 18px 38px -14px rgba(20, 20, 50, 0.28);
}
/* 빛 스윕 — 대각선 광택이 호버 시 좌→우로 한 번 지나감 (.about__lift에 클립) */
.about__lift::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 55%; height: 100%;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0) 100%);
  transform: translateX(-200%) skewX(-14deg);
  z-index: 6;
  pointer-events: none;
}
.about__card:hover .about__lift::after {
  transform: translateX(360%) skewX(-14deg);
  transition: transform 1.2s var(--ease);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  :root { --gut: 28px; --gap: 20px; }
}

@media (max-width: 760px) {
  .about__cards { flex-direction: column; }
  .about__card { max-width: 460px; margin-inline: auto; width: 100%; }
  .about__card--mid { transform: none; }
  .about__card--mid.reveal { transform: translateY(34px); }
  .about__card--mid.reveal.is-in { transform: none; }
  .about__lift img { aspect-ratio: 16 / 11; }

  .bento__row { flex-direction: column; }
  .bento__card { width: 100%; }
  .b-stat img, .b-download img, .b-trust img, .b-platform img {
    aspect-ratio: 16 / 10;
  }

  /* contact 카드는 디자인 비율 유지하며 축소 */

  .footer__inner { flex-direction: column; }
  .footer__right { align-items: flex-start; align-self: auto; gap: 28px; }
}

/* 모션 최소화 설정 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .about__card--mid.reveal { transform: translateY(48px) !important; }
  .b-platform .plat-bg__b { animation: none; opacity: 0; }
  .b-platform .plat-text { animation: none; }
  /* 모션 최소화: 패치·Lottie 숨겨 원본(정적) 게이지 노출 */
  .b-trust .fever-patch, .b-trust .fever-gauge { display: none; }
  /* 모션 최소화: about 카드 호버 lift·빛 스윕 비활성 */
  .about__card:hover .about__lift { transform: none; box-shadow: none; }
  .about__lift::after { display: none; }
}
