/* THE INSTALLATION — REBUILD (독립 프로토타입) */
:root {
  --bg: #0b1320;
  --ink: #eef0f2;
  --muted: #9aa6b2;
  --line: rgba(238, 240, 242, 0.18);
  --accent: #e2b86b;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.site { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 48px); pointer-events: none; }
.site > * { pointer-events: auto; }
.site__brand { font-weight: 700; letter-spacing: 0.02em; font-size: 1rem; }
.site__nav { display: flex; gap: 6px; }
.site__nav a { text-decoration: none; font-size: 0.8125rem; padding: 9px 14px; border: 1px solid transparent; }
.site__nav .site__cta { border-color: var(--line); background: rgba(11, 19, 32, 0.5); backdrop-filter: blur(6px); }

/* Hero: 긴 스크롤 구간 + sticky 무대 */
.hero { position: relative; height: 760vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(7, 11, 18, 0.62) 0%, rgba(7, 11, 18, 0.28) 32%, rgba(7, 11, 18, 0) 55%); }
.copy, .zone-tag, .progress, .scroll-hint { z-index: 1; }

.copy { position: absolute; left: clamp(16px, 6vw, 96px); top: 50%; transform: translateY(calc(-50% + var(--dy, 0px))); max-width: 460px; opacity: 0; pointer-events: none; will-change: opacity, transform; }
.copy.is-on { pointer-events: auto; }
/* 첫 장면 문구 · CTA 는 3D 준비 전(느린 망 · 스크립트 실패)에도 바로 표시.
 * 준비되면 main.js 가 진행률에 맞춰 인라인 opacity 로 이어받음 — 진행률 0 에서는 값이 같아(1, --dy 0) 깜빡임 없음 */
.copy--intro { opacity: 1; }
html:not(.is-ready) .copy--intro { pointer-events: auto; }
.eyebrow, .copy__no { font-size: 0.75rem; letter-spacing: 0.22em; color: var(--accent); margin-bottom: 14px; }
.copy__brand { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.copy__lead { margin-top: 14px; font-size: clamp(1.05rem, 1.8vw, 1.35rem); color: #d7dce1; }
.copy h2 { font-size: clamp(1.6rem, 3.2vw, 2.6rem); font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
.copy p { color: #c4ccd4; line-height: 1.6; }
.copy--scene p:not(.copy__no) { margin-top: 12px; font-size: 1rem; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; background: var(--ink); color: #0b1320; text-decoration: none; font-weight: 600; font-size: 0.9375rem; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid rgba(238, 240, 242, 0.45); }

.zone-tag { position: absolute; left: 0; top: 0; font-size: 0.6875rem; letter-spacing: 0.16em; color: var(--accent); border-left: 1px solid var(--accent); padding: 2px 8px; opacity: 0; white-space: nowrap; pointer-events: none; }
.progress { position: absolute; right: clamp(16px, 4vw, 48px); top: 50%; transform: translateY(-50%); list-style: none; display: grid; gap: 14px; font-size: 0.625rem; letter-spacing: 0.18em; color: var(--muted); text-align: right; }
.progress li { opacity: 0.45; transition: opacity 0.2s; }
.progress li::after { content: ""; display: inline-block; width: 18px; height: 1px; margin-left: 10px; vertical-align: middle; background: currentColor; }
.progress li.is-on { opacity: 1; color: var(--ink); }
.scroll-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 0.6875rem; letter-spacing: 0.3em; color: var(--muted); }

/* 정적 Hero (WebGL 불가 · 애니메이션 로드 실패 · 동작 줄이기) */
.static-art { display: none; position: absolute; right: 6vw; top: 50%; transform: translateY(-50%); width: min(56vw, 760px); color: #7fa6cc; }
.static-art__sign { stroke: var(--accent); fill: rgba(226, 184, 107, 0.12); }
html.is-static .hero { height: auto; }
html.is-static .stage { position: relative; height: 100vh; height: 100svh; background: radial-gradient(ellipse at 70% 40%, #14233a, var(--bg) 70%); }
html.is-static .stage__canvas, html.is-static .progress, html.is-static .scroll-hint, html.is-static .zone-tag, html.is-static .copy--scene, html.is-static .copy--final { display: none; }
html.is-static .static-art { display: block; }
html.is-static .copy--intro { opacity: 1; pointer-events: auto; --dy: 0px; }

/* 이어지는 섹션 */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 48px); }
.work { padding: 120px 0 100px; background: var(--bg); }
.work h2, .contact h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 650; }
.work__note { margin-top: 12px; color: var(--muted); }
.work__grid { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.work__card { aspect-ratio: 4 / 5; border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: 0.875rem; }
.contact { padding: 100px 0 140px; border-top: 1px solid var(--line); }
.contact p { margin-top: 14px; color: var(--muted); }

@media (max-width: 767px), (max-aspect-ratio: 17/20) {
  .stage::after { background: linear-gradient(180deg, rgba(7, 11, 18, 0.66) 0%, rgba(7, 11, 18, 0.2) 34%, rgba(7, 11, 18, 0) 50%, rgba(7, 11, 18, 0) 70%, rgba(7, 11, 18, 0.5) 100%); }
  .copy { top: 84px; transform: translateY(var(--dy, 0px)); right: 16px; max-width: none; }
  .copy--final { top: auto; bottom: 64px; }
  .copy--intro { top: 96px; }
  .copy h2 { font-size: 1.55rem; }
  .copy--scene p:not(.copy__no) { font-size: 0.9375rem; }
  .progress { top: auto; bottom: 18px; right: 16px; transform: none; grid-auto-flow: column; gap: 6px; }
  .progress li { font-size: 0; }
  .progress li::after { width: 22px; margin: 0; height: 2px; }
  .scroll-hint { display: none; }
  .static-art { left: 16px; right: 16px; top: auto; bottom: 40px; transform: none; width: auto; }
  .work__grid { grid-template-columns: 1fr; }
  .site__nav a:not(.site__cta) { display: none; }
}
