/* 공개 링크 페이지. X·스레드 도해와 인스타 카드뉴스의 모양(card\src\theme.tsx)을 옮겼다.
   흐르는 색 덩어리 바탕 위에 모래 질감이 얹힌 유리 패널을 놓는다. 밝은 판이 기본이고 어두운 판은 html 의 data-theme="dark" 로 켠다. */
@font-face {
  font-family: "Paperlogy";
  src: url("fonts/Paperlogy-8ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg-a: #f2ece6;
  --bg-b: #e6e2ec;
  --bg-c: #cfd6e4;
  --orb-1: rgba(185, 171, 255, .75);
  --orb-2: rgba(143, 230, 214, .70);
  --orb-3: rgba(255, 184, 212, .75);
  --orb-4: rgba(169, 212, 255, .60);
  --ink: #14151c;
  --ink-2: #3d404d;
  --ink-3: #7c8092;
  --line: rgba(20, 20, 45, .12);
  --accent: #6b56f0;
  --fill-a: #b9abff;
  --fill-b: #6b56f0;
  --iris: linear-gradient(120deg, #ffd3e3 0%, #cdbdff 42%, #a8dcff 72%, #a5efe2 100%);
  --frost:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.25' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.1 -0.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.25' numOctaves='2' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.12  0 0 0 0 0.12  0 0 0 0 0.12  0 0 0 0.75 -0.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --glass: linear-gradient(155deg, rgba(255, 255, 255, .66), rgba(255, 255, 255, .26) 75%);
  --glass-edge: rgba(255, 255, 255, .82);
  --glass-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .95), inset 0 -8px 18px rgba(255, 255, 255, .22), 0 18px 36px rgba(80, 70, 120, .18), 0 4px 10px rgba(60, 55, 95, .08);
  --glass-shadow-up: inset 0 1.5px 0 rgba(255, 255, 255, .95), inset 0 -8px 18px rgba(255, 255, 255, .22), 0 26px 46px rgba(107, 86, 240, .26), 0 6px 14px rgba(60, 55, 95, .10);
  --pic: linear-gradient(150deg, rgba(185, 171, 255, .34), rgba(169, 212, 255, .22));
  --bar: rgba(232, 228, 236, .62);
  --tile: #ffffff;
  --tile-ink: #14151c;
  --radius: 22px;
  --display: "Paperlogy", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-a: #100e22;
  --bg-b: #191540;
  --bg-c: #0e1c34;
  --orb-1: rgba(107, 86, 240, .55);
  --orb-2: rgba(18, 165, 149, .34);
  --orb-3: rgba(226, 72, 127, .36);
  --orb-4: rgba(47, 127, 230, .40);
  --ink: #f5f4fb;
  --ink-2: rgba(255, 255, 255, .78);
  --ink-3: rgba(255, 255, 255, .52);
  --line: rgba(255, 255, 255, .16);
  --accent: #c3b8ff;
  --fill-a: #a898ff;
  --fill-b: #6b56f0;
  --frost: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.25' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 -0.22'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --glass: linear-gradient(155deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .05) 75%);
  --glass-edge: rgba(255, 255, 255, .24);
  --glass-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .32), 0 18px 36px rgba(5, 3, 30, .45);
  --glass-shadow-up: inset 0 1.5px 0 rgba(255, 255, 255, .40), 0 26px 46px rgba(107, 86, 240, .42);
  --pic: linear-gradient(150deg, rgba(185, 171, 255, .20), rgba(169, 212, 255, .10));
  --bar: rgba(20, 17, 46, .58);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg-b); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 15px/1.5 var(--font);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 바탕: 색 덩어리 넷이 천천히 흐른다 */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-a) 0%, var(--bg-b) 46%, var(--bg-c) 100%);
}
.sky i {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0%, transparent 68%);
  animation: drift 24s ease-in-out infinite alternate;
  will-change: transform;
}
.sky i:nth-child(1) { --c: var(--orb-1); width: 60vmax; height: 60vmax; left: calc(14% - 30vmax); top: calc(20% - 30vmax); }
.sky i:nth-child(2) { --c: var(--orb-2); width: 54vmax; height: 54vmax; left: calc(88% - 27vmax); top: calc(30% - 27vmax); animation-duration: 29s; animation-delay: -9s; }
.sky i:nth-child(3) { --c: var(--orb-3); width: 64vmax; height: 64vmax; left: calc(62% - 32vmax); top: calc(100% - 32vmax); animation-duration: 33s; animation-delay: -17s; }
.sky i:nth-child(4) { --c: var(--orb-4); width: 48vmax; height: 48vmax; left: calc(30% - 24vmax); top: calc(95% - 24vmax); animation-duration: 27s; animation-delay: -5s; }
@keyframes drift {
  from { transform: translate3d(-4vw, -3vh, 0); }
  to { transform: translate3d(4vw, 4vh, 0); }
}

/* 유리 패널 */
.socials a, .search, .tabs, .card, .empty, .theme, .pending {
  background: var(--frost), var(--glass);
  border: 1.5px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
}

/* 맨 위 알림 줄 */
.notes p {
  margin: 0;
  padding: 9px 16px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.notes .preview-note { color: var(--accent); font-weight: 600; }

.wrap {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 56px;
  flex: 1;
}

/* 밝게·어둡게 */
.theme {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.theme:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow-up); }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }

/* 프로필 */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 52px 0 30px;
}
.profile > * { animation: arrive .7s cubic-bezier(.2, .7, .2, 1) both; }
.profile > :nth-child(2) { animation-delay: .08s; }
.profile > :nth-child(3) { animation-delay: .16s; }
.profile > :nth-child(4) { animation-delay: .24s; }
@keyframes arrive {
  from { opacity: 0; transform: translateY(16px); filter: blur(12px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.avatar-frame {
  display: block;
  padding: 4px;
  border-radius: 34%;
  background: var(--iris);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .9), 0 22px 40px rgba(107, 86, 240, .30);
}
.avatar {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 31%;
  object-fit: cover;
  background: var(--tile);
}
.avatar.blank {
  display: grid;
  place-items: center;
  font: 800 36px/1 var(--display);
  color: #6b56f0;
}
.profile h1 {
  margin: 18px 0 0;
  font: 800 30px/1.2 var(--display);
  letter-spacing: -0.02em;
}
.bio {
  margin: 8px 0 0;
  max-width: 34em;
  font-size: 15.5px;
  color: var(--ink-2);
}
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 16px 0 6px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.socials a:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow-up); }
.socials a:active { transform: none; }
.socials .tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tile);
  color: var(--tile-ink);
  box-shadow: 0 3px 8px rgba(40, 35, 80, .16);
}

/* 찾기 */
.finder { margin: 4px 0 0; animation: arrive .7s .3s cubic-bezier(.2, .7, .2, 1) both; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px;
  border-radius: 999px;
  color: var(--ink-3);
  transition: box-shadow .2s, color .2s;
}
.search:focus-within { color: var(--accent); box-shadow: var(--glass-shadow-up); }
.search svg { flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .6; }
.hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}
.hint b { font-weight: 700; color: var(--ink-2); }

/* 분류. 유리 캡슐 하나에 담겨 화면 위에 붙어 따라오고, 뒤의 목록이 흐리게 비친다 */
.tabs {
  position: sticky;
  top: 10px;
  z-index: 2;
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 5px;
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  animation: arrive .7s .33s cubic-bezier(.2, .7, .2, 1) both;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, box-shadow .2s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--fill-a), var(--fill-b));
  border-color: rgba(255, 255, 255, .7);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .6), inset 0 -5px 10px rgba(107, 86, 240, .35), 0 10px 20px rgba(107, 86, 240, .32);
  color: #ffffff;
}

/* 분류 묶음 */
#list { animation: arrive .7s .36s cubic-bezier(.2, .7, .2, 1) both; }
.group { margin-top: 30px; }
.group:first-child { margin-top: 22px; }
.group-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 4px 12px;
}
.group-head h2 {
  margin: 0;
  font: 800 20px/1.3 var(--display);
  letter-spacing: -0.02em;
}
.group-head .count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 800px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 상품 카드 */
.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--glass-shadow-up); }
a.card:active { transform: none; }
.pic {
  position: relative;
  aspect-ratio: 1;
  background: var(--pic);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.letter {
  font: 800 46px/1 var(--display);
  color: var(--accent);
  opacity: .45;
}
.pending {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  box-shadow: none;
}
.body { padding: 11px 13px 14px; }
.title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 번호는 색으로 채운 알약 */
.no {
  display: inline-block;
  margin-right: 7px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--fill-a), var(--fill-b));
  color: #ffffff;
  font: 800 13px/20px var(--display);
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}
.desc {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 빈 화면 */
.empty {
  margin: 26px 0 0;
  padding: 40px 20px;
  border-radius: var(--radius);
  text-align: center;
  animation: arrive .7s .36s cubic-bezier(.2, .7, .2, 1) both;
}
.empty-head { margin: 0; font: 800 18px/1.3 var(--display); letter-spacing: -0.02em; }
.empty-sub { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.empty-sub:empty { display: none; }

.foot {
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}
.noscript { text-align: center; color: var(--ink-2); padding: 24px 16px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
