/* =====================================================================
   base.css : 토큰 · 리셋 · 타이포 · 헤더 · 푸터 · 고정 UI
   - 모바일 퍼스트. PC 덮어쓰기는 A형 991px / B형 821px
   - 색 4토큰은 render.js가 config.theme으로 덮어쓴다 → docs/02 §1
   ===================================================================== */

/* ── 1. 토큰 ─────────────────────────────────────────────── */
:root {
  --color-main1: #1e2c40;
  --color-main2: #6081b2;
  --color-main3: #b7cceb;
  --color-point: #c9a35a;
  --color-on-point: #1e2c40;
  /* 흰 배경 위 point 글자 (골드는 그대로 쓰면 대비 2.4:1 → 어둡게 섞어 4.5:1 근처 확보) */
  --color-point-ink: color-mix(in srgb, var(--color-point) 70%, #000);

  --ink: #1f2430;
  --sub: #5b6270;
  --mute: #8b909d;
  --line: #e2e4e8;
  --soft: #f4f6f9;

  --f-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --f-en: "Marcellus", "Times New Roman", serif;
  --f-num: "Montserrat", var(--f-sans);
  --f-serif: "Noto Serif KR", serif;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-curtain: cubic-bezier(.77, 0, .18, 1);

  --hd-h: 56px;
  --quick-top-h: 0px;
  --quick-bottom-h: 0px;
  --gutter: 20px;
  --maxw: 1200px;
  --sec-pad: 72px;
  --radius: 6px;
}
body.has-quick-top { --quick-top-h: 40px; }
body.has-quick-bottom { --quick-bottom-h: 56px; }

@media (min-width: 991px) {
  :root { --hd-h: 80px; --gutter: 4rem; --sec-pad: 120px; }
  body.has-quick-top, body.has-quick-bottom { --quick-top-h: 0px; --quick-bottom-h: 0px; }
}
/* B형은 821px부터 PC (하단 바 숨김) */
@media (min-width: 821px) { body.layout-landing { --quick-bottom-h: 0px; } }

/* ── 2. 리셋 ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.is-locked { overflow: hidden; }
body {
  font-family: var(--f-sans);
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--color-point); outline-offset: 3px; }
[id] { scroll-margin-top: calc(var(--hd-h) + var(--quick-top-h)); }
.ico { width: 1.15em; height: 1.15em; flex-shrink: 0; }

.pc-only { display: none; }
@media (min-width: 991px) { .pc-only { display: inline; } .mo-only { display: none; } }

/* ── 3. 타이포 · 섹션 헤더 ───────────────────────────────── */
.eyebrow {
  font-family: var(--f-en);
  font-size: 13px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--color-main2);
}
.h2 {
  margin-top: 10px;
  font-size: clamp(25px, 7vw, 28px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.03em;
}
.h2 b { font-weight: 800; color: var(--color-main1); }
.lead { margin-top: 12px; font-size: 15px; color: var(--sub); letter-spacing: -0.02em; }
.note { margin-top: 16px; font-size: 12px; color: var(--mute); line-height: 1.6; }

.is-dark { background: var(--color-main1); color: #fff; }
.is-dark .h2 b { color: var(--color-main3); }
.is-dark .lead, .is-dark .note { color: rgb(255 255 255 / .62); }
.is-soft { background: var(--soft); }

@media (min-width: 991px) {
  .layout-brand .eyebrow { font-size: 15px; }
  .layout-brand .h2 { font-size: clamp(36px, 3vw, 46px); }
  .layout-brand .lead { font-size: 18px; }
  .layout-brand .note { font-size: 13px; }
}

/* ── 4. 헤더 (A형) ───────────────────────────────────────── */
.hd {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--hd-h);
  background: var(--color-main1); color: #fff;
  transition: background .3s, color .3s, box-shadow .3s;
}
.hd-in { position: relative; display: flex; align-items: center; justify-content: space-between; height: 100%; padding: 0 12px; }
.hd-logo { position: absolute; left: 50%; transform: translateX(-50%); }
.hd-logo img { height: 22px; width: auto; }
.hd-logo .logo-color { display: none; }
.hd-burger { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 40px; height: 40px; padding: 0 8px; }
.hd-burger i { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s, opacity .3s; }
.is-mnav-open .hd-burger i:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.is-mnav-open .hd-burger i:nth-child(2) { opacity: 0; }
.is-mnav-open .hd-burger i:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.hd-tel {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 2em;
  background: var(--color-main3); color: var(--color-main1);
  font-size: 13px; font-weight: 700;
}
.hd-nav, .hd-mega { display: none; }

/* MO 전체 메뉴 */
.mnav {
  position: fixed; inset: var(--hd-h) 0 0 0; z-index: 99;
  overflow-y: auto; background: #fff; padding: 8px 0 120px;
}
.mnav-d1 {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 18px var(--gutter); font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--line); text-align: left;
}
.mnav-d1::after { content: "+"; font-weight: 300; font-size: 22px; color: var(--mute); transition: transform .3s; }
.mnav-d1[aria-expanded="true"]::after { transform: rotate(45deg); }
.mnav-d2 { display: none; background: var(--soft); padding: 8px 0; }
.mnav-d1[aria-expanded="true"] + .mnav-d2 { display: block; }
.mnav-d2 a { display: block; padding: 10px calc(var(--gutter) + 8px); font-size: 15px; color: var(--sub); }
.mnav-foot { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; }
.mnav-foot a { padding: 18px; text-align: center; font-weight: 700; }
.mnav-tel { background: var(--color-main1); color: #fff; font-family: var(--f-num); }
.mnav-reserve { background: var(--color-point); color: var(--color-on-point); }

@media (min-width: 991px) {
  .hd { background: rgb(255 255 255 / .96); color: var(--ink); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(8px); }
  .hd-in { padding: 0 var(--gutter); }
  .hd-logo { position: static; transform: none; }
  .hd-logo img { height: 28px; }
  .hd-logo .logo-color { display: block; }
  .hd-logo .logo-white { display: none; }
  .hd-burger { display: none; }
  .hd-tel { padding: 10px 22px; background: var(--color-main1); color: #fff; font-family: var(--f-num); font-size: 18px; }

  /* GNB와 메가메뉴는 같은 폭·같은 컬럼 수 → 2뎁스가 1뎁스 바로 아래 정렬 */
  .hd { --nav-w: min(52rem, calc(100vw - 600px)); }
  .hd-nav {
    position: absolute; left: 50%; transform: translateX(-50%);
    display: grid; grid-template-columns: repeat(var(--cols), 1fr); width: var(--nav-w); height: 100%;
  }
  .hd-nav a { display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 500; position: relative; }
  .hd-nav a::after {
    content: ""; position: absolute; left: 50%; bottom: 22px; width: 0; height: 2px;
    background: var(--color-point); transition: width .3s var(--ease-out), left .3s var(--ease-out);
  }
  .hd-nav a:hover::after, .hd-nav a.is-active::after { left: 30%; width: 40%; }
  .hd-mega {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; color: var(--ink); border-top: 1px solid var(--line);
    box-shadow: 0 12px 24px rgb(0 0 0 / .06);
    max-height: 0; overflow: hidden; transition: max-height .4s var(--ease-out);
  }
  .mega-in { display: grid; grid-template-columns: repeat(var(--cols), 1fr); width: var(--nav-w); margin: 0 auto; padding: 20px 0 28px; }
  .mega-col li a { display: block; padding: 7px 0; text-align: center; font-size: 15px; color: var(--sub); }
  .mega-col li a:hover { color: var(--color-main1); font-weight: 600; }
  .hd:hover .hd-mega, .hd:focus-within .hd-mega { max-height: 420px; }

  /* 다크 섹션 위: 투명 + 흰색 (메가메뉴 열리면 원복) */
  .hd.is-on-dark:not(:hover):not(:focus-within) { background: transparent; color: #fff; box-shadow: none; backdrop-filter: none; }
  .hd.is-on-dark:not(:hover):not(:focus-within) .logo-color { display: none; }
  .hd.is-on-dark:not(:hover):not(:focus-within) .logo-white { display: block; }
  .hd.is-on-dark:not(:hover):not(:focus-within) .hd-tel { background: #fff; color: var(--color-main1); }
  .mnav { display: none !important; }
}

/* ── 5. 고정 UI ──────────────────────────────────────────── */
/* MO 상단 퀵바 (A형) */
.quick-top {
  position: fixed; top: var(--hd-h); left: 0; right: 0; z-index: 98;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--quick-top-h); padding: 0 12px;
  background: var(--color-point); color: var(--color-on-point);
  font-size: 13px; letter-spacing: -0.02em; white-space: nowrap;
}
.quick-top b { font-weight: 800; }
.quick-top span { margin: 0 6px; opacity: .6; }
.quick-top em { font-style: normal; font-weight: 700; font-size: 12px; padding: 2px 10px; border-radius: 2em; background: rgb(0 0 0 / .14); }
@media (min-width: 991px) { .quick-top { display: none; } }

/* MO 하단 2분할 바 */
.quick-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 97;
  display: grid; grid-template-columns: 1fr 1fr;
  height: calc(var(--quick-bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--color-main1);
  transition: transform .35s var(--ease-out);
}
.quick-bottom.is-hidden { transform: translateY(110%); }
.quick-bottom a { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 700; color: #fff; }
.quick-bottom .qb-tel { font-family: var(--f-num); }
.quick-bottom .qb-reserve { background: var(--color-point); color: var(--color-on-point); }
@media (min-width: 991px) { .quick-bottom { display: none; } }
@media (min-width: 821px) { .layout-landing .quick-bottom { display: none; } }

/* PC 플로팅 CTA (A형 991px~ 스크롤 후 노출 / B형 821px~ 상시) */
.float-cta {
  position: fixed; right: 32px; bottom: 32px; z-index: 96;
  display: none; flex-direction: column; align-items: flex-end; gap: 10px;
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .4s, transform .4s var(--ease-out);
}
.float-cta.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.float-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 52px; height: 52px; border-radius: 52px; overflow: hidden; white-space: nowrap;
  background: var(--color-main2); color: #fff; box-shadow: 0 6px 18px rgb(0 0 0 / .18);
  transition: width .4s var(--ease-out), background .3s, color .3s;
}
.float-btn .ico { width: 22px; height: 22px; }
.float-btn span { display: none; font-weight: 600; }
.float-btn.is-reserve:hover, .float-btn.is-reserve:focus-visible { width: 160px; background: #fff; color: var(--color-main1); }
.float-btn.is-reserve:hover span, .float-btn.is-reserve:focus-visible span { display: inline; }
.float-btn.is-top { background: #fff; color: var(--color-main1); }
@media (min-width: 991px) { .layout-brand .float-cta { display: flex; } }
@media (min-width: 821px) { .layout-landing .float-cta { display: flex; right: 24px; bottom: 24px; opacity: 1; transform: none; pointer-events: auto; } }

/* A형 PC 사이드 팝업 탭 */
.side-pop { display: none; }
@media (min-width: 991px) {
  .side-pop {
    position: fixed; left: 0; top: 24%; z-index: 95;
    display: flex; align-items: center;
    transform: translateX(calc(-100% + 48px));
    transition: transform .7s var(--ease-out);
  }
  .side-pop.is-open { transform: none; }
  .side-pop-imgs { display: flex; background: #fff; box-shadow: 0 10px 30px rgb(0 0 0 / .2); }
  .side-pop-imgs img { width: 320px; }
  .side-pop-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    width: 48px; height: 160px; border-radius: 0 10px 10px 0;
    background: var(--color-main1); color: #fff;
  }
  .side-pop-tab span { writing-mode: vertical-rl; font-size: 16px; font-weight: 600; letter-spacing: .08em; }
  .side-pop-tab .ico { transition: transform .4s; }
  .side-pop.is-open .side-pop-tab .ico { transform: rotate(180deg); }
}

/* 프로모션 팝업 */
.promo {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgb(10 14 20 / .6);
  animation: fade-in .3s ease both;
}
.promo-box { width: 100%; max-width: 400px; background: #fff; border-radius: 12px; overflow: hidden; animation: fade-up .45s var(--ease-out) both; }
.promo-body { display: block; padding: 24px 20px 0; text-align: center; }
.promo-badge { display: inline-block; padding: 4px 12px; border-radius: 2em; background: var(--color-main1); color: #fff; font-size: 12px; font-weight: 700; }
.promo-title { display: block; margin-top: 10px; font-size: 26px; font-weight: 800; color: var(--color-main1); letter-spacing: -0.03em; }
.promo-lead { margin-top: 4px; font-size: 14px; color: var(--sub); }
.promo-body img { margin-top: 16px; width: calc(100% + 40px); max-width: none; margin-left: -20px; aspect-ratio: 4 / 3; object-fit: cover; }
.promo-cta { padding: 14px; margin: 0 -20px; background: var(--color-point); color: var(--color-on-point); font-weight: 800; }
.promo-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 13px; color: var(--sub); }
.promo-foot label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.promo-close { width: 32px; height: 32px; border-radius: 6px; background: var(--color-main1); color: #fff; font-size: 22px; line-height: 1; }

/* 라이트박스 */
.lightbox { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: 48px 12px; background: rgb(0 0 0 / .88); }
.lightbox img { max-height: 100%; width: auto; object-fit: contain; }
.lightbox-close { position: absolute; top: 10px; right: 14px; width: 40px; height: 40px; color: #fff; font-size: 34px; }
img[data-zoom] { cursor: zoom-in; }

/* 커서 점 */
.cursor-dot { position: fixed; left: 0; top: 0; z-index: 9999; width: 8px; height: 8px; border-radius: 50%; background: var(--color-main2); pointer-events: none; mix-blend-mode: difference; }

/* ── 6. 푸터 ─────────────────────────────────────────────── */
.ft { background: #14181f; color: rgb(255 255 255 / .58); font-size: 13px; }
/* 하단 고정 바 높이만큼 푸터 안쪽에 여백 (본문 섹션과 좌우 정렬 일치) */
.ft-in { max-width: calc(var(--maxw) + var(--gutter) * 2); margin: 0 auto; padding: 48px var(--gutter) calc(48px + var(--quick-bottom-h)); display: grid; gap: 16px; }
.ft-logo { height: 28px; width: auto; opacity: .9; }
.ft-info div { display: flex; gap: 12px; }
.ft-info dt { color: rgb(255 255 255 / .85); min-width: 56px; }
.ft-notes p { font-size: 12px; line-height: 1.7; }
.ft-tel { font-size: 15px; color: #fff; }
.ft-tel b { font-family: var(--f-num); font-size: 22px; margin-left: 6px; }
.ft-copy { font-size: 12px; opacity: .7; }
@media (min-width: 991px) {
  .layout-brand .ft-in { grid-template-columns: 1fr auto; column-gap: 64px; }
  .layout-brand .ft-tel { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
