/* ============================================================
   None — 3D 메이커 팀 소개
   흰 배경 · 검정 입체 · 여백 중심 · WebGL 인트로
   신비롭고 빠져드는 흑백 디자인
   ============================================================ */

:root {
  --ink: #f4f4f4;          /* 밝은 글자/요소 */
  --ink-soft: #b6b6b6;     /* 부드러운 회백 */
  --paper: #050505;        /* 검은 배경 */
  --line: #242424;         /* 옅은 선 (검정 위) */
  --muted: #6e6e6e;        /* 회색 보조 텍스트 */
  --max: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   WebGL 배경 캔버스
   ============================================================ */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

/* ============================================================
   인트로 상태 — 콘텐츠를 숨긴 채 시작, 씬 종료 후 드러냄
   ============================================================ */
html.is-intro,
html.is-intro body { height: 100%; overflow: hidden; }

.page {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
}
body.is-ready .page { opacity: 1; transform: none; }

/* 인트로 스킵 안내 — 인트로(html.is-intro) 동안만 보이고, 끝나면 사라짐 */
.intro-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.42);
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease), visibility 0s linear 0.6s;
}
html.is-intro .intro-hint {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s var(--ease) 0.9s, visibility 0s;
}

/* ---------- 진행 표시줄 ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--ink);
  z-index: 100;
  transition: width 0.05s linear;
  opacity: 0;
}
body.is-ready .scroll-progress { opacity: 1; transition: opacity 0.6s 0.6s; }

/* ---------- 내비게이션 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(20px, 5vw, 60px);
  color: var(--ink);
  transition: padding 0.4s var(--ease), opacity 0.6s var(--ease);
  opacity: 0;
}
body.is-ready .nav { opacity: 1; transition-delay: 0.5s; }
.nav.is-scrolled { padding-top: 15px; padding-bottom: 15px; }
.nav__brand {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.nav__links { display: flex; gap: clamp(16px, 2.5vw, 36px); }
.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.82;
  position: relative;
  transition: opacity 0.3s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.3s var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { width: 100%; }

/* ============================================================
   히어로
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px clamp(20px, 5vw, 60px) 96px;
}

.hero__inner {
  position: relative;
  z-index: 5;
  max-width: 900px;
  margin: 0 auto;
}
/* 떠다니는 도형 위에서도 글자가 또렷하도록 부드러운 백드롭 */
.hero__inner::before {
  content: "";
  position: absolute;
  inset: -16% -12%;
  z-index: -1;
  background: radial-gradient(
    64% 60% at 50% 46%,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.62) 44%,
    rgba(0, 0, 0, 0) 80%
  );
  pointer-events: none;
}

.hero__eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  color: var(--muted);
  margin-bottom: 30px;
  padding-left: 0.42em; /* 자간 보정으로 시각적 중앙 정렬 */
}

.hero__title {
  font-size: clamp(3.2rem, 11vw, 8.8rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.045em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.04em 0.28em;
}
.hero__title span { display: inline-block; }
.hero__title--em {
  font-style: italic;
  position: relative;
  padding: 0 0.04em;
}
.hero__title--em::after {
  content: "";
  position: absolute;
  left: -1%; right: -1%;
  bottom: 0.1em;
  height: 0.08em;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}
body.is-ready .hero__title--em::after {
  animation: underline 1s var(--ease) 2.1s forwards;
}
@keyframes underline { to { transform: scaleX(1); } }

.hero__lead {
  margin: 36px auto 0;
  max-width: 30ch;
  font-size: clamp(1.02rem, 2vw, 1.24rem);
  color: var(--ink-soft);
  line-height: 1.62;
}

.hero__cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 46px;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  color: var(--muted);
  z-index: 5;
  padding-left: 0.34em;
}
.hero__scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(var(--ink), transparent);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  top: -50%; left: 0;
  width: 100%; height: 50%;
  background: var(--ink);
  animation: scrollDot 1.8s var(--ease) infinite;
}
@keyframes scrollDot {
  0% { top: -50%; }
  100% { top: 100%; }
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--ink);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
    color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -14px rgba(255, 255, 255, 0.4);
}
.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--big { font-size: 1.32rem; padding: 19px 44px; margin-top: 34px; }

/* ============================================================
   소개 섹션의 디스플레이 정육면체 (CSS 3D)
   ============================================================ */
.cube {
  position: absolute;
  transform-style: preserve-3d;
}
.cube .face {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--ink);
  background: rgba(255, 255, 255, 0.03);
}
.cube .f-front  { transform: translateZ(var(--h)); }
.cube .f-back   { transform: rotateY(180deg) translateZ(var(--h)); }
.cube .f-right  { transform: rotateY(90deg) translateZ(var(--h)); }
.cube .f-left   { transform: rotateY(-90deg) translateZ(var(--h)); }
.cube .f-top    { transform: rotateX(90deg) translateZ(var(--h)); }
.cube .f-bottom { transform: rotateX(-90deg) translateZ(var(--h)); }

.about__cube { perspective: 900px; }
.cube--display {
  --s: 200px; --h: 100px;
  width: var(--s); height: var(--s);
  margin: 0 auto;
  animation: spin 22s linear infinite, bob 7s ease-in-out infinite;
}
.cube--display .face {
  background: var(--ink);
  border-color: #ffffff;
}
.cube--display .f-top    { background: #ffffff; }
.cube--display .f-right  { background: #cfcfcf; }
.cube--display .f-left   { background: #9c9c9c; }

@keyframes spin {
  0%   { transform: rotateX(-20deg) rotateY(0deg); }
  100% { transform: rotateX(-20deg) rotateY(360deg); }
}
@keyframes bob {
  0%, 100% { margin-top: 0; }
  50%      { margin-top: -22px; }
}

/* ============================================================
   공통 섹션 — 흰 배경으로 캔버스를 덮어 가독성 확보
   ============================================================ */
.section {
  position: relative;
  background: var(--paper);
  max-width: 100%;
  padding: clamp(96px, 14vh, 180px) clamp(20px, 5vw, 60px);
}
.section > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.section__head { margin-bottom: clamp(48px, 7vw, 90px); }
.section__index {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 20px;
}
.section__title {
  font-size: clamp(1.7rem, 4.4vw, 3.05rem);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.032em;
  max-width: 20ch;
  text-wrap: balance;
}
/* 구두점마다 직접 줄을 끊는 제목 — 자동 줄바꿈/폭 제약 해제 */
.section__title--lines {
  max-width: none;
  text-wrap: normal;
}

/* ---------- 소개 ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.about__cube {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}
.about__text {
  font-size: clamp(1.06rem, 2vw, 1.34rem);
  color: var(--ink-soft);
  line-height: 1.86;
  max-width: 34ch;
}
.about__text strong { color: var(--ink); font-weight: 700; }

/* ---------- 과정 ---------- */
.process__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
}
.vcard {
  position: relative;
  padding: 40px 32px 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease),
    border-color 0.5s var(--ease);
}
.vcard:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 60px -28px rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}
.vcard__no {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.vcard__title {
  font-size: 1.56rem;
  font-weight: 800;
  margin: 18px 0 14px;
  letter-spacing: -0.02em;
}
.vcard__desc { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.72; }
.vcard__line {
  position: absolute;
  left: 32px; bottom: 30px;
  width: 30px; height: 2px;
  background: var(--ink);
  transition: width 0.5s var(--ease);
}
.vcard:hover .vcard__line { width: 60px; }

/* ---------- 결과물 ---------- */
.works__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 44px);
}
.wcard { padding: 0; }
.wcard__shape {
  height: 200px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  overflow: hidden;
  background: radial-gradient(130% 130% at 30% 18%, #18181a 0%, #070707 64%);
  perspective: 600px;
}
.wcard__shape i {
  display: block;
  width: 76px; height: 76px;
  background: var(--ink);
  transform-style: preserve-3d;
  animation: tumble 13s linear infinite;
  box-shadow: 16px 16px 0 -2px rgba(255, 255, 255, 0.08);
}
.wcard:nth-child(2) .wcard__shape i {
  border-radius: 50%;
  box-shadow: 15px 15px 0 -2px rgba(255, 255, 255, 0.08);
}
.wcard:nth-child(3) .wcard__shape i {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.wcard:hover .wcard__shape i { animation-duration: 5s; }
@keyframes tumble {
  0%   { transform: rotateX(0) rotateY(0); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}
.wcard__title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.wcard__desc { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.72; }

/* ---------- 마무리 ---------- */
.closing {
  position: relative;
  background: var(--paper);
  padding: clamp(110px, 18vh, 220px) clamp(20px, 5vw, 60px) 0;
  text-align: center;
}
.closing > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}
.closing__inner { padding-bottom: clamp(90px, 14vh, 160px); }
.closing__title {
  font-size: clamp(2.2rem, 6.5vw, 4.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.042em;
}
.closing__text {
  margin: 30px auto 0;
  max-width: 42ch;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.16rem);
}
.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ============================================================
   스크롤 등장 애니메이션
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease) var(--d, 0s),
    transform 0.9s var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* 히어로 텍스트는 인트로가 끝난 뒤에야, 더 천천히·부드럽게 떠오른다 */
.hero .reveal {
  transform: translateY(48px);
  transition:
    opacity 1.7s var(--ease) var(--d, 0s),
    transform 1.7s var(--ease) var(--d, 0s);
}
.hero .reveal.is-in { opacity: 0; transform: translateY(48px); }
body.is-ready .hero .reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 860px) {
  .about__grid,
  .process__list,
  .works__grid { grid-template-columns: 1fr; }
  .about__grid { gap: 36px; }
  .about__cube { min-height: 240px; }
}

@media (max-width: 560px) {
  .nav__links { display: none; }
  .hero__cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; }
  .cube--display { --s: 150px; --h: 75px; }
}

/* 모션 최소화 선호 사용자 배려 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .page { opacity: 1; transform: none; }
  .reveal,
  .hero .reveal.is-in { opacity: 1; transform: none; }
}
