/* 폰트 @font-face 는 fonts.css 로 분리 — head 에서 가장 먼저 로드 */

/* ══════ 로고 인트로 (메인 최초 진입 1회) ══════
   기본은 숨김. JS 가 재생 조건을 통과했을 때만 .on 을 붙인다.
   → JS 가 죽어도 빈 검정 화면이 남지 않는다. */
#logo-intro {
  display: none;
}
#logo-intro.on {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  background: #08080a;
  cursor: pointer;
  transition:
    opacity 0.55s ease,
    visibility 0.55s ease;
}
#logo-intro.on.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#logo-intro svg {
  width: min(76vw, 560px);
  height: auto;
}

html {
  scroll-behavior: smooth;
}
body {
  background: #08080a;
  color: #ededef;
  -webkit-font-smoothing: antialiased;
}

/* ══════ 한국어 줄바꿈 ══════
   keep-all : 어절 중간에서 끊지 않는다. 이게 없으면 "가능합/니다" 처럼 잘린다.
   text-wrap : 제목은 balance(줄 길이 균등), 본문은 pretty(마지막 줄 고아 방지).
   overflow-wrap : URL·긴 영문이 keep-all 때문에 컨테이너를 뚫는 것 방지. */
h1,
h2,
h3,
h4,
p,
li,
figcaption,
blockquote,
th,
td {
  word-break: keep-all;
  overflow-wrap: break-word;
}
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}
p,
li {
  text-wrap: pretty;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal.on {
  opacity: 1;
  transform: none;
}

.goldtext {
  background: linear-gradient(180deg, #f0da9a 0%, #c9a227 60%, #9a7a15 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hairline {
  border-color: #2b2b32;
}
details[open] summary .chev {
  transform: rotate(45deg);
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 0
  );
  background-size: 4px 4px;
}

/* AI 생성 미디어 표기 — 컨셉 이미지/영상에만 부착 */
.ai-badge {
  position: absolute;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}
.ai-badge::before {
  content: "AI";
  font-size: 9px;
  font-weight: 800;
  background: #c9a227;
  color: #08080a;
  padding: 1px 5px;
  border-radius: 4px;
}
.ai-caption {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.38);
}

/* ══════ 히어로 배경 ══════
   미디어 수신 시 이 div 를 <img> 또는 <video> 로 교체 */
.media-slot {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 90% at 50% 0%,
    #17171c 0%,
    #0c0c10 60%,
    #08080a 100%
  );
}

/* 한글 라벨용 — 영문 트래킹보다 좁게 */
.kolabel {
  letter-spacing: 0.12em;
}

/* 현재 페이지 GNB 표시 */
.nav-active {
  color: #c9a227 !important;
}

/* ══════ 법적 문서 본문 타이포 ══════ */
.legal h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 44px 0 14px;
  padding-top: 22px;
  border-top: 1px solid #2b2b32;
}
.legal h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.legal h3 {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin: 24px 0 10px;
}
.legal p {
  font-size: 16px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 14px;
}
.legal ol {
  counter-reset: li;
  margin: 0 0 16px;
}
.legal ol > li {
  counter-increment: li;
  position: relative;
  padding-left: 30px;
  font-size: 16px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 10px;
}
.legal ol > li::before {
  content: counter(li) ".";
  position: absolute;
  left: 4px;
  color: #c9a227;
  font-weight: 700;
}
.legal ul {
  margin: 10px 0 10px;
}
.legal ul > li {
  position: relative;
  padding-left: 18px;
  font-size: 15.5px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.58);
  margin-bottom: 6px;
}
.legal ul > li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: #c9a227;
}
.legal a {
  color: #c9a227;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal b {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
}
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  font-size: 15px;
}
.legal th {
  text-align: left;
  padding: 12px 14px;
  background: #1a1a1f;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  border: 1px solid #2b2b32;
  white-space: nowrap;
}
.legal td {
  padding: 12px 14px;
  border: 1px solid #2b2b32;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  vertical-align: top;
}

/* ══════ 모바일 셀렉트 → 바텀시트 피커 ══════ */
.select-trigger {
  display: none;
}
.picker,
.picker-backdrop {
  display: none;
}

@media (max-width: 767px) {
  .native-select {
    display: none !important;
  }

  .select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border-radius: 12px;
    background: #08080a;
    border: 1px solid #2b2b32;
    color: #ededef;
    font-size: 16px;
    text-align: left;
  }
  .select-trigger:active {
    border-color: #c9a227;
  }
  .select-trigger svg {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
  }
  .select-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .picker-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 88;
    background: rgba(0, 0, 0, 0.66);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }
  .picker-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .picker {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 89;
    background: #1a1a1f;
    border: 1px solid #2b2b32;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.65);
    transform: translateY(101%);
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0.28, 1);
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .picker.open {
    transform: none;
  }

  .picker-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid #2b2b32;
  }
  .picker-head::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: #3a3a44;
  }
  .picker-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    padding-top: 4px;
  }
  .picker-close {
    width: 34px;
    height: 34px;
    border-radius: 99px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2b2b32;
    color: rgba(255, 255, 255, 0.7);
    font-size: 17px;
    line-height: 1;
    background: transparent;
  }

  .picker-list {
    max-height: 62dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
  }
  .picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 14px 14px;
    border-radius: 12px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    text-align: left;
    line-height: 1.4;
  }
  .picker-item:active {
    background: #22222a;
  }
  .picker-item.on {
    background: rgba(201, 162, 39, 0.12);
    color: #e6c86e;
    font-weight: 700;
  }
  .picker-item svg {
    width: 20px;
    height: 20px;
    opacity: 0;
    flex-shrink: 0;
  }
  .picker-item.on svg {
    opacity: 1;
  }

  body.picker-open {
    overflow: hidden;
  }
}

/* ══════ 모바일 하단 탭바 ══════ */
.tabbar {
  display: none;
}

@media (max-width: 767px) {
  .tabbar {
    display: flex;
    align-items: stretch;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(8, 8, 10, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid #2b2b32;
  }

  /* 일반 탭 — 낮은 위계 */
  .tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 2px 5px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
  .tab svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.8;
  }
  .tab.on {
    color: #c9a227;
  }
  .tab.on svg {
    stroke-width: 2.2;
  }

  /* 상담신청 — 최상위 위계 : 골드 채움 + 크기 + 그림자 */
  .tab-cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 18px;
    min-height: 54px;
    margin: -6px 0 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #e6c86e 0%, #c9a227 100%);
    color: #08080a;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.34);
  }
  .tab-cta svg {
    width: 19px;
    height: 19px;
    stroke-width: 2.3;
  }
  .tab-cta.on {
    filter: brightness(1.06);
  }

  /* 탭바에 가리지 않도록 하단 여백 확보 */
  body {
    padding-bottom: 78px;
  }
}

/* ══════ 퀵메뉴 : 상담신청 + TOP ══════ */
.quick {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}
.quick.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.quick-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  background: #c9a227;
  color: #08080a;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(201, 162, 39, 0.28);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
.quick-cta:hover {
  background: #e6c86e;
  transform: translateY(-2px);
}
.quick-cta svg {
  width: 18px;
  height: 18px;
}

.quick-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(18, 18, 21, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid #2b2b32;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}
.quick-top:hover {
  border-color: #c9a227;
  color: #c9a227;
  transform: translateY(-2px);
}
.quick-top svg {
  width: 20px;
  height: 20px;
}
.quick-top span {
  display: none;
}

/* 모바일 : 탭바 위로 올리고, 상담신청은 탭바에 이미 있으므로 숨김 */
@media (max-width: 767px) {
  .quick {
    right: 16px;
    bottom: 92px;
  }
  .quick-cta {
    display: none;
  }
  .quick-top {
    width: 46px;
    height: 46px;
  }
}
