:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, .62);
  --serif: "Libre Caslon Display", Georgia, serif;
  --sans: Inter, "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fs: min(30vh, 17.5vw); /* 큰 이름 글자 크기 */
  --baseline: 41vh;         /* 큰 이름 글자 바닥선 — J 꼬리가 쉬고 있는 책에 가려지지 않는 높이 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); }
html { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
html.grid-mode { overflow: hidden; } /* 펼친 동안은 격자 영역만 스크롤 */
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- 메뉴 ---------- */
.nav {
  position: fixed; z-index: 5; left: 23.3vw; right: 23.4vw; top: 4.6vh; height: 4.4vh;
  display: flex; align-items: center; font: 500 max(11px, .78vw) var(--sans);
}
.logo { display: flex; align-items: center; gap: .7vw; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text strong { font: 400 max(17px, 1.55vw) var(--serif); }
.logo-text small { font: 400 max(8px, .6vw) var(--sans); opacity: .7; margin-top: .25vw; letter-spacing: .02em; }
.nav-links { display: flex; gap: 2.3vw; margin-left: 11.4vw; }
.nav-links a { opacity: .88; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
/* 펼친 상태의 Projects — 밑줄로 지금 보기를 알린다 */
.nav-links a[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* ---------- 큰 이름 ---------- */
.wordmark {
  position: absolute; z-index: 1; left: 0; right: 0; text-align: center;
  top: calc(var(--baseline) - var(--fs) * .8);
  font: 400 var(--fs)/1 var(--serif); letter-spacing: -.02em;
  pointer-events: none; user-select: none;
}
.keywords {
  /* 이름 위에 둔다 — g·y 꼬리와 겹치지 않게 */
  position: absolute; z-index: 1; top: calc(var(--baseline) - var(--fs) * .8 - 2.4vh); left: 0; right: 0;
  display: flex; justify-content: center; flex-wrap: wrap; gap: .6vw 2.1vw;
  font: 500 max(10px, .74vw) var(--sans); opacity: .9; pointer-events: none;
}
.hero-text {
  position: absolute; top: 0; left: 0; right: 0; height: 100vh; z-index: 1; pointer-events: none;
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.grid-mode .hero-text { opacity: 0; transform: translateY(-3vh); }

/* ---------- 펼치기 화면 ---------- */
.grid-scroll {
  position: fixed; inset: 0; z-index: 3; overflow-y: auto; overscroll-behavior: contain;
  display: none; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.grid-mode .grid-scroll { display: block; }
.grid-fade { position: fixed; left: 0; right: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease); }
.grid-fade-top { top: 0; height: 15vh; background: linear-gradient(#000 45%, transparent); }
.grid-fade-bottom { bottom: 0; height: 13vh; background: linear-gradient(transparent, #000 75%); }
.grid-mode .grid-fade, .scrolled .grid-fade-top { opacity: 1; }

/* ---------- 페이지 · 맨 아래 연락처 ---------- */
.page { position: relative; }
.contact {
  position: relative; z-index: 3; padding: 14vh 0 18vh; margin: 0 23.4vw 0 23.3vw;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.contact-eyebrow { font: 500 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.contact-name { margin-top: 20px; font: 400 clamp(48px, 7vw, 120px)/1 var(--serif); letter-spacing: -.02em; }
.contact-role { margin-top: 14px; color: var(--muted); font-size: 15px; }
.contact-about { margin-top: 48px; max-width: 40em; word-break: keep-all; }
.about-school { color: var(--muted); font-size: 14px; }
.about-lead { margin-top: 14px; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.6; letter-spacing: -.01em; }
.about-text { margin-top: 14px; color: rgba(255, 255, 255, .78); font-size: 15px; line-height: 1.8; }
.about-skills { margin-top: 22px; display: grid; gap: 8px; }
.about-skills li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.6; }
.about-skills li::before { content: ""; position: absolute; left: 0; top: .8em; width: 6px; height: 1px; background: var(--muted); }
.contact-list { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px 24px; }
.contact-list dt { font: 500 12px var(--sans); letter-spacing: .08em; color: var(--muted); }
.contact-list dd { margin-top: 10px; display: grid; gap: 6px; font-size: 16px; }
.contact-list a { width: fit-content; border-bottom: 1px solid rgba(255, 255, 255, .25); transition: border-color .2s; }
.contact-list a:hover { border-color: #fff; }
.contact-foot { margin-top: 72px; font-size: 12px; color: rgba(255, 255, 255, .4); }
.grid-scroll .contact { margin-top: 0; }

/* ---------- 3D 캔버스 ---------- */
.stage {
  position: fixed; inset: 0; z-index: 2; width: 100%; height: 100%; display: block;
  transition: opacity .3s var(--ease); /* view.js SWITCH_SECONDS 와 맞춘다 */
}
.switching .stage { opacity: 0; }

.noscript { position: fixed; bottom: 24px; left: 24px; z-index: 9; }

/* ---------- 휴대폰 ---------- */
@media (max-width: 760px) {
  .nav { left: 5vw; right: 5vw; top: 2.5vh; }
  .nav-links { margin-left: auto; } /* 휴대폰은 Projects 만 */
  .nav-links a:not([data-open="projects"]) { display: none; }
  :root { --fs: 19vw; }
  .wordmark { top: 18vh; }
  .keywords { top: 12vh; padding: 0 8vw; gap: 6px 14px; }
  .contact { margin: 0 6vw; padding: 10vh 0 16vh; }
}

