:root {
  --paper: #f4efe5;
  --ink: #181713;
  --muted: #716b61;
  --line: #c8bda7;
  --panel: #fffaf0;
  --red: #c9352b;
  --blue: #1b5a7a;
  --green: #3f704d;
  --yellow: #d9a21b;
  --shadow: 0 18px 45px rgba(24, 23, 19, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(24, 23, 19, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(24, 23, 19, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

button, input, select { font: inherit; }

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.masthead {
  min-height: 168px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  border-bottom: 3px solid var(--ink);
  padding: 24px 0 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 920px;
  font-family: "Iowan Old Style", "Palatino", Georgia, serif;
  font-size: clamp(42px, 8vw, 112px);
  line-height: 0.9;
  letter-spacing: 0;
}

.ledger {
  width: 260px;
  border: 2px solid var(--ink);
  background: var(--panel);
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 6px 6px 0 var(--yellow);
}

.workspace {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  margin-top: 24px;
  align-items: start;
}

.controls {
  position: sticky;
  top: 18px;
  border: 2px solid var(--ink);
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
}

.search span {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

input, select {
  width: 100%;
  border: 2px solid var(--ink);
  background: #fffdf7;
  color: var(--ink);
  padding: 11px 12px;
  border-radius: 0;
}

.filter-row {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-button {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  min-height: 30px;
  padding: 5px 8px;
  cursor: pointer;
}

.tag-button.active {
  background: var(--ink);
  color: var(--paper);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 18px;
}

.card {
  min-width: 0;
  border: 2px solid var(--ink);
  background: var(--panel);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--blue);
}

.thumb {
  aspect-ratio: 16 / 9;
  background: #ded5c6;
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 12px;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.card h2 {
  margin: 8px 0 8px;
  font-family: "Iowan Old Style", "Palatino", Georgia, serif;
  font-size: 23px;
  line-height: 1;
}

.summary {
  min-height: 54px;
  margin: 0;
  color: #39362f;
  font-size: 14px;
  line-height: 1.35;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.chip {
  border: 1px solid var(--line);
  padding: 3px 6px;
  font-size: 12px;
  color: var(--muted);
  background: #fffdf7;
}

.empty {
  grid-column: 1 / -1;
  border: 2px dashed var(--muted);
  padding: 42px;
  background: rgba(255, 250, 240, 0.66);
}

.detail {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(760px, 100vw);
  overflow: auto;
  background: var(--panel);
  border-left: 3px solid var(--ink);
  box-shadow: -24px 0 60px rgba(24, 23, 19, 0.22);
  transform: translateX(105%);
  transition: transform 220ms ease;
  z-index: 10;
}

.detail.open {
  transform: translateX(0);
}

.close {
  position: sticky;
  top: 14px;
  float: right;
  width: 36px;
  height: 36px;
  margin: 14px;
  border: 2px solid var(--ink);
  background: var(--red);
  color: white;
  cursor: pointer;
}

.detail-inner {
  padding: 58px 24px 34px;
}

.detail h2 {
  margin: 0 44px 14px 0;
  font-family: "Iowan Old Style", "Palatino", Georgia, serif;
  font-size: 44px;
  line-height: 0.96;
}

.detail-cover {
  border: 2px solid var(--ink);
  background: #ded5c6;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.slides {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.slides img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--ink);
  background: #ded5c6;
}

.package-box {
  margin-top: 18px;
  border: 2px solid var(--ink);
  padding: 12px;
  background: #fffdf7;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 850px) {
  .masthead,
  .workspace {
    grid-template-columns: 1fr;
  }

  .ledger {
    width: 100%;
  }

  .controls {
    position: static;
  }
}
