/* Galloway 디자인 시스템: 다크 캔버스, 흰 외곽선 pill, Wanted Sans 400 + 자간 -0.019em, 모노 머리말 */
@font-face {
  font-family: "Wanted Sans";
  src: url("fonts/WantedSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #0a0a0a;
  --card: #191919;
  --soft: #1a1c20;
  --mid: #363a3f;
  --hairline: #212327;
  --outline: rgba(255, 255, 255, 0.25);
  --ink: #ffffff;
  --body: #dadbdf;
  --mute: #7d8187;
  --scrim: rgba(0, 0, 0, 0.55);
  --danger: #e5484d;
  --sans: "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--canvas); color: var(--ink); }
body {
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: -0.019em;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
button { font: inherit; letter-spacing: inherit; color: inherit; }
img { display: block; }

main { max-width: 1200px; margin: 0 auto; }

.hero {
  padding: calc(32px + env(safe-area-inset-top, 0px)) 16px 16px;
  border-bottom: 1px solid var(--hairline);
}
.eyebrow, .month, .badge, .meta-mono {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.eyebrow { margin: 0 0 8px; font-size: 12px; line-height: 16px; color: var(--mute); }
.hero h1 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 400; letter-spacing: -0.019em; overflow-wrap: anywhere; }
.meta { margin: 6px 0 0; font-size: 13px; line-height: 18px; color: var(--mute); }

.state { padding: 64px 24px; text-align: center; color: var(--body); font-size: 15px; line-height: 22px; }
.state .big { display: block; color: var(--ink); font-size: 20px; line-height: 28px; margin-bottom: 8px; }
.state svg { width: 32px; height: 32px; fill: var(--mute); margin: 0 auto 16px; display: block; }

.month {
  display: flex; align-items: center; gap: 8px;
  padding: 24px 16px 8px; font-size: 12px; line-height: 16px; color: var(--ink);
}
.month .count { color: var(--mute); }
.month::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(6, 1fr); } }

.tile {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; background: var(--soft);
  cursor: pointer; overflow: hidden;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.badge {
  position: absolute; top: 4px; right: 4px; height: 24px; padding: 0 8px 0 5px;
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 9999px; background: var(--scrim); color: var(--ink);
  font-size: 11px; letter-spacing: 0.06em;
}
.badge svg { width: 14px; height: 14px; fill: var(--ink); }

.more { padding: 24px; text-align: center; color: var(--mute); font-size: 13px; }

.cta {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 9999px;
  background: var(--card); border: 1px solid var(--hairline);
  font-size: 13px; line-height: 18px; color: var(--body); text-align: center;
}

/* ---------- 뷰어 ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 10; background: #000;
  display: flex; flex-direction: column;
  touch-action: none;
}
.viewer[hidden] { display: none; }
.viewer-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 4px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px;
}
.viewer-name { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--body);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden;
  transition: transform 0.18s ease-out; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-stage .playbig {
  width: 64px; height: 64px; border-radius: 9999px; border: 1px solid var(--outline);
  background: var(--scrim); display: flex; align-items: center; justify-content: center; cursor: pointer;
  position: absolute;
}
.viewer-stage .playbig svg { width: 26px; height: 26px; fill: var(--ink); }
.viewer-bottom {
  position: absolute; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 2;
  display: flex; justify-content: center;
}

.iconbtn {
  width: 44px; height: 44px; flex: none; border-radius: 9999px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.iconbtn svg { width: 20px; height: 20px; fill: var(--ink); }
.iconbtn:hover { background: var(--soft); }
.nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: var(--scrim); }
.nav.prev { left: 12px; }
.nav.next { right: 12px; }
@media (hover: none) { .nav { display: none; } }

.pill {
  height: 40px; padding: 0 16px; border-radius: 9999px;
  border: 1px solid var(--outline); background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px;
}
.pill svg { width: 18px; height: 18px; fill: var(--ink); }
.pill[disabled] { opacity: 0.6; cursor: default; }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 20; padding: 12px 16px; border-radius: 9999px;
  background: var(--card); border: 1px solid var(--hairline); font-size: 14px; max-width: calc(100% - 32px);
}
