/* ============================================================
   PORTFOLIO — 미니멀 아티스트 포트폴리오
   블랙 갤러리 / 세리프 타이포 / 반전 커서 / 3D 틸트 / 그레인
   ============================================================ */

:root {
  --paper: #0d0d0c;      /* 잉크 블랙 배경 */
  --ink: #ebe8e1;        /* 따뜻한 오프화이트 텍스트 */
  --ink-soft: #8b887f;
  --line: rgba(235, 232, 225, 0.14);
  --accent: #4a5bff;     /* 클라인 블루 (다크 대응) */
  --serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  --sans: "Noto Sans KR", -apple-system, "Malgun Gothic", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
  cursor: none;
}

.serif { font-family: var(--serif); }

a { color: inherit; text-decoration: none; cursor: none; }
ul { list-style: none; }

::selection { background: var(--accent); color: var(--paper); }

/* ------------------------------------------------------------
   반전 커서 — mix-blend-mode: difference
   ------------------------------------------------------------ */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease;
}
body.cursor-hover .cursor { width: 56px; height: 56px; }
@media (hover: none), (pointer: coarse) {
  body, a { cursor: auto; }
  .cursor { display: none; }
}

/* ------------------------------------------------------------
   필름 그레인
   ------------------------------------------------------------ */
.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.05;
}

/* ------------------------------------------------------------
   내비게이션
   ------------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 8000;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.6rem clamp(1.4rem, 5vw, 4rem);
  mix-blend-mode: difference;
  color: #fff;
}
.nav-name {
  font-size: 1rem;
  letter-spacing: 0.14em;
  font-weight: 400;
}
.nav-right { display: flex; gap: clamp(1.2rem, 3vw, 2.4rem); }
.nav-right a {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  position: relative;
}
.nav-right a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-right a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
@media (max-width: 480px) {
  .nav { padding: 1.2rem 1.1rem; }
  .nav-name { font-size: 0.82rem; letter-spacing: 0.1em; }
  .nav-right { gap: 0.9rem; }
  .nav-right a { font-size: 0.7rem; }
}

/* ------------------------------------------------------------
   HERO — 구조적 그리드 컴포지션 (Ikeda / Manabe 스타일)
   ------------------------------------------------------------ */
.hero {
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  font-family: var(--sans);
}

/* 구조 라인 */
.hero-frame i {
  position: absolute;
  background: var(--line);
}
.fv { top: 0; bottom: 0; width: 1px; }
.fh { left: 0; right: 0; height: 1px; }

/* 마우스 크로스헤어 */
.xhair {
  position: absolute;
  background: rgba(235, 232, 225, 0.22);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}
.xhair-h { left: 0; right: 0; height: 1px; top: 0; }
.xhair-v { top: 0; bottom: 0; width: 1px; left: 0; }
.hero:hover .xhair { opacity: 1; }
@media (hover: none), (pointer: coarse) {
  .xhair { display: none; }
}

/* 셀 공통 — 스태거 등장 */
.hero-cell {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
body.loaded .hero-cell { opacity: 1; transform: translateY(0); }
body.loaded .hc-id     { transition-delay: 0.1s; }
body.loaded .hc-index  { transition-delay: 0.25s; }
body.loaded .hc-data   { transition-delay: 0.4s; }
body.loaded .hc-coords { transition-delay: 0.55s; }
body.loaded .hc-scroll { transition-delay: 0.7s; }

/* 이름 셀 */
.hc-id {
  left: clamp(1.4rem, 4vw, 3rem);
  top: calc(30% + 1.6rem);
}
.hc-num { color: var(--accent); }
.hc-name {
  font-size: clamp(1.5rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.32em;
  color: var(--ink);
  line-height: 1.2;
}
.hc-role { letter-spacing: 0.3em; }

/* 인덱스 셀 */
.hc-index {
  right: clamp(1.4rem, 4vw, 3rem);
  top: calc(30% + 1.6rem);
  text-align: right;
  align-items: flex-end;
}
.hc-blue { color: var(--accent); }

/* 데이터 스트립 셀 */
.hc-data {
  left: 24%;
  right: 24%;
  top: 50%;
  gap: 0.7rem;
}
#dataStrip {
  display: block;
  width: 100%;
  height: 64px;
}
.hc-data-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* 좌표 셀 */
.hc-coords {
  left: clamp(1.4rem, 4vw, 3rem);
  bottom: calc(28% + 1.6rem);
}

/* 스크롤 셀 */
.hc-scroll {
  right: clamp(1.4rem, 4vw, 3rem);
  bottom: calc(28% + 1.6rem);
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(5px); } }

@media (max-width: 720px) {
  .fv:nth-child(1), .fv:nth-child(3) { display: none; }
  .hc-data { left: clamp(1.4rem, 4vw, 3rem); right: clamp(1.4rem, 4vw, 3rem); }
  .hc-index { display: none; }
  .hc-name { letter-spacing: 0.2em; }
}

/* ------------------------------------------------------------
   마퀴
   ------------------------------------------------------------ */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  animation: marquee 24s linear infinite;
}
.marquee-track span {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.35em;
  color: var(--ink-soft);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ------------------------------------------------------------
   섹션 공통
   ------------------------------------------------------------ */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(6rem, 14vh, 10rem) clamp(1.4rem, 5vw, 3rem);
}
.section-label {
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.section-label .num {
  font-family: var(--serif);
  color: var(--accent);
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
}

/* 리빌 */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ------------------------------------------------------------
   사진 플레이스홀더
   ------------------------------------------------------------ */
.ph {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background: #161614;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-align: center;
}

/* 3D 틸트 — 마우스를 따라 기울어짐 */
[data-tilt] {
  will-change: transform;
  transform-style: preserve-3d;
}
[data-tilt] > * {
  transform: translateZ(30px);
}
[data-tilt]:hover {
  border-color: rgba(74, 91, 255, 0.55);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.ph-mark {
  font-size: 1.6rem;
  color: var(--accent);
  animation: spinSlow 14s linear infinite;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
.ph-text {
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  line-height: 2;
  text-transform: uppercase;
}
.ph-portrait { aspect-ratio: 3 / 4; }

/* ------------------------------------------------------------
   GALLERY — 3D 구 캐러셀 (지구본 궤도)
   ------------------------------------------------------------ */
.section-gallery { max-width: 1300px; }
.orbit {
  position: relative;
  height: min(72vh, 620px);
  perspective: 1300px;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.orbit.dragging { cursor: grabbing; }

/* 와이어프레임 구 — JS가 크기와 회전을 제어 */
.orbit-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  pointer-events: none;
}
.orbit-stage i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(235, 232, 225, 0.09);
  border-radius: 50%;
}
.orbit-stage i:nth-child(1) { transform: rotateY(0deg); }
.orbit-stage i:nth-child(2) { transform: rotateY(30deg); }
.orbit-stage i:nth-child(3) { transform: rotateY(60deg); }
.orbit-stage i:nth-child(4) { transform: rotateY(90deg); }
.orbit-stage i:nth-child(5) { transform: rotateY(120deg); }
.orbit-stage i:nth-child(6) { transform: rotateY(150deg); }
.orbit-stage i.lat { transform: rotateX(90deg); border-color: rgba(74, 91, 255, 0.22); }

/* 궤도 카드 — 전부 동일 사이즈, JS가 위치/깊이 제어 */
.orbit-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(92px, 17vw, 190px);
  margin: 0;
  will-change: transform, opacity;
  cursor: pointer;
}
.orbit-card .ph {
  aspect-ratio: 3 / 4;
  height: auto;
  min-height: 0;
  background: #141412;
  transition: border-color 0.3s;
}
.orbit-card:hover .ph { border-color: rgba(74, 91, 255, 0.6); }
.orbit-card figcaption {
  margin-top: 0.7rem;
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.orbit-hint {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   라이트박스 — 작품별 여러 장
   ------------------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(13, 13, 12, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 3vw, 2.5rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-body {
  width: min(78vw, 860px);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.lb-slide { height: min(62vh, 560px); }
.lb-slide .ph { height: 100%; }
.lb-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.lb-info {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.lb-close, .lb-arrow {
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--serif);
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s, transform 0.3s;
  padding: 0.6rem;
}
.lb-close:hover, .lb-arrow:hover { color: var(--accent); }
.lb-close {
  position: absolute;
  top: 1.2rem;
  right: 1.6rem;
  font-size: 2.2rem;
  font-weight: 300;
}
.lb-arrow { font-size: 2.6rem; }
.lb-arrow:hover { transform: scale(1.2); }

@media (max-width: 720px) {
  .orbit { height: min(64vh, 480px); }
  .lightbox { gap: 0.2rem; }
  .lb-body { width: 80vw; }
  .lb-slide { height: 52vh; }
}

/* ------------------------------------------------------------
   ABOUT
   ------------------------------------------------------------ */
.about {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about-statement {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  font-weight: 300;
  line-height: 1.9;
  margin-bottom: 2rem;
  color: var(--ink);
}
.about-text {
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: 2.6rem;
}
.about-cv { border-top: 1px solid var(--line); }
.about-cv > div {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.about-cv dt {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.about-cv dd { color: var(--ink); }

@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 280px; }
}
.about-photo { perspective: 900px; }

/* ------------------------------------------------------------
   CONTACT & FOOTER
   ------------------------------------------------------------ */
.section-contact { text-align: center; }
.section-contact .section-label { justify-content: center; }
.section-contact .section-label::after { display: none; }
.contact-lead {
  font-size: clamp(1.7rem, 5vw, 3.2rem);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 3rem;
}
.contact-email {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 3.5vw, 1.9rem);
  font-style: italic;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.2rem;
  transition: color 0.35s, border-color 0.35s;
}
.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.contact-links {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.4rem 2.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.contact-links a {
  color: var(--ink-soft);
  transition: color 0.3s;
}
.contact-links a:hover { color: var(--accent); }

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 1.8rem clamp(1.4rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.footer a { transition: color 0.3s; }
.footer a:hover { color: var(--accent); }

/* ------------------------------------------------------------
   모션 최소화 설정 존중
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .line-inner { transform: none; }
}
