/* 움직임(인터랙션) 모음 — 움직이는 속성은 transform·opacity만.
   수치는 CLAUDE.md '인터랙션' 절과 인터랙션 데모 기준 */

/* ── 스크롤 등장: 아래 16px에서 1초 동안. JS가 있을 때만 숨긴다 ── */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--reveal-delay, .25s);
}
/* 빨간 선은 왼쪽에서 그어지듯 */
.js .rule.reveal { transform: scaleX(0); transform-origin: left center; }
/* 등장 완료, 또는 3초 안전장치(html.reveal-all) — 빨간 선 규칙보다 우선순위가 높아야 한다 */
.js .reveal.is-in,
.js.reveal-all .reveal,
.js.reveal-all .rule.reveal { opacity: 1; transform: none; }

/* ── 헤더 고정 효과 (스크롤 80px 이후 #headerSlot.is-stuck) ──
   그림자는 box-shadow를 바꾸지 않고, 진한 그림자를 미리 그린 뒤층의 투명도만 바꾼다.
   로고는 width가 아니라 scale로 (헤더 높이가 그대로라 아래 내용이 밀리지 않음) */
.header { position: relative; }
.header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 14px 36px rgba(17,19,24,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.is-stuck .header::after { opacity: 1; }
.brand img { transform-origin: left center; transition: transform .3s var(--ease); }
.is-stuck .brand img { transform: scale(.867); }
@media (max-width: 820px) {
  .is-stuck .brand img { transform: scale(.933); }
}

/* ── 모바일 메뉴: 오른쪽에서 0.45s 슬라이드, 딤 0.4s, 항목 순차 등장 ──
   닫힐 때도 슬라이드가 보이도록 visibility는 움직임이 끝난 뒤(지연) 바뀐다 */
.drawer { transition: transform .45s var(--ease), visibility 0s linear .45s; }
.menu-open .drawer { transition: transform .45s var(--ease), visibility 0s linear 0s; }
.scrim { transition: opacity .4s var(--ease), visibility 0s linear .4s; }
.menu-open .scrim { transition: opacity .4s var(--ease), visibility 0s linear 0s; }
.drawer-nav a { opacity: 0; transform: translateX(24px); transition: opacity .4s var(--ease), transform .4s var(--ease), color .3s var(--ease); }
.menu-open .drawer-nav a { opacity: 1; transform: none; }
.menu-open .drawer-nav a:nth-child(1) { transition-delay: .12s; }
.menu-open .drawer-nav a:nth-child(2) { transition-delay: .17s; }
.menu-open .drawer-nav a:nth-child(3) { transition-delay: .22s; }
.menu-open .drawer-nav a:nth-child(4) { transition-delay: .27s; }
.menu-open .drawer-nav a:nth-child(5) { transition-delay: .32s; }

/* ── 호버 준비 상태 (기본 모습은 그대로, 밑줄만 접어 둠) ── */
/* 메뉴: 가운데서 펼쳐지는 2px 밑줄. 현재 페이지는 펼친 상태 */
.gnb a { position: relative; transition: color .3s var(--ease); }
.gnb a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-bright);
  transform: scaleX(0);
  transition: transform .3s var(--ease);
}
.gnb a[aria-current="page"]::after { transform: scaleX(1); }
/* 텍스트 링크: 왼쪽에서 펼쳐지는 밑줄 */
.link-red { position: relative; }
.link-red::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--ease);
}
/* 버튼: 색 채움 + 2px 떠오름 */
.btn { transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease); }
/* 영상 썸네일: 살짝 확대 (데모 0.6s) */
.video .thumb img,
.video-thumb img { transition: transform .6s var(--ease); }

/* ── 호버: 마우스가 있는 기기에서만 (터치에서 눌린 채 남지 않게) ── */
@media (hover: hover) {
  .gnb a:hover { color: var(--text-primary); }
  .gnb a:hover::after { transform: scaleX(1); }
  .link-red:hover::after { transform: scaleX(1); }
  .btn:hover { transform: translateY(-2px); }
  .btn-ghost:hover { background: var(--text-primary); color: var(--text-inverse); border-color: var(--text-primary); }
  .btn-ghost-light:hover { background: var(--bg-surface); color: var(--text-primary); border-color: var(--bg-surface); }
  .video:hover .thumb img,
  .video-card:hover .video-thumb img { transform: scale(1.04); }
  .drawer-nav a:hover { color: var(--accent); }
  .tab:hover { border-color: var(--text-primary); color: var(--text-primary); }
  .tab[aria-selected="true"]:hover { color: var(--text-inverse); }
}

/* ── 동작 줄이기: 모든 움직임 끔, 내용은 처음부터 보임 ── */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
