/* Layout: drawing cabinet. A masthead with a 결재란-style title block, then drawing-sheet cards in a grid.
   The viewer is a thin title bar over a full-bleed stage that runs the exhibit page. */
:root {
  --paper: #eceff3;
  --grid: #e1e6ec;
  --sheet: #fbfcfd;
  --well: #dde3ea;
  --ink: #141c27;
  --ink-2: #4c596a;
  --rule: #c4ccd7;
  --frame: #141c27;
  --pencil: #2146c7;
  --seal: #c9282e;
  --f-display: "Black Han Sans", "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
  --f-body: "IBM Plex Sans KR", system-ui, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --f-code: "Nanum Gothic Coding", ui-monospace, Consolas, "Malgun Gothic", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1218;
    --grid: #131a22;
    --sheet: #121922;
    --well: #0a0f15;
    --ink: #e5eaf0;
    --ink-2: #99a5b4;
    --rule: #2a3441;
    --frame: #bfc9d6;
    --pencil: #8ba7ff;
    --seal: #ff5b53;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1218;
  --grid: #131a22;
  --sheet: #121922;
  --well: #0a0f15;
  --ink: #e5eaf0;
  --ink-2: #99a5b4;
  --rule: #2a3441;
  --frame: #bfc9d6;
  --pencil: #8ba7ff;
  --seal: #ff5b53;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 15px/1.65 var(--f-body);
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 3px; }
code { font-family: var(--f-code); font-size: .95em; }

/* ── 홈 ── */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 40px);
  padding-block: clamp(28px, 6vw, 56px) 40px;
}
.mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px 48px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--frame);
}
.eyebrow {
  margin: 0 0 12px;
  font: 700 12px/1.4 var(--f-code);
  letter-spacing: .14em;
  color: var(--ink-2);
}
.mast h1 {
  margin: 0;
  font: 400 clamp(44px, 8vw, 88px)/1 var(--f-display);
  letter-spacing: -.01em;
  text-wrap: balance;
}
.lede { margin: 18px 0 0; max-width: 46ch; font-size: 16.5px; color: var(--ink-2); }
.made {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  padding: 7px 14px 7px 10px;
  border: 1.5px solid var(--seal);
  background: var(--sheet);
  color: var(--seal);
  font: 700 13.5px/1.35 var(--f-code);
}
.made-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--seal); flex: none; }

.kyul {
  display: grid;
  grid-template-columns: repeat(4, auto);
  margin: 0;
  border: 1.5px solid var(--frame);
  background: var(--sheet);
  font-family: var(--f-code);
}
.kyul > div { display: grid; grid-template-rows: auto 1fr; min-width: 92px; border-left: 1px solid var(--frame); }
.kyul > div:first-child { border-left: 0; }
.kyul dt {
  padding: 4px 10px;
  border-bottom: 1px solid var(--frame);
  font-size: 12px;
  letter-spacing: .3em;
  text-align: center;
  color: var(--ink-2);
}
.kyul dd {
  margin: 0;
  min-height: 80px;
  padding: 8px 12px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.seal {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  width: 62px;
  height: 62px;
  border: 2.5px solid var(--seal);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2.5px var(--sheet), inset 0 0 0 4px var(--seal);
  color: var(--seal);
  transform: rotate(-11deg);
}
.seal b { font: 400 19px/1 var(--f-display); }
.seal small { font: 700 11px/1 var(--f-code); letter-spacing: .14em; }

.shelf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 36px;
}
.shelf h2 { margin: 0; font: 400 22px/1.2 var(--f-display); }
.shelf h2 span { margin-left: 8px; font: 700 13px var(--f-code); color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  padding: 7px 14px;
  border: 1px solid var(--frame);
  background: var(--sheet);
  color: var(--ink);
  font: 500 13px/1.2 var(--f-body);
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 28px;
  margin-top: 20px;
}
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: var(--sheet);
  border: 1.5px solid var(--frame);
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.sheet::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--rule);
  pointer-events: none;
}
.sheet:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--frame); }
.sheet:focus-visible { outline: 3px solid var(--pencil); outline-offset: 4px; }

.plate {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--well);
  border: 1px solid var(--rule);
}
.plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focus, 50% 50%);
  transition: transform .5s ease;
}
.sheet:hover .plate img { transform: scale(calc(var(--zoom, 1) * 1.05)); }
.ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
  color: var(--ink-2);
}
.ph b { font: 400 72px/1 var(--f-display); color: var(--ink-2); opacity: .45; }
.ph span { font: 700 13px var(--f-code); letter-spacing: .1em; }
.fmt {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  background: var(--ink);
  color: var(--sheet);
  font: 700 12px/1.2 var(--f-code);
  letter-spacing: .08em;
}

.sheet .body { display: grid; align-content: start; gap: 8px; flex: 1; padding: 18px 6px 16px; }
.sheet h3 { margin: 0; font: 400 27px/1.15 var(--f-display); text-wrap: balance; }
.sheet .sum { margin: 0; max-width: 60ch; font-size: 14.5px; color: var(--ink-2); }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 6px; }
.feats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.feats li { padding: 1px 8px; border: 1px solid var(--rule); font-size: 12px; color: var(--ink-2); }
.go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 13px var(--f-code);
  color: var(--pencil);
  white-space: nowrap;
}
.go svg { transition: transform .2s ease; }
.sheet:hover .go svg { transform: translateX(3px); }

.tb {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 1px;
  margin: 0;
  background: var(--frame);
  border: 1px solid var(--frame);
  font-family: var(--f-code);
}
.tb > div { min-width: 0; padding: 5px 9px 6px; background: var(--sheet); }
.tb dt { font-size: 11px; letter-spacing: .12em; color: var(--ink-2); }
.tb dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 40px 24px;
  border: 1.5px dashed var(--rule);
  background: var(--sheet);
  color: var(--ink-2);
  text-align: center;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-2);
}

/* ── 작품 보기 ── */
html.viewer, html.viewer body { height: 100%; }
body.viewer { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.vbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px clamp(16px, 3vw, 28px);
  background: var(--sheet);
  border-bottom: 2px solid var(--frame);
}
.vtitle { display: flex; align-items: baseline; gap: 10px; flex: 1 1 260px; min-width: 0; }
.vtitle h1 {
  min-width: 0;
  margin: 0;
  font: 400 22px/1.25 var(--f-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vno { font: 700 12px var(--f-code); color: var(--ink-2); white-space: nowrap; }
.vchip { padding: 1px 8px; border: 1px solid var(--rule); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.vtools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vby { margin-right: 6px; font: 700 12px var(--f-code); color: var(--ink-2); white-space: nowrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--frame);
  background: var(--paper);
  color: var(--ink);
  font: 500 13px/1.2 var(--f-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--sheet); }
.btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.back { font-weight: 600; }
.stage { position: relative; min-height: 0; background: var(--well); }
.stage iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.loading {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  font: 700 13px/1.6 var(--f-code);
  letter-spacing: .06em;
  color: var(--ink-2);
}

@media (max-width: 760px) {
  .mast { grid-template-columns: 1fr; }
  .kyul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kyul > div { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .kyul dt { padding-inline: 4px; letter-spacing: .15em; }
  .kyul dd { padding-inline: 4px; font-size: 13px; }
}
@media (max-width: 640px) {
  .vbar { gap: 8px 10px; padding-block: 8px; }
  .vtitle { flex-basis: 160px; }
  .vtitle h1 { font-size: 18px; }
  .vchip, .vby, .btn .wide { display: none; }
  .btn { padding: 5px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .plate img, .go svg { transition: none; }
}
