:root {
  --ink: #11110f;
  --paper: #e9e4d7;
  --panel: #d8d2c4;
  --signal: #f25c35;
  --acid: #d7f542;
  --line: rgba(17, 17, 15, .18);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--ink); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
body { overflow: hidden; }
button, input { font: inherit; }

.topbar {
  height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 24px; background: var(--paper); border-bottom: 1px solid var(--ink);
  font-size: 12px; font-weight: 800; letter-spacing: .12em;
}
.back { color: inherit; text-decoration: none; }
.wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--paper); background: var(--ink); }
.license { justify-self: end; }

main { height: calc(100vh - 64px); display: grid; grid-template-columns: minmax(300px, 370px) 1fr; }
.library-panel { min-height: 0; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--ink); }
.library-heading { padding: 28px 28px 22px; }
.eyebrow { margin: 0 0 9px; font: 700 11px/1.2 "Courier New", monospace; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(40px, 4.6vw, 66px); line-height: .84; letter-spacing: -.055em; text-transform: uppercase; }
.library-heading > p:last-child { max-width: 285px; margin: 18px 0 0; color: #555149; font-size: 14px; line-height: 1.45; }
.search-box { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; margin: 0 28px 18px; border-bottom: 2px solid var(--ink); }
.search-box span { font: 700 10px/1 "Courier New", monospace; letter-spacing: .12em; }
.search-box input { min-width: 0; padding: 11px 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.group-label { margin: 0; padding: 0 28px 9px; color: #68645b; font: 700 9px/1 "Courier New", monospace; letter-spacing: .14em; }
.pack-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 0 28px 16px; }
.pack-tabs button { min-width: 0; min-height: 54px; display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); background: #ded8ca; color: var(--ink); text-align: left; cursor: pointer; font: 700 9px/1.15 "Courier New", monospace; }
.pack-tabs button:first-child { grid-column: 1 / -1; min-height: 38px; }
.pack-tabs button:hover { border-color: var(--ink); }
.pack-tabs button.active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.folder-glyph { position: relative; width: 22px; height: 15px; display: block; border: 1px solid currentColor; }
.folder-glyph::before { content: ""; position: absolute; left: -1px; top: -6px; width: 10px; height: 5px; border: 1px solid currentColor; border-bottom: 0; }
.folder-count { align-self: start; padding: 2px 4px; border: 1px solid currentColor; font-size: 8px; }
.asset-count { padding: 9px 28px; border-block: 1px solid var(--line); font: 700 10px/1 "Courier New", monospace; letter-spacing: .12em; }
.asset-list { min-height: 0; overflow-y: auto; padding-bottom: 30px; }
.asset-item { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 12px 22px 12px 28px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.asset-item:hover, .asset-item.active { background: var(--acid); }
.asset-item .number { font: 700 10px/1 "Courier New", monospace; color: #68645b; }
.asset-item strong { overflow: hidden; text-overflow: ellipsis; font-size: 13px; white-space: nowrap; }
.asset-item .arrow { font-size: 17px; }

.viewer-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr auto; background: #24231f; color: var(--paper); }
.viewer-meta { display: flex; justify-content: space-between; gap: 20px; padding: 25px 30px 20px; border-bottom: 1px solid rgba(233,228,215,.18); }
.viewer-meta h2 { margin: 0; font-size: clamp(28px, 3vw, 46px); line-height: 1; text-transform: uppercase; }
.viewer-actions { display: flex; align-items: center; gap: 8px; }
.viewer-actions button { padding: 10px 13px; border: 1px solid rgba(233,228,215,.45); color: inherit; background: transparent; cursor: pointer; font: 700 10px/1 "Courier New", monospace; }
.viewer-actions button[aria-pressed="true"] { border-color: var(--acid); background: var(--acid); color: var(--ink); }
.canvas-shell { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(circle at 50% 46%, #47443b 0, #2b2924 42%, #181815 100%); }
.canvas-shell::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, transparent, #000 25%, #000); }
#render-canvas { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(17,17,15,.72); font: 700 12px/1 "Courier New", monospace; letter-spacing: .15em; z-index: 3; }
.loading.hidden { display: none; }
.control-hint { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; padding: 9px 12px; background: rgba(17,17,15,.72); white-space: nowrap; font: 700 9px/1 "Courier New", monospace; letter-spacing: .08em; z-index: 2; }
.file-strip { display: grid; grid-template-columns: repeat(3, auto) 1fr; align-items: center; gap: 34px; min-height: 72px; padding: 12px 30px; border-top: 1px solid rgba(233,228,215,.18); }
.file-strip div { display: grid; gap: 4px; }
.file-strip span { color: #999388; font: 700 9px/1 "Courier New", monospace; letter-spacing: .12em; }
.file-strip strong { font-size: 12px; }
.file-strip a { justify-self: end; padding: 11px 15px; color: var(--ink); background: var(--signal); text-decoration: none; font: 800 10px/1 "Courier New", monospace; }

@media (max-width: 760px) {
  body { overflow: auto; }
  .topbar { grid-template-columns: 1fr auto; }
  .license { display: none; }
  main { height: auto; min-height: calc(100vh - 64px); grid-template-columns: 1fr; }
  .library-panel { max-height: 47vh; border-right: 0; border-bottom: 1px solid var(--ink); }
  .library-heading { padding: 20px 20px 14px; }
  .library-heading > p:last-child { display: none; }
  h1 { font-size: 38px; }
  .search-box { margin-inline: 20px; }
  .group-label, .pack-tabs { padding-inline: 20px; }
  .asset-item { padding-left: 20px; }
  .viewer-panel { min-height: 58vh; }
  .viewer-meta { padding: 18px 20px; }
  .viewer-actions button:first-child { display: none; }
  .file-strip { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px 20px; }
  .file-strip div:nth-child(3) { display: none; }
  .file-strip a { justify-self: stretch; text-align: center; }
}
