:root {
  --ink: #141414; --muted: #6b6b6b; --line: #e4e2dd; --paper: #f7f6f3; --card: #fff; --accent: #c8431e;
  --side: 248px;
  font: 14px/1.45 ui-sans-serif, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; height: 48px; display: flex; align-items: center; gap: 14px;
  padding: 0 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.crumb { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { display: none; border: 0; background: none; font-size: 18px; padding: 4px; }

/* sidebar */
.layout { display: flex; }
.side { position: sticky; top: 48px; height: calc(100vh - 48px); width: var(--side); flex: none; overflow-y: auto;
  padding: 14px 10px 40px; border-right: 1px solid var(--line); }
.side h4 { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side h4:first-child { margin-top: 4px; }
.side a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px; border-radius: 6px; }
.side a:hover { background: #ecebe6; }
.side a.on { background: var(--ink); color: #fff; }
.side a small { color: var(--muted); font-variant-numeric: tabular-nums; }
.side a.on small { color: #bbb; }

main { flex: 1; min-width: 0; padding: 26px 32px 80px; }

/* collection header */
.head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.meta { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 18px 0 8px; }
.toolbar .lbl { color: var(--muted); margin-right: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 5px 12px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button:disabled { color: #bbb; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 4px 12px; }
.chip:hover { border-color: var(--ink); }

/* sections + grid */
section.group { margin-top: 30px; }
section.group > h2 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
section.group > h2 small { font-weight: 400; color: var(--muted); font-size: 13px; }
section.group > p { margin: 3px 0 0; color: var(--muted); max-width: 78ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 12px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; transition: border-color .12s, transform .12s; }
.card:hover { border-color: var(--ink); transform: translateY(-1px); }
.card .ph { aspect-ratio: 3 / 4; background: #eeede9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card .cap { padding: 7px 10px; display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.card .cap span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 10px; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; align-self: center; white-space: nowrap; }
.wide .grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.wide .card .ph { aspect-ratio: auto; max-height: 260px; }

/* home */
.home { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tile:hover { border-color: var(--ink); }
.tile .strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: #eeede9; }
.tile .strip img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.tile .t { padding: 10px 12px; }
.tile .t b { font-weight: 600; display: block; }
.tile .t span { color: var(--muted); font-size: 13px; }
.home-group { margin-top: 30px; }
.home-group:first-child { margin-top: 0; }
.home-group h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }

/* viewer */
.viewer { position: fixed; inset: 0; z-index: 20; background: #111; color: #eee; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.vbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #262626; flex-wrap: wrap; }
.vtitle { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtitle small { color: #8a8a8a; font-weight: 400; margin-left: 8px; }
.vtools { display: flex; align-items: center; gap: 8px; }
.viewer .seg { background: #1c1c1c; border-color: #333; }
.viewer .seg button + button { border-left-color: #333; }
.viewer .seg button.on { background: #eee; color: #111; }
.viewer .seg button:disabled { color: #555; }
.btn { border: 1px solid #333; background: #1c1c1c; border-radius: 7px; padding: 5px 12px; white-space: nowrap; }
.btn:hover { border-color: #888; }
.btn.off { opacity: .35; pointer-events: none; }
.btn.icon { padding: 5px 10px; }
.vstage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px 64px; overflow: auto; }
.vstage img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; box-shadow: 0 8px 40px rgba(0,0,0,.5); cursor: zoom-in; }
.vstage.zoom { align-items: flex-start; justify-content: flex-start; }
.vstage.zoom img { max-width: none; max-height: none; width: 2400px; cursor: zoom-out; margin: auto; }
.vstage .loading { opacity: .55; filter: blur(1px); }
.nav { position: fixed; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255,255,255,.06); width: 44px; height: 80px; font-size: 32px; border-radius: 8px; color: #ddd; z-index: 2; }
.nav:hover { background: rgba(255,255,255,.16); }
.nav.prev { left: 10px; } .nav.next { right: 10px; }
.vnote { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #9a9a9a; background: rgba(0,0,0,.6); padding: 3px 10px; border-radius: 99px; }
.vnote:empty { display: none; }
.vfoot { padding: 8px 14px 12px; color: #9a9a9a; font-size: 13px; border-top: 1px solid #262626; }
.vfoot kbd { border: 1px solid #444; border-radius: 3px; padding: 0 4px; font: 11px ui-monospace, monospace; }

@media (max-width: 760px) {
  .menu { display: block; }
  .side { position: fixed; left: 0; z-index: 10; background: var(--paper); transform: translateX(-100%); transition: transform .18s; box-shadow: 4px 0 20px rgba(0,0,0,.1); }
  body.nav-open .side { transform: none; }
  main { padding: 18px 14px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .vstage { padding: 8px; }
  .nav { width: 34px; height: 60px; font-size: 26px; background: rgba(0,0,0,.4); }
  .vfoot { display: none; }
}
