/* 전시 포스터 스타일 (ref: Sony ARTISANS) — 밝은 배경, 초대형 타이포, 세로 스트립 히어로 */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@800;900&display=swap');

:root {
  --bg: #fbfbfa;
  --ink: #111111;
  --dim: #8a8a86;
  --hairline: #e7e7e3;
  --accent: #e8570f; /* ARTISANS 오렌지 */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* display:flex 선언이 hidden 속성(UA display:none)을 덮어쓰지 않도록 강제 */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---- 상단 바: 좌측 워드마크, 우측 업로드 (포스터의 SONY / 로고 자리) ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center;
  padding: 18px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.wordmark { font-weight: 900; font-size: 14px; letter-spacing: .38em; }
.spacer { flex: 1; }
.upload-btn {
  padding: 7px 18px; border-radius: 0;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-size: 12px; font-weight: 700; letter-spacing: .1em; cursor: pointer;
  transition: all .15s ease;
}
.upload-btn:hover { background: var(--ink); color: #fff; }

/* ---- 히어로 ---- */
.hero { text-align: center; padding: 56px 16px 0; }
.hero-sub { font-size: 15px; letter-spacing: .04em; color: #333; margin-bottom: 6px; }
.hero-title {
  font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(40px, 12vw, 148px);
  font-weight: 900; line-height: .95; letter-spacing: .015em;
  /* 사진 톤이 스며든 듯한 다크 그라디언트 채움 */
  background: linear-gradient(102deg,
    #191919 0%, #3d2f24 26%, #17233c 50%, #33401f 72%, #1c1c1c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-meta { margin-top: 14px; font-size: 13px; color: var(--dim); letter-spacing: .02em; }

/* 세로 스트립 행 — 엇갈린 높이/오프셋, 호버 시 옆으로 벌어지며 떠오름 */
.strips {
  display: flex; justify-content: center; align-items: flex-start;
  gap: 12px; height: 360px; margin-top: 40px;
  padding: 0 20px;
  overflow-x: clip; overflow-y: visible; /* 좁은 화면 가로만 자르고, 리프트/그림자는 살림 */
}
.strip {
  --strip-w: clamp(52px, 7vw, 92px);
  width: var(--strip-w); flex: none;
  background-size: cover; background-position: center;
  cursor: zoom-in; position: relative; overflow: hidden;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; /* iOS 롱프레스 시트 방지 */
  transition:
    width .55s cubic-bezier(.22, 1, .36, 1),
    transform .55s cubic-bezier(.34, 1.4, .64, 1),
    box-shadow .45s ease, filter .45s ease;
  animation: rise .7s cubic-bezier(.22, 1, .36, 1) backwards;
}
/* 호버 계열 효과는 호버 가능 기기에서만 — 터치의 sticky hover 잔상 방지 */
@media (hover: hover) and (pointer: fine) {
  .strip:hover {
    width: min(320px, 24vw);       /* 확 벌어지며 사진이 드러남 (JS 이전 폴백) */
    transform: translateY(-30px);  /* 위로 떠오름 */
    box-shadow: 0 34px 64px #00000038;
  }
  /* 호버 중이 아닌 형제는 살짝 가라앉힘 — 초점 강조 (내려오는 건 JS가 거리별로) */
  .strips:hover .strip:not(:hover) { filter: saturate(.72) brightness(.94); }
  .strip:hover::after { opacity: 1; }
}
/* JS가 웨이브 초점에 부여 — 데스크톱 호버·모바일 롱프레스 공통 */
.strip.focus { box-shadow: 0 34px 64px #00000038; }
.strip.focus::after { opacity: 1; }
/* Dock 웨이브 동작 중엔 추적이 빨라야 하므로 트랜지션 단축 */
.strips.dock-active .strip {
  transition:
    width .28s cubic-bezier(.25, .9, .3, 1),
    transform .28s cubic-bezier(.25, .9, .3, 1),
    box-shadow .3s ease, filter .35s ease;
}
/* 벌어졌을 때 파일명 캡션 */
.strip::after {
  content: attr(data-name);
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #fff;
  background: linear-gradient(transparent, #00000085);
  opacity: 0; transition: opacity .35s ease .1s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero.no-strips .strips { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
}
/* 높이·시작점 패턴 (포스터의 배너 느낌)
   주의: flex에서 margin-top %는 컨테이너 '너비' 기준이라 px로 지정 */
.strip:nth-child(9n+1) { height: 78%; margin-top: 26px; }
.strip:nth-child(9n+2) { height: 60%; margin-top: 72px; }
.strip:nth-child(9n+3) { height: 88%; margin-top: 0; }
.strip:nth-child(9n+4) { height: 68%; margin-top: 47px; }
.strip:nth-child(9n+5) { height: 95%; margin-top: 7px; }
.strip:nth-child(9n+6) { height: 58%; margin-top: 86px; }
.strip:nth-child(9n+7) { height: 82%; margin-top: 18px; }
.strip:nth-child(9n+8) { height: 64%; margin-top: 58px; }
.strip:nth-child(9n+9) { height: 90%; margin-top: 4px; }

/* ---- 앨범 탭: 중앙 정렬, 활성 = 오렌지 언더라인 ---- */
.albums {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 22px;
  padding: 44px 20px 8px; max-width: 1200px; margin: 0 auto;
}
.chip {
  border: none; background: none; cursor: pointer;
  padding: 8px 2px 10px; font-size: 12.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.chip:hover { color: var(--ink); }
.chip.active { color: var(--ink); border-color: var(--accent); }
.chip .cnt { font-size: 10.5px; opacity: .6; margin-left: 5px; letter-spacing: 0; }

/* ---- 그리드: 샤프한 모서리, 얇은 경계 ---- */
.grid {
  columns: 5 240px; column-gap: 14px;
  padding: 26px 24px 60px; max-width: 1800px; margin: 0 auto;
}
.card {
  break-inside: avoid; margin-bottom: 14px;
  overflow: hidden; background: #fff;
  border: 1px solid var(--hairline);
  cursor: zoom-in; position: relative;
  transition: box-shadow .3s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
  animation: rise .6s cubic-bezier(.22, 1, .36, 1) backwards;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 18px 44px #00000022; }
.card img {
  width: 100%; display: block; min-height: 60px;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .4s ease;
  opacity: 0;
}
.card img.loaded { opacity: 1; }
.card:hover img { transform: scale(1.05); }
.card .name {
  position: absolute; inset: auto 0 0 0;
  padding: 18px 10px 8px; font-size: 11px; color: #fff;
  background: linear-gradient(transparent, #000a);
  opacity: 0; transition: opacity .2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card:hover .name { opacity: 1; }

.empty { text-align: center; color: var(--dim); padding: 80px 20px; font-size: 15px; }
.empty code { color: var(--accent); }

/* ---- 라이트박스 (감상은 다크 유지) ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: #000e; backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
}
.lightbox img {
  max-width: 92vw; max-height: 88vh; max-height: 88dvh;
  box-shadow: 0 20px 80px #000;
}
.lb-close, .lb-prev, .lb-next {
  position: fixed; z-index: 51; border: none; cursor: pointer;
  background: #ffffff18; color: #fff; border-radius: 50%;
  width: 44px; height: 44px; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: #ffffff30; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-caption {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  font-size: 13px; color: #bbb;
  background: #000a; padding: 8px 16px; border-radius: 999px;
  max-width: 90vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-caption a { color: var(--accent); text-decoration: none; }

/* ---- 업로드 보조 ---- */
.drop-hint {
  position: fixed; inset: 12px; z-index: 60; pointer-events: none;
  border: 3px dashed var(--accent);
  background: #ffffffd9; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; letter-spacing: .05em; color: var(--accent);
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 70; background: #fff; border: 1px solid var(--hairline);
  padding: 10px 20px; font-size: 14px; color: var(--ink);
  box-shadow: 0 10px 34px #00000022;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 터치 기기: 좌우 버튼 대신 스와이프로 넘김 */
@media (hover: none), (pointer: coarse) {
  .lb-prev, .lb-next { display: none; }
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .hero { padding-top: 32px; }
  .hero-sub { font-size: 13px; }
  .hero-meta { margin-top: 10px; font-size: 12px; }

  /* 스트립: 숨기지 않고 전부 — 가로 스크롤 + 스냅, 적으면 가운데 정렬.
     padding-top 은 롱프레스 리프트(-24px) 헤드룸 */
  .strips {
    height: 264px; gap: 8px; margin-top: 20px; padding: 26px 16px 0;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .strips::-webkit-scrollbar { display: none; }
  .strip { --strip-w: 64px; scroll-snap-align: center; }
  .strip:first-child { margin-left: auto; }
  .strip:last-child { margin-right: auto; }

  /* 앨범 탭: 한 줄 가로 스크롤 */
  .albums {
    flex-wrap: nowrap; justify-content: flex-start; gap: 0 18px;
    overflow-x: auto; padding: 26px 20px 6px;
    scrollbar-width: none;
  }
  .albums::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .chip:first-child { margin-left: auto; }
  .chip:last-child { margin-right: auto; }

  .grid { columns: 2 140px; padding: 14px 12px 44px; column-gap: 10px; }
  .card { margin-bottom: 10px; }

  .lb-close {
    top: max(12px, env(safe-area-inset-top)); right: 12px;
    width: 40px; height: 40px; font-size: 20px;
  }
  .lb-caption {
    bottom: max(10px, env(safe-area-inset-bottom));
    font-size: 12px; max-width: 94vw; padding: 7px 14px;
  }
}
