@import url('./tokens.css');

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--void-black);
  font-family: var(--font-body), system-ui, sans-serif;
  /* 한글 어절 중간 끊김 방지 — keep-all은 반드시 overflow-wrap과 짝으로
     (긴 토큰: URL·이메일·사업자번호가 칸을 밀어내지 않도록 안전판) */
  word-break: keep-all;
  overflow-wrap: break-word;
}
a {
  color: var(--fog-white);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes heroReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* ---------- buttons (design-system Button.jsx spec) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body), sans-serif;
  font-weight: 500;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: opacity var(--duration-control) var(--ease-journey),
              background var(--duration-control) var(--ease-journey);
  border: none;
  text-decoration: none;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary {
  background: var(--signal-amber);
  color: var(--accent-text);
}
.btn-secondary {
  background: transparent;
  color: var(--fog-white);
  border: 1px solid var(--fog-white);
  transition: background-color var(--duration-control) var(--ease-journey), color var(--duration-control) var(--ease-journey);
}
.btn-secondary:hover {
  background-color: #F5A623;
  border-color: #F5A623;
  color: var(--void-black);
}
.btn-sm { padding: 10px 20px; font-size: var(--text-caption); }
.btn-md { padding: 16px 32px; font-size: var(--text-small); }

/* ---------- nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 헤더 높이는 6페이지 공통 상수 — 내용물이 달라도(예: /quote 는 nav CTA 없음)
     min-height 로 고정. box-sizing:border-box 라 padding 포함 총높이다.
     패딩은 이 규칙에서만 정의한다 — 변형(--solid)이 재정의하면 미디어쿼리보다
     특정도가 높아져 모바일 축소가 무시된다(과거 결함) */
  min-height: 86px;
  padding: 24px 48px;
  background: transparent;
  transition: background var(--duration-reveal) var(--ease-journey);
}
.site-nav.is-scrolled { background: var(--void-black); }
/* 내부 페이지 공용 변형 — 항상 불투명(스크롤 연동 없음).
   배경·구분선만 담당하고 크기는 .site-nav 를 그대로 따른다.
   styles.css 에 두는 이유: about.css 에 있던 탓에 about.css 를 로드하지 않는
   privacy 는 클래스만 붙고 규칙이 없어 헤더가 투명하게 방치됐다.
   구분선은 inset box-shadow — border 와 달리 높이에 1px 을 더하지 않는다 */
.site-nav--solid {
  background: rgba(11, 11, 12, .9);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 -1px 0 var(--border-on-dark);
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 22px;
}
/* 로고 링크 터치 영역 18→46px — 음수 마진 상쇄로 시각 레이아웃 불변 */
.nav-left > a {
  display: inline-flex;
  padding: 14px;
  margin: -14px;
}
.nav-logo {
  height: 18px;
  display: block;
  filter: brightness(0) invert(1);
}
.nav-divider {
  width: 1px;
  height: 18px;
  background: rgba(244, 243, 239, .24);
}
.nav-social {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-social a {
  position: relative;
  display: flex;
  color: rgba(244, 243, 239, .7);
  transition: color var(--duration-control) var(--ease-journey);
  /* 터치 영역 18→44px — 패딩만큼 음수 마진으로 상쇄해 시각 레이아웃 불변 */
  padding: 13px;
  margin: -13px;
}
.nav-social a:hover {
  color: var(--fog-white);
  text-decoration: none;
}

/* tooltip (CSS-only, ::before = label) — 상자·화살표·그림자 없이 텍스트만 */
.nav-social a::before {
  content: attr(data-tooltip);
  position: absolute;
  /* 링크에 터치영역용 padding 13px 이 있어 100% = 아이콘 하단 + 13px.
     -3px 로 상쇄해 아이콘 하단에서 10px 아래 (기존 상자 30px → 10px) */
  top: calc(100% - 3px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  color: var(--fog-white);
  font: 500 11.5px var(--font-body), sans-serif;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s var(--ease-journey),
              transform .2s var(--ease-journey),
              visibility .2s;
}
.nav-social a:hover::before,
.nav-social a:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-body), sans-serif;
  font-size: var(--text-small);
}
.nav-links a {
  font-size: 14px;
  color: rgba(244, 243, 239, .82);
}

/* ---------- mobile hamburger + slide-in menu (모바일 전용, 데스크톱 숨김) ---------- */
.nav-toggle {
  display: none; /* 데스크톱: 숨김. 900px 이하에서 flex로 표시 */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 40;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 auto;
  background: var(--fog-white);
}
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(6, 6, 7, .6);
  opacity: 0;
  transition: opacity .3s var(--ease-journey);
}
.nav-scrim.is-open { opacity: 1; }
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 50;
  width: 78%;
  max-width: 340px;
  background: var(--void-black);
  border-left: 1px solid var(--border-on-dark);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .5);
  padding: 84px 30px 40px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .32s var(--ease-journey), visibility .32s;
  will-change: transform;
}
.mobile-menu.is-open {
  transform: translateX(0);
  visibility: visible;
}
.mobile-menu a {
  font: 500 19px var(--font-body), sans-serif;
  color: var(--fog-white);
  padding: 17px 4px;
  border-bottom: 1px solid var(--border-on-dark);
}
.mobile-menu a.is-current { color: var(--signal-amber); }
.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--fog-white);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
body.nav-open { overflow: hidden; } /* 패널 열릴 때 배경 스크롤 잠금 */
@media (prefers-reduced-motion: reduce) {
  .nav-scrim, .mobile-menu, .permit-badge { transition: none; }
}

/* ---------- hero (CH.01) ---------- */
.hero-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--void-black);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 120px 48px 96px;
}
.hero-photo {
  position: absolute;
  top: -10%; left: 0; right: 0;
  height: 120%;
  will-change: transform;
  background-color: #141416;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-position: center 30%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 2s var(--ease-journey);
}
.hero-slide.is-active { opacity: 1; }
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(11,11,12,.5) 0%,
    rgba(11,11,12,.06) 26%,
    rgba(11,11,12,.12) 52%,
    rgba(11,11,12,.9) 100%);
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  opacity: 0;
  transform: translateY(24px);
  animation: heroReveal var(--duration-reveal) var(--ease-journey) both;
}
.hero-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--fog-white);
  margin: 0;
}
.hero-rule {
  height: 2px;
  width: 120px;
  background: rgba(244, 243, 239, .55);
  margin: 30px 0 0;
}
.hero-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono), monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .22em;
  color: rgba(244, 243, 239, .5);
}

/* ---------- shared section chrome ---------- */
.chapter-split {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.chapter-copy {
  padding: 120px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.chapter-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: clamp(30px, 3.4vw, 52px);
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--fog-white);
  margin: 0;
}
.chapter-rule {
  height: 3px;
  width: 104px;
  background: var(--signal-amber);
  margin: 30px 0 26px;
}
.chapter-body {
  font: 400 18px/1.75 var(--font-body), sans-serif;
  color: rgba(244, 243, 239, .7);
  margin: 0;
  max-width: 520px;
}
.chapter-photo {
  position: relative;
  background-color: #141416;
  overflow: hidden;
}
.chapter-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- CH.02 개입 ---------- */
.section-about { background: var(--void-black); }
.permit-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}
/* permits.html #licenses 로 이동하는 링크 — 박스 전체가 터치 영역이 되도록 block 계열로 둔다 */
.permit-badge {
  display: inline-block;
  font: 500 14px var(--font-mono), monospace;
  color: rgba(244, 243, 239, .82);
  border: 1px solid var(--border-on-dark);
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.permit-badge:hover,
.permit-badge:focus-visible {
  text-decoration: none;  /* 전역 a:hover 밑줄 해제 — 박스형 배지라 테두리·배경으로만 신호 */
  border-color: var(--signal-amber);
  background-color: rgba(244, 243, 239, .06);
  color: var(--fog-white);
}

/* ---------- CH.03 이동 ---------- */
.section-journey { background: #0f0f11; }
.stat-row {
  display: flex;
  gap: 40px;
  margin-top: 48px;
}
.stat-value {
  font: var(--weight-heading) clamp(22px, 6.5vw, 44px) var(--font-heading);
  color: var(--fog-white);
  line-height: 1;
  white-space: nowrap;
}
.stat-label {
  font: 400 15px var(--font-body), sans-serif;
  color: rgba(244, 243, 239, .55);
  margin-top: 8px;
}

/* ---------- CH.04 증명 ---------- */
.section-proof {
  position: relative;
  min-height: 100vh;
  background: var(--void-black);
  padding: 120px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.section-proof .chapter-title { max-width: 820px; }
.proof-lede {
  font: 400 18px/1.75 var(--font-body), sans-serif;
  color: rgba(244, 243, 239, .66);
  margin: 26px 0 0;
  max-width: 600px;
}
.proof-grid {
  display: grid;
  /* 고정 3단 → 칸 폭 240px 하한으로 자동 접기 (901~1100px 압축 구간 대응) */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 56px;
}
.proof-card {
  border: 1px solid var(--border-on-dark);
  border-top: 3px solid var(--border-on-dark);
  padding: 36px;
}
.proof-card.is-accent { border-top-color: var(--signal-amber); }
.proof-card-index {
  font: 500 14px var(--font-mono), monospace;
  color: var(--steel-gray);
  margin-bottom: 16px;
}
.proof-card-title {
  font: 700 24px var(--font-display), sans-serif;
  color: var(--fog-white);
}
.proof-card-body {
  font: 400 16px/1.6 var(--font-body), sans-serif;
  color: rgba(244, 243, 239, .55);
  margin: 14px 0 0;
}
.proof-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border-on-dark);
}
.proof-cta-text {
  font: 400 19px/1.5 var(--font-body), sans-serif;
  color: var(--fog-white);
}

/* ---------- footer (shared across all pages) ---------- */
.site-footer {
  background: var(--void-black);
  padding: 44px 80px;
  border-top: 1px solid var(--border-on-dark);
  display: flex;
  flex-wrap: wrap;
  /* 우측 열이 2줄(링크+저작권)이라 center 면 워드마크가 그 중간에 걸려
     링크와 눈높이가 어긋난다 → 첫 줄끼리 맞도록 flex-start */
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 32px;
}
.site-footer-wordmark {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: 15px;
  color: var(--fog-white);
  opacity: .7;
}
/* 1행 우측 열 — 개인정보처리방침 링크 + 그 아래 저작권 */
.site-footer-side { text-align: right; }
/* 2행: 사업자정보. flex-basis 100%로 워드마크/우측열 줄 아래에 단독 행을 차지한다
   (border-top 없이 margin-top만 — .site-footer의 row-gap 16px에 8px 추가) */
.site-footer-legal {
  flex: 0 0 100%;
  margin-top: 8px;
  font: 400 13px/1.7 var(--font-mono), monospace;
  color: var(--steel-gray);
}
/* 저작권은 법적 표시 중 부수 항목 — 크기만 한 단계 낮춰 위계를 만든다.
   색은 steel-gray 유지: void-black 대비 2.32:1 / partnership --raised(#0f0f11) 대비 2.26:1 로
   이미 여유가 없어 opacity 를 더 걸면 어두운 배경에서 읽히지 않는다.
   (.site-footer-legal 밖으로 나왔으므로 font·color 를 직접 선언한다) */
.site-footer-copyright {
  margin-top: 6px;
  font: 400 12px/1.7 var(--font-mono), monospace;
  color: var(--steel-gray);
}
/* 전화번호·사업자등록번호 등 하이픈 토큰이 줄바꿈에서 쪼개지지 않도록 (푸터 HTML의 span.nb)
   — body의 overflow-wrap: break-word 안전판이 하이픈에서 끊는 것을 막는다 */
.site-footer .nb { white-space: nowrap; }
.site-footer-link {
  font: 500 13px var(--font-body), sans-serif;
  color: var(--steel-gray);
  white-space: nowrap;
  /* 터치 영역 15→45px — 음수 마진 상쇄로 시각 레이아웃 불변 */
  padding: 15px 0;
  margin: -15px 0;
}
.site-footer-link:hover { color: var(--fog-white); }
/* 데스크톱(>900px): 2열 그리드 — 좌측(워드마크+사업자정보 한 덩어리) / 우측(링크+저작권, 2행 스팬).
   flex 였을 때는 우측이 2줄이라 1행이 커지며 워드마크 아래가 비었다.
   base(flex)·모바일(≤900px) 규칙은 손대지 않는다 — 이 블록이 통째로 없으면 배포본과 동일하게 폴백.
   row-gap 12px: flex 시절 16px+legal margin 8px(=24px)는 한 덩어리가 되면 과해서 줄임 */
@media (min-width: 901px) {
  .site-footer {
    display: grid;
    /* minmax(0,1fr): 좌측이 min-content 아래로도 줄어 우측 저작권(약 375px)이 항상 한 줄 유지 */
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 32px;
  }
  .site-footer-legal { grid-column: 1; margin-top: 0; } /* flex-basis 100%는 그리드에서 무시됨 */
  .site-footer-side { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .chapter-split { grid-template-columns: 1fr; min-height: auto; }
  .chapter-photo { min-height: 320px; }
  .chapter-copy { padding: 64px 24px; }
  .proof-grid { grid-template-columns: 1fr; }
  .site-nav { min-height: 76px; padding: 16px 20px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .stat-row { gap: 20px; }
  .permit-badge { padding: 13px 16px; }  /* 터치 영역 44px 확보 */
  .nav-social a::before { display: none; }
  .hero-section { padding: 96px 24px 72px; }
  .section-proof { padding: 96px 24px; }
  .site-footer { padding: 32px 24px; }
  /* 좁은 폭에서 저작권(약 51자)이 우측 열 안에서 2~3줄로 접히며 우측 정렬 래그가 생기고,
     바로 아래 좌측 정렬 사업자정보와 정렬이 엇갈린다 → 저작권만 한 행을 차지하고 좌측 정렬.
     display:contents 로 우측 열 상자만 걷어내 링크는 워드마크와 같은 줄에 남긴다
     (미지원 브라우저는 규칙이 통째로 무시돼 데스크톱과 같은 우측 정렬로 폴백) */
  .site-footer-side { display: contents; }
  .site-footer-copyright { flex: 0 0 100%; text-align: left; margin-top: 0; }
}
