/* 31NS-Tech 3D 사옥 — 화면 위 글자 · 메뉴(3D 장면은 hq.js) */
:root {
  --night: #0a0a0b;
  --paper: #f5f5f7;
  --muted: rgba(245, 245, 247, .62);
  --line: rgba(245, 245, 247, .16);
  --glass: rgba(16, 17, 20, .92);   /* 뒤를 흐리는 유리 효과(backdrop-filter)는 쓰지 않음: 뒤의 3D 카드가 깜빡임 */
  --teal: #1cc6c3;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--paper);
  /* 밤하늘(3D 화면이 하늘을 직접 그림). 3D를 못 띄울 때도 같은 분위기가 나도록 같은 색 */
  background: linear-gradient(180deg, #02040a 0%, #0a1122 52%, #1c1a26 82%, #2a2020 100%) fixed var(--night);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#hq-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* 상단 */
.hq-top {
  position: fixed; inset: 0 0 auto; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
  pointer-events: none;
}
.hq-top > * { pointer-events: auto; }
.hq-brand img { display: block; width: 132px; height: auto; }
.hq-top-actions { display: flex; gap: 8px; }
.hq-chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass);
  font-size: 13px; text-decoration: none; cursor: pointer;
}
.hq-chip:hover { border-color: rgba(245, 245, 247, .4); }
.hq-chip[hidden] { display: none; }

/* 첫 화면 문구 */
.hq-intro {
  position: fixed; left: clamp(16px, 5vw, 64px); bottom: clamp(24px, 7vh, 72px); z-index: 2;
  max-width: 440px;
  transition: opacity .5s ease, transform .5s ease;
}
.hq-eyebrow { margin: 0 0 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.hq-intro h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
.hq-intro h1 span { color: rgba(245, 245, 247, .7); }
.hq-lead { margin: 16px 0 24px; font-size: 15px; line-height: 1.6; color: rgba(245, 245, 247, .82); text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }
.hq-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.hq-button {
  min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--night); font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.hq-button:hover:not(:disabled) { transform: translateY(-1px); }
.hq-button:disabled { opacity: .45; cursor: progress; }
.hq-text-button {
  padding: 6px 0; border: 0; background: none; cursor: pointer; font-size: 14px;
  color: rgba(245, 245, 247, .85); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(245, 245, 247, .35);
}
.hq-status { margin: 18px 0 0; font-size: 12px; color: var(--muted); }
.hq-status:empty { display: none; }
.hq-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
body.is-inside .hq-intro { opacity: 0; transform: translateY(12px); pointer-events: none; }

/* 층별 안내판 */
.hq-directory {
  position: fixed; z-index: 2;
  top: 50%; right: clamp(16px, 4vw, 48px); transform: translate(16px, -50%);
  width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow: auto;
  padding: 22px 20px 14px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--glass);
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
body.is-inside .hq-directory, body.no-webgl .hq-directory {
  opacity: 1; visibility: visible; transform: translate(0, -50%);
  transition: opacity .45s ease .15s, transform .45s ease .15s, visibility 0s;
}
.hq-dir-head { padding: 0 4px 12px; border-bottom: 1px solid var(--line); }
.hq-dir-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.hq-floors { list-style: none; margin: 0; padding: 0; }
.hq-floor { border-bottom: 1px solid var(--line); }
.hq-floor:last-child { border-bottom: 0; }
.hq-floor-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 4px;
  border: 0; background: none; text-align: left; cursor: pointer;
}
.hq-floor-no {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  font-variant-numeric: tabular-nums; transition: background .25s, color .25s, border-color .25s;
}
.hq-floor-name { display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 600; }
.hq-floor-name small { font-size: 12px; font-weight: 400; color: var(--muted); }
.hq-floor-btn:hover .hq-floor-no, .hq-floor.is-active .hq-floor-no { border-color: var(--teal); color: var(--teal); }
.hq-floor.is-active .hq-floor-no { background: var(--teal); color: var(--night); }
.hq-floor-links { display: none; padding: 0 4px 16px 58px; }
.hq-floor.is-active .hq-floor-links { display: block; }
.hq-floor-links p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.hq-floor-links a {
  display: flex; justify-content: space-between; align-items: center; padding: 9px 0;
  font-size: 14px; text-decoration: none; border-top: 1px solid rgba(245, 245, 247, .08);
}
.hq-floor-links a::after { content: "↗"; color: var(--muted); }
.hq-floor-links a:hover { color: var(--teal); }
.hq-floor-links a:hover::after { color: var(--teal); }

/* 3D를 쓸 수 없을 때: 안내판만 가운데에 */
body.no-webgl .hq-intro .hq-actions, body.no-webgl .hq-hint { display: none; }

/* 모바일: 안내판은 아래에서 올라오는 시트 */
@media (max-width: 760px) {
  .hq-brand img { width: 96px; }
  .hq-top-actions { gap: 6px; }
  .hq-chip { min-height: 32px; padding: 0 11px; font-size: 12px; }
  /* 건물 위로 글자가 겹치므로 아래쪽을 어둡게 깔아 가독성 확보 */
  body.is-outside::before {
    content: ""; position: fixed; inset: auto 0 0; height: 58vh; z-index: 1; pointer-events: none;
    background: linear-gradient(180deg, rgba(10, 10, 11, 0) 0%, rgba(10, 10, 11, .72) 55%, rgba(10, 10, 11, .9) 100%);
  }
  .hq-intro { right: 16px; max-width: none; }
  .hq-hint { display: none; }
  .hq-directory {
    top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-height: 46vh;
    border-radius: 18px 18px 0 0; transform: translateY(24px);
  }
  body.is-inside .hq-directory, body.no-webgl .hq-directory { transform: none; }
  body.no-webgl .hq-intro { display: none; }
}

/* =====================================================================
   3D 공간 안의 HTML(CSS3D): 층별 전시 패널 · 홀로그램 스크린
   ===================================================================== */
.hq-css3d { position: fixed !important; inset: 0; z-index: 1; pointer-events: none; }
#hq-canvas { z-index: 0; }

/* 안내판의 전시 목록 버튼(2D 링크를 대신함) */
.hq-exhibit-btn {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 9px 0;
  border: 0; border-top: 1px solid rgba(245, 245, 247, .08); background: none; cursor: pointer;
  font-size: 14px; text-align: left;
}
.hq-exhibit-btn::after { content: "→"; color: var(--muted); }
.hq-exhibit-btn:hover, .hq-exhibit-btn:hover::after { color: var(--teal); }
/* 스크린을 볼 때는 안내판을 접어 화면을 비움(데스크톱은 패널을 볼 때도 안내판 유지, 모바일은 패널을 볼 때도 접음) */
body.is-holo .hq-directory { opacity: 0; visibility: hidden; transform: translate(16px, -50%); transition: opacity .3s, transform .3s, visibility 0s linear .3s; }
@media (max-width: 760px) { body.is-focus .hq-directory { opacity: 0; visibility: hidden; transform: translateY(24px); } }

/* 전시 패널(560 × 780px, 월드에서는 약 1.2 × 1.7m): 배경은 투명, 뒤의 유리판 너머 어두운 벽이 바탕이 됨 */
.hx-card {
  box-sizing: border-box; display: flex; flex-direction: column; gap: 18px;
  padding: 44px 42px 38px; overflow: hidden;
  border: 1px solid rgba(245, 245, 247, .22); border-radius: 22px;
  background: transparent;
  color: var(--paper); font-family: var(--font);
  pointer-events: none !important;   /* 클릭은 hq.js가 광선으로 판정(3D로 기울어진 HTML은 브라우저 판정이 어긋남) */
  text-shadow: 0 1px 2px rgba(0, 0, 0, .85), 0 0 18px rgba(0, 0, 0, .6);
  opacity: 0; transition: opacity .6s ease, border-color .3s ease, box-shadow .3s ease;
}
.hx-card.is-in { opacity: 1; }

/* 선택된 패널: 테두리에 형광 청록 네온 */
.hx-card.is-focus {
  border: 3px solid #00ffe0;
  box-shadow: 0 0 6px #00ffe0, 0 0 22px rgba(0, 255, 224, .75), 0 0 60px rgba(0, 255, 224, .4), inset 0 0 22px rgba(0, 255, 224, .3);
  animation: hx-neon 2.4s ease-in-out infinite;
}
@keyframes hx-neon {
  50% { box-shadow: 0 0 4px #00ffe0, 0 0 14px rgba(0, 255, 224, .55), 0 0 40px rgba(0, 255, 224, .25), inset 0 0 14px rgba(0, 255, 224, .2); }
}
body.is-looking, body.is-looking * { cursor: grabbing !important; }
.hx-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hx-eyebrow { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.hx-no { padding: 5px 12px; border: 1px solid rgba(245, 245, 247, .25); border-radius: 999px; font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.hx-label { margin: 0; font-size: 19px; color: var(--muted); }
.hx-title { margin: 0; font-size: 40px; line-height: 1.18; letter-spacing: -.02em; font-weight: 700; }
.hx-title span { color: rgba(245, 245, 247, .62); }
.hx-desc { margin: 0; font-size: 20px; line-height: 1.6; color: rgba(245, 245, 247, .82); }
.hx-list { margin: 0; padding: 18px 0 0; list-style: none; border-top: 1px solid rgba(245, 245, 247, .12); display: grid; gap: 10px; }
.hx-list li { position: relative; padding-left: 22px; font-size: 17px; line-height: 1.5; color: rgba(245, 245, 247, .78); }
.hx-list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); }
.hx-numbered li { font-size: 21px; color: var(--paper); }
.hx-dl { margin: 0; display: grid; gap: 16px; }
.hx-dl dt { font-size: 15px; letter-spacing: .06em; color: var(--teal); margin-bottom: 4px; }
.hx-dl dd { margin: 0; font-size: 19px; line-height: 1.55; color: rgba(245, 245, 247, .85); }
.hx-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.hx-steps li { display: flex; gap: 16px; align-items: baseline; }
.hx-step-no { flex: none; font-size: 15px; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.hx-steps strong { display: block; font-size: 20px; margin-bottom: 2px; }
.hx-steps li span:not(.hx-step-no) { font-size: 16px; line-height: 1.5; color: var(--muted); }
.hx-guide p { margin: 0 0 6px; font-size: 15px; letter-spacing: .06em; color: var(--teal); }
.hx-guide .hx-list { border-top: 0; padding-top: 4px; }
.hx-video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; background: #000; }
.hx-foot { margin-top: auto; display: grid; gap: 18px; }
.hx-meta { margin: 0; padding-top: 16px; border-top: 1px solid rgba(245, 245, 247, .12); font-size: 16px; line-height: 1.5; color: var(--muted); }
.hx-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hx-btn {
  display: inline-flex; align-items: center; min-height: 54px; padding: 0 26px;
  border: 1px solid rgba(245, 245, 247, .3); border-radius: 999px; background: transparent;
  color: var(--paper); font: inherit; font-size: 18px; text-decoration: none; cursor: pointer;
}
.hx-btn.is-hover { border-color: var(--teal); color: var(--teal); }
.hx-btn.hx-primary { background: var(--paper); border-color: var(--paper); color: var(--night); font-weight: 600; }
.hx-btn.hx-primary.is-hover { background: var(--teal); border-color: var(--teal); color: var(--night); }
.hx-accent { border-color: rgba(28, 198, 195, .45); }
.hx-case .hx-title { font-size: 34px; }
.hx-resource .hx-title { font-size: 44px; }

/* 홀로그램 스크린: 아트리움 한가운데 떠 있는 상세 화면 */
.hx-holo {
  box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid rgba(28, 198, 195, .65); border-radius: 16px;
  background: rgba(8, 10, 12, .96);
  box-shadow: 0 0 0 1px rgba(28, 198, 195, .25), 0 0 80px rgba(28, 198, 195, .28), 0 40px 120px rgba(0, 0, 0, .6);
  font-family: var(--font); color: var(--paper);
}
/* 날아가는 동안의 3D 스크린(누를 것 없음) */
.hx-holo-proxy { pointer-events: none !important; opacity: 0; transition: opacity .5s ease; }
.hx-holo-proxy.is-in { opacity: 1; }
/* 도착 후 같은 자리 · 같은 크기의 일반 화면(입력 · 스크롤이 그대로 동작) */
.hx-holo-2d { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; }
.hx-holo-2d.is-parked { visibility: hidden; pointer-events: none; }
.hx-holo-bar { flex: none; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 16px; border-bottom: 1px solid rgba(28, 198, 195, .3); }
.hx-holo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.hx-holo-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-holo-close { min-height: 32px; padding: 0 14px; border: 1px solid rgba(245, 245, 247, .25); border-radius: 999px; background: none; color: var(--paper); font: inherit; font-size: 13px; cursor: pointer; }
.hx-holo-close:hover { border-color: var(--teal); color: var(--teal); }
.hx-holo-frame { flex: 1; width: 100%; border: 0; background: #0a0a0b; }

/* 패널 이동(이전 · 다음): 패널 하나를 볼 때만 */
.hq-nav {
  position: fixed; left: 50%; bottom: clamp(14px, 3vh, 28px); z-index: 3; transform: translate(-50%, 12px);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  opacity: 0; visibility: hidden; transition: opacity .3s, transform .3s, visibility 0s linear .3s;
}
body.is-card .hq-nav { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .3s .2s, transform .3s .2s, visibility 0s; }
.hq-nav-label {
  min-width: 0; padding: 0 14px; min-height: 36px; display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass);
  font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 위쪽 버튼 글자: 넓은 화면은 길게, 좁은 화면은 짧게(세 버튼이 한 줄에 들어가도록) */
.hq-short { display: none; }
@media (max-width: 760px) {
  .hq-long { display: none; }
  .hq-short { display: inline; }
}
.hq-nav .hq-chip { flex: none; white-space: nowrap; }
@media (max-width: 760px) {
  .hq-nav { gap: 6px; }
  .hq-nav-label { flex: 1; font-size: 12px; padding: 0 10px; }
}

/* 단계가 많은 패널(옥상 6단계): 글자를 조금 작게 */
.hx-card.hx-six .hx-title { font-size: 34px; }
.hx-card.hx-six .hx-steps { gap: 11px; }
.hx-card.hx-six .hx-steps strong { font-size: 18px; }
.hx-card.hx-six .hx-steps li span:not(.hx-step-no) { font-size: 14.5px; line-height: 1.45; }

/* 옥상 맨 왼쪽: 무료 다운로드 패널 — 3D 보드 그림과 다운로드 버튼을 돋보이게 */
.hx-card.hx-download { gap: 14px; border-color: rgba(28, 198, 195, .55); }
.hx-card.hx-download .hx-title { font-size: 36px; }
.hx-board { display: block; width: calc(100% + 30px); margin: 2px -15px 0; height: auto; aspect-ratio: 1400 / 788; object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)) drop-shadow(0 0 24px rgba(28, 198, 195, .18)); }
.hx-card.hx-download .hx-desc { font-size: 17px; line-height: 1.55; }
.hx-free { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.hx-free strong { display: inline-block; margin-right: 2px; padding: 2px 10px; border-radius: 999px; background: rgba(28, 198, 195, .16); color: #00ffe0; font-weight: 700; letter-spacing: .04em; }
.hx-btn.hx-btn-download {
  min-height: 62px; padding: 0 34px; font-size: 21px; font-weight: 700;
  background: #00e5cc; border-color: #00e5cc; color: var(--night);
  box-shadow: 0 0 0 1px rgba(0, 255, 224, .5), 0 0 26px rgba(0, 255, 224, .45);
}
.hx-btn.hx-btn-download.is-hover { background: #5dfff0; border-color: #5dfff0; color: var(--night); }

/* 입장 인트로 영상 */
.hq-film { position: fixed; inset: 0; z-index: 10; background: #000; transition: opacity .9s ease; }
.hq-film[hidden] { display: none; }
.hq-film video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hq-film.is-done { opacity: 0; pointer-events: none; }
.hq-film-ui {
  position: absolute; right: clamp(16px, 4vw, 40px); bottom: clamp(16px, 5vh, 40px);
  display: flex; gap: 8px;
}
.hq-film-note {
  position: absolute; left: clamp(16px, 4vw, 40px); bottom: clamp(20px, 5vh, 44px); margin: 0;
  font-size: 11px; color: rgba(245, 245, 247, .55);
}

/* 첫 화면 문구 뒤 은은한 그늘: 뒤의 밝은 상점 · 가로등 빛 위에서도 글자가 읽히게 */
.hq-intro::before {
  content: ""; position: absolute; z-index: -1; inset: -90px -140px -60px -120px;
  background: radial-gradient(closest-side, rgba(4, 6, 12, .62), rgba(4, 6, 12, 0));
  pointer-events: none;
}
