@font-face {
  font-family: Pretendard;
  src: url("assets/PretendardVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 45 920;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f5f9;
  --ink: #20192d;
  --muted: #60596e;
  --accent: #6246c9;
  --line: #e5e1ec;
  background: var(--paper);
  color: var(--ink);
  font-family: Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
.intro .intro-actions { flex-wrap:wrap; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.library {
  width: min(calc(100% - 96px), 1400px);
  margin: 0 auto;
  padding: 44px 0 38px;
}
.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.intro-title { display: flex; align-items: center; gap: 17px; }
.intro h1 { margin: 0; font-size: clamp(2.15rem, 4.2vw, 3.65rem); line-height: 1.08; letter-spacing: -.07em; font-weight: 780; }
.intro h1 em { color: var(--accent); font-style: normal; }
.intro p { margin: 12px 0 0; color: var(--muted); font-size: 1.02rem; line-height: 1.6; word-break: keep-all; }
.motion-mark {
  isolation: isolate;
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #241b39;
  border-radius: 16px;
}
.motion-mark i {
  position: absolute;
  width: 15px;
  height: 15px;
  transform: translateX(var(--offset, 0)) rotate(45deg);
  background: var(--tile, #ece4ff);
  border-radius: 3px;
}
.motion-mark i:first-child { --offset: -10px; --tile: #8160ec; }
.motion-mark i:nth-child(2) { --offset: -4px; --tile: #b9a1fb; }
.intro-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.copy-format { display: flex; position: relative; align-items: center; gap: 6px; color: var(--muted); font-size: .83rem; }
.copy-format select {
  appearance: none;
  min-height: 42px;
  padding: 0 23px 0 10px;
  border: 1px solid #dbd3ec;
  border-radius: 10px;
  background: #fff;
  color: #3d3060;
  font: inherit;
  font-weight: 700;
}
.copy-format::after { content: ""; position: absolute; right: 9px; top: calc(50% - 4px); width: 6px; height: 6px; border: solid #664e96; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
.playback {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #dbd3ec;
  border-radius: 10px;
  background: #fff;
  color: #3d3060;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font-size: .9rem;
  font-weight: 710;
}
.playback:hover, .copy:hover { background: #f0ebff; border-color: #d6c8ff; }
.pause-icon { width: 9px; height: 11px; border-inline: 3px solid currentColor; }
.play-icon { width: 0; height: 0; border-block: 5px solid transparent; border-left: 8px solid currentColor; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 19px 0 17px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #ebe8f1; border-radius: 11px; }
.filters button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #554b66;
  font-size: .9rem;
  font-weight: 680;
  white-space: nowrap;
}
.filters button[aria-pressed="true"] { color: #37217a; background: #fff; box-shadow: 0 1px 4px #2c194b14; }
.effect-count { color: var(--muted); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.collection-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:0 0 16px;font-size:.9rem;color:#554b66}
.collection-bar label{font-weight:680}.collection-bar select{max-width:100%;min-height:38px;border:1px solid var(--line);border-radius:8px;padding:4px 9px;color:var(--ink);background:white;font:inherit}
.expand-demo{margin-top:8px;padding:4px 0;color:#59438b;border:0;background:transparent;font-size:.82rem;text-decoration:underline;text-underline-offset:3px}
#viewer{border:1px solid #d5cfe2;border-radius:16px;padding:clamp(15px,3vw,28px);width:min(530px,calc(100vw - 24px));max-height:92svh;overflow:auto;color:var(--ink);background:#fff}
#viewer::backdrop{background:#221b36a8}
#viewer header,.viewer-controls{display:flex;align-items:center;justify-content:space-between;gap:10px}#viewer h2{margin:0;font-size:1.35rem}#viewer button{background:#f3f0fa;border:1px solid #ded8eb;border-radius:7px;min-height:37px;padding:5px 12px;color:#493472}
.viewer-screen{position:relative;margin:16px 0 12px;width:100%;aspect-ratio:180/128;overflow:hidden;border-radius:10px}
#viewer-stage{position:absolute;left:50%;top:50%;width:180px;height:128px;transform-origin:center;border-radius:0}.viewer-controls input{min-width:24px;flex:1;accent-color:var(--accent)}.viewer-controls output{min-width:4ch;text-align:right;font-variant-numeric:tabular-nums}#viewer-info{line-height:1.5}
.search-row { display: flex; min-width: 0; align-items: center; gap: 12px; }
.search-control { display: flex; align-items: center; gap: 9px; min-width: 0; width: 206px; min-height: 42px; padding: 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: #614785; }
.search-control:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-icon { position: relative; flex: none; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; top: 8px; left: 8px; width: 5px; height: 1.5px; background: currentColor; transform: rotate(45deg); transform-origin: left; }
.search-control input { width: 100%; min-width: 0; padding: 10px 0; background: transparent; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: .9rem; }
.search-control input::placeholder { color: var(--muted); }
.empty { padding: 34px 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 12px; }
.empty button { background: #efe9ff; border: 1px solid #e0d4fb; border-radius: 9px; padding: 7px 12px; color: #3d277e; font-size: .9rem; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.card {
  --dot: #7959df;
  min-width: 0;
  padding: 10px 11px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 10px #2c194b05;
}
.card[data-category="transition"] { --dot: #3c7e9e; }
.card[data-category="accent"] { --dot: #458369; }
.card[data-category="scroll"] { --dot: #82703c; }
.card[data-category="interaction"] { --dot: #a85380; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px; margin-bottom: 6px; }
.card h2 { display: flex; align-items: baseline; gap: 7px; margin: 0; font-size: 1rem; line-height: 1.25; font-weight: 730; letter-spacing: -.035em; word-break: keep-all; }
.card h2::before { content: ""; flex: none; width: 6px; height: 6px; align-self: center; border-radius: 50%; background: var(--dot); }
.copy {
  flex: none;
  width: 33px;
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #664e96;
  display: grid;
  place-items: center;
}
.copy-icon { position: relative; width: 13px; height: 13px; }
.copy-icon::before, .copy-icon::after { content: ""; position: absolute; width: 7px; height: 8px; border: 1.3px solid currentColor; border-radius: 2px; }
.copy-icon::before { inset: 0 auto auto 0; }
.copy-icon::after { inset: auto 0 0 auto; background: #fff; }
.copy:hover .copy-icon::after { background: #f0ebff; }
.stage { display: grid; place-items: center; width: 100%; height: 128px; position: relative; isolation: isolate; overflow: hidden; border: 0; border-radius: 10px; color: var(--demo-ink, #35245a); background: var(--demo-bg, #ede7fc); padding: 0; }
.stage-content { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; pointer-events: none; }
.replay {
  position: absolute;
  z-index: 4;
  right: 6px;
  bottom: 6px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: #3b2a56;
  background: #fffffff2;
  padding: 4px 7px;
  border: 1px solid #35234c16;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 690;
  opacity: 0;
}
.replay::before { content: ""; border-block: 4px solid transparent; border-left: 6px solid currentColor; }
.stage:hover .replay, .stage:focus-visible .replay, .stage[data-running="false"] .replay { opacity: 1; }
.card p { margin: 9px 1px 0; min-height: 1.4em; color: #60586d; font-size: .84rem; line-height: 1.4; word-break: keep-all; }
.usage-example { display: flex; align-items: baseline; gap: 12px; padding: 16px 3px 0; margin-top: 16px; border-top: 1px solid var(--line); color: #554b66; font-size: .9rem; }
.usage-example strong { white-space: nowrap; font-weight: 730; }
.usage-example p { margin: 0; line-height: 1.55; word-break: keep-all; }
.toast {
  position: fixed;
  z-index: 5;
  inset: auto 24px 24px auto;
  max-width: min(390px, calc(100% - 48px));
  margin: 0;
  border-radius: 10px;
  padding: 11px 16px;
  color: white;
  background: #302243;
  box-shadow: 0 5px 22px #271c3a35;
  font-size: .9rem;
  line-height: 1.4;
  pointer-events: none;
}
.toast:empty { visibility: hidden; }

@media (max-width: 1239px) {
  .library { width: calc(100% - 64px); }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 870px) {
  .library { width: calc(100% - 48px); padding-top: 34px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 735px) {
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .filters { width: fit-content; max-width: 100%; }
  .search-control { width: auto; flex: 1; }
}
@media (max-width: 630px) {
  .library { width: calc(100% - 32px); padding-top: 26px; }
  .intro { flex-wrap: wrap; align-items: flex-start; gap: 14px; padding-bottom: 18px; }
  .intro-title { gap: 10px; }
  .motion-mark { width: 39px; height: 39px; border-radius: 12px; }
  .motion-mark i { width: 11px; height: 11px; }
  .motion-mark i:first-child { --offset: -7px; }
  .motion-mark i:nth-child(2) { --offset: -3px; }
  .intro p { margin-top: 8px; font-size: .96rem; }
  .copy-format { gap: 5px; }
  .playback { padding-inline: 10px; font-size: .83rem; }
  .toolbar { margin-block: 15px 12px; }
  .filters button { padding-inline: 9px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card { padding: 7px 8px 9px; border-radius: 12px; }
  .card h2 { font-size: .92rem; gap: 5px; }
  .card h2::before { width: 5px; height: 5px; }
  .card-header { margin-bottom: 5px; }
  .stage { height: 108px; }
  .card p { font-size: .8rem; }
  .usage-example { display: grid; gap: 4px; }
}
@media (hover: none) { .replay { opacity: 1; } }
camera-shot,camera-shot canvas {display:block;width:100%;height:100%}
.stage:has(camera-shot) .stage-content {position:relative;display:block}
.camera-caption {position:absolute;top:7%;left:5%;padding:.35em .55em;background:#162b2cde;color:#fff;font:650 10px/1.1 system-ui,sans-serif;letter-spacing:.045em;border-radius:3px}
.camera-prompt {display:block;margin-top:.55em;padding:.65em .8em;border-left:3px solid #729380;color:#254538;background:#f1f5f2}
