/* ============ 누수의정석 · Design System ============ */
:root {
  --navy-950: #050D1F;
  --navy-900: #0B1E3F;
  --navy-800: #12295B;
  --navy-700: #1B3B85;
  --blue-600: #1D4ED8;
  --blue-500: #2563EB;
  --cyan-400: #38BDF8;
  --gold: #C9A96A;

  --ink-900: #0A0F1E;
  --ink-700: #2D3546;
  --ink-500: #6B7385;
  --ink-400: #9AA0B0;
  --ink-300: #C6CAD4;
  --ink-200: #E4E7EE;
  --ink-100: #F1F3F7;
  --paper: #FBFBFD;
  --white: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(11,30,63,.06);
  --shadow-md: 0 6px 18px rgba(11,30,63,.08);
  --shadow-lg: 0 24px 60px rgba(11,30,63,.14);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --container: 430px;
  --container-lg: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--ink-900);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: break-word;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) {
  .wrap { max-width: var(--container-lg); padding: 0 40px; }
}

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--ink-200);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; height: 100%; }
.brand-logo {
  height: 28px; width: auto; display: block;
  transition: opacity .15s;
}
.brand-logo.is-dark {
  filter: brightness(0) invert(1);
}
.brand:hover .brand-logo { opacity: 0.85; }
@media (min-width: 768px) { .brand-logo { height: 32px; } }

/* SNS links */
.sns-links { display: inline-flex; align-items: center; gap: 10px; }
.sns-links a {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,.08); transition: background .15s, transform .15s;
}
.sns-links[data-size="sm"] a { width: 28px; height: 28px; border-radius: 8px; }
.sns-links[data-size="lg"] a { width: 40px; height: 40px; border-radius: 12px; }
.sns-links a:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.sns-links a img { display: block; }
/* Light background SNS variant */
.sns-light .sns-links a { background: var(--ink-100); }
.sns-light .sns-links a:hover { background: var(--ink-200); }

.header-actions { display: flex; align-items: center; gap: 6px; }
/* 모바일에서도 데스크톱과 동일하게 SNS 아이콘 유지 (좁은 폭에서는 축소) */
.header-sns { display: inline-flex; }
@media (max-width: 767px) {
  .header-actions { gap: 4px; }
  .header-sns .sns-links { gap: 6px; }
  .header-sns .sns-links[data-size="sm"] a { width: 26px; height: 26px; border-radius: 7px; }
  .header-sns .sns-links[data-size="sm"] a img { width: 26px; height: 26px; }
}
@media (max-width: 359px) {
  .header-sns .sns-links { gap: 4px; }
  .header-sns .sns-links[data-size="sm"] a { width: 24px; height: 24px; border-radius: 6px; }
  .header-sns .sns-links[data-size="sm"] a img { width: 24px; height: 24px; }
}

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--navy-900);
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--ink-100); }
.icon-btn svg { width: 22px; height: 22px; }

/* Desktop nav */
.desktop-nav { display: none; align-items: center; gap: 6px; }
.desktop-nav a {
  padding: 8px 14px; border-radius: 8px; font-size: 16px; font-weight: 600;
  color: var(--ink-700); transition: background .15s;
}
.desktop-nav a:hover { background: var(--ink-100); color: var(--navy-900); }
.desktop-nav a[aria-current="page"] { color: var(--navy-900); background: var(--ink-100); }
@media (min-width: 900px) { .desktop-nav { display: flex; } .header-actions .icon-btn[data-nav-open] { display: none; } }

/* Nav overlay */
.nav-overlay {
  position: fixed; inset: 0; z-index: 100; background: var(--navy-950);
  color: white; padding: 20px; transform: translateX(100%); transition: transform .35s cubic-bezier(.6,.05,.1,1);
  display: flex; flex-direction: column;
}
.nav-overlay.open { transform: translateX(0); }
.nav-overlay .nav-head { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.nav-overlay .brand-txt small { color: rgba(255,255,255,.5); }
.nav-overlay .brand { color: white; }
.nav-overlay .nav-list { margin-top: 40px; display: flex; flex-direction: column; gap: 4px; }
.nav-overlay .nav-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 4px; font-size: 29px; font-weight: 700; letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(255,255,255,.08); color: white;
}
.nav-overlay .nav-list a .en { font-size: 13px; color: var(--cyan-400); letter-spacing: 0.2em; font-weight: 500; }
.nav-overlay .nav-list a[aria-current="page"] { color: var(--cyan-400); }
.nav-overlay .nav-foot { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 15px; color: rgba(255,255,255,.6); }
.nav-overlay .nav-foot strong { display: block; color: white; font-size: 29px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font-weight: 700; font-size: 17px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--navy-900); color: white; }
.btn-primary:hover { background: var(--navy-800); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(11,30,63,.25); }
.btn-cyan { background: var(--cyan-400); color: var(--navy-900); }
.btn-ghost { background: transparent; color: var(--navy-900); border: 1px solid var(--ink-300); }
.btn-block { display: flex; width: 100%; }
.btn:active { transform: scale(0.98); }

/* 화면 오른쪽에 뜨는 동그란 버튼 (전화 · 카카오톡 · 맨 위로) */
.floating-cta {
  position: fixed; right: 16px; z-index: 40;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
.fab {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(11,30,63,.22);
  transition: transform .15s ease, box-shadow .15s ease;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11,30,63,.28); }
.fab:active { transform: scale(.96); }
.fab svg { width: 26px; height: 26px; }
.fab-call { background: #E8352C; color: white; }
.fab-kakao { background: #FEE500; color: #191600; }
.fab-kakao svg { width: 28px; height: 28px; }
/* 히어로에 전화 버튼이 보이는 동안에는 전화·카카오톡 버튼을 함께 감춘다 (JS가 감시 대상을 찾았을 때만) */
.fab-call.is-managed,
.fab-kakao.is-managed {
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease, transform .15s ease;
}
.fab-call.is-managed.is-shown,
.fab-kakao.is-managed.is-shown { opacity: 1; visibility: visible; }
/* 맨 위로 버튼은 조금 내려간 뒤에만 나타난다 (맨 위에서는 쓸 일이 없다) */
.fab-top {
  background: white; color: var(--blue-600);
  border: 1px solid var(--ink-200);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease, transform .15s ease;
}
.fab-top.is-shown { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  .fab, .fab-top, .fab-call.is-managed, .fab-kakao.is-managed { transition: none; }
}
@media (min-width: 768px) {
  .floating-cta { right: 24px; bottom: 24px; gap: 14px; }
  .fab { width: 60px; height: 60px; }
  .fab svg { width: 28px; height: 28px; }
  .fab-kakao svg { width: 30px; height: 30px; }
}

/* ============ Sections ============ */
section { padding: 56px 0; }
/* 모바일에서는 섹션끼리 위아래 여백이 겹쳐 112px씩 비어 보인다 — 40px로 좁힌다.
   (페이지에서 padding을 직접 지정한 섹션은 클래스 우선순위가 높아 각 페이지에서 따로 줄인다) */
@media (max-width: 767px) { section { padding: 32px 0; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: 0.24em; color: var(--blue-600); font-weight: 700; text-transform: uppercase;
}
.eyebrow::before { content:""; width: 22px; height: 1px; background: currentColor; display: inline-block; }
h1.display { font-size: 37px; line-height: 1.15; font-weight: 800; letter-spacing: -0.035em; color: var(--navy-900); text-wrap: balance; }
h2.section-title { font-size: 29px; line-height: 1.2; font-weight: 800; letter-spacing: -0.03em; color: var(--navy-900); margin-top: 10px; text-wrap: balance; }
h3 { font-weight: 700; letter-spacing: -0.02em; color: var(--navy-900); }
.lead { color: var(--ink-700); font-size: 18px; line-height: 1.7; margin-top: 12px; text-wrap: pretty; }

.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--ink-200); overflow: hidden; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ============ Footer ============ */
.site-footer {
  background: var(--navy-950); color: rgba(255,255,255,.7); padding: 40px 0 32px; font-size: 15px;
}
.site-footer .foot-top { display: flex; flex-direction: column; gap: 20px; justify-content: space-between; }
@media (min-width: 768px) { .site-footer .foot-top { flex-direction: row; align-items: flex-start; } }
.site-footer .foot-brand { flex: 1; }
.site-footer .foot-sns { flex-shrink: 0; }
.site-footer .foot-sns-label { font-size: 13px; letter-spacing: 0.24em; color: var(--cyan-400); font-weight: 700; margin-bottom: 12px; }
.site-footer .row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.site-footer .row span { color: rgba(255,255,255,.5); }
.site-footer .bottom { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.4); font-size: 13px; letter-spacing: 0.02em; }
.site-footer .num { font-variant-numeric: tabular-nums; }

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--ink-100); color: var(--ink-700); font-size: 14px; font-weight: 600;
}
.chip.blue { background: rgba(29,78,216,.08); color: var(--blue-600); }
.chip.gold { background: rgba(201,169,106,.14); color: #8b7038; }
.chip.cyan { background: rgba(56,189,248,.15); color: #0284C7; }

/* Portfolio case images (실사진 등록 시) — .case-img-placeholder와 동일한 4/3 비율을 유지해
   실사진 카드와 placeholder 카드의 높이가 동일하도록 한다. before/after 2장은 2열 grid로
   나란히 배치하고, 부모 .case-card의 border-radius + overflow:hidden이 상단 모서리를 잘라준다. */
.case-img {
  aspect-ratio: 4/3;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--ink-200);
}
.case-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.pf-img img { cursor: zoom-in; }
/* before/after 각 사진 절반을 감싸 하단에 구분 라벨을 붙인다 */
.img-half { position: relative; overflow: hidden; }
.img-half .ba-label {
  position: absolute; bottom: 10px; left: 10px; z-index: 2;
  padding: 4px 10px; border-radius: 999px; background: rgba(11,30,63,.85); color: white;
  font-size: 13px; font-weight: 800; letter-spacing: 0.06em;
}
/* case-img-placeholder와 동일한 위치·스타일의 지역/유형 태그·사진개수 배지 —
   실사진 카드에도 붙여 placeholder → 실사진 전환 시 정보가 사라지지 않게 한다. */
.case-img .ph-tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 5px 10px; border-radius: 6px; background: rgba(11,30,63,.85); color: white;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
}

/* Utility */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.stack { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-40 { margin-top: 40px; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--ink-200); margin: 32px 0; }


/* ============ Photo lightbox (시공 사례 사진 확대 모달) ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,13,31,.92); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 24px; gap: 16px;
  opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-body { display: flex; align-items: center; justify-content: center; max-width: 100%; }
.lightbox-img {
  max-width: 92vw; max-height: 78vh; object-fit: contain;
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
/* 시공 전/후 사진을 나란히 비교할 수 있도록 함께 표시.
   원본 사진의 가로세로 비율이 짝마다 미세하게 달라(예: 0.61 vs 0.56) 폭만 맞추면
   높이가 제각각이 되고 라벨 위치도 어긋난다. 두 칸을 같은 크기 상자로 묶고 cover로 채워
   여백 없이 똑같은 크기로 보이게 한다. 비율 차이가 10% 안쪽이라 잘리는 양은 5% 미만이고,
   비율이 같은 짝은 아예 잘리지 않는다. */
.lightbox-compare { display: flex; gap: 12px; align-items: stretch; justify-content: center; }
.lightbox-figure { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1 1 0; min-width: 0; }
.lightbox-figure img {
  width: 100%; max-height: 52vh; object-fit: cover; object-position: center;
  /* 두 칸 중 큰 쪽 높이에 맞춰 늘어나 양쪽 상자 크기가 같아진다. */
  flex: 1 1 auto; min-height: 0;
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.lightbox-figure figcaption {
  font-size: 13px; font-weight: 800; letter-spacing: 0.1em; color: var(--navy-950);
  background: white; padding: 5px 14px; border-radius: 999px;
}
.lightbox-caption {
  color: rgba(255,255,255,.92); font-size: 18px; line-height: 1.6; text-align: center; max-width: 640px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
/* 블로그 원문으로 넘어가는 버튼 — 카드와 같은 .pf-blog-btn 모양을 쓴다.
   캡션이 gap으로 간격을 잡으므로 버튼 자체 위 여백은 지운다. */
.lightbox-caption .pf-blog-btn { margin-top: 0; }
@media (min-width: 768px) {
  .lightbox-figure img { max-height: 68vh; }
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: white;
  display: grid; place-items: center; transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }
.lightbox-close svg { width: 20px; height: 20px; }

/* 사례 넘기기 — 사진 위에 겹치면 좁은 화면에서 사진을 가리므로 아래쪽 한 줄에 모아둔다 */
.lightbox-controls { display: flex; align-items: center; gap: 18px; }
.lightbox-controls[hidden] { display: none; }
.lightbox-nav {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: white;
  display: grid; place-items: center; transition: background .15s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.22); }
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-counter {
  color: rgba(255,255,255,.6); font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: 0.06em; min-width: 52px; text-align: center;
}

@media (min-width: 768px) {
  h1.display { font-size: 60px; }
  h2.section-title { font-size: 43px; }
  section { padding: 96px 0; }
}

/* ============ 전화 아이콘 (사이트 공통) ============ */
/* 파란 동그라미 안에 흰색 수화기. 어느 버튼에 놓여도 같은 모양이 되게 한다. */
.tel-ico {
  flex: none;
  width: 20px; height: 20px;
  padding: 7px; box-sizing: content-box;
  background: #3178F5; color: white; border-radius: 50%;
}


/* ============ 시공 사례 블로그 버튼 (홈 후기 카드 · 시공 사례 카드 공통) ============ */
/* 시공 사례 블로그 글로 보내는 버튼 (네이버 블로그 초록) */
.pf-blog-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 16px; padding: 13px 16px; border-radius: 16px;
  background: #03C75A; color: white; font-weight: 800; font-size: 17px;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 20px rgba(3,199,90,.26);
  transition: background .15s ease, transform .15s ease;
}
.pf-blog-btn:hover { background: #02B152; transform: translateY(-1px); }
.pf-blog-btn:active { transform: scale(.99); }
/* 흰 말풍선 안에 주황 'blog' — 네이버 블로그 아이콘 모양 */
.pf-blog-ico {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 36px; height: 27px; border-radius: 9px;
  background: white; color: #F97316;
  font-size: 14px; font-weight: 800; letter-spacing: -0.03em;
}
.pf-blog-ico::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid white;
}
/* 홈 후기 카드는 세로 flex라 버튼을 카드 바닥에 붙일 수 있다 */
.pf-body .pf-blog-btn { margin-top: auto; }
