:root {
  --paper: #f3ead8;
  --ink: #2a2118;
  --clay: #b8532f;
  --moss: #4d6b3f;
  --plum: #6b2e4f;
  --ticket: #fffaf0;
  --line: #2a2118;
  --focus: #1f4fd6;
  --serif: ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); color: var(--ink); }

body {
  margin: 0;
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
  background:
    radial-gradient(circle at 1px 1px, rgba(42, 33, 24, 0.12) 1px, transparent 0) 0 0 / 22px 22px,
    var(--paper);
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.masthead {
  padding: 40px 32px 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.kicker {
  margin: 0;
  font: 600 13px/1.2 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
}

.wordmark {
  margin: 4px 0 8px;
  font: 900 clamp(64px, 12vw, 148px)/0.9 var(--serif);
  letter-spacing: -0.04em;
}

.dot { color: var(--clay); }

.lede {
  max-width: 44ch;
  margin: 0;
  font-size: 18px;
  font-family: var(--serif);
  font-style: italic;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 32px 200px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 16px;
  align-items: end;
  padding: 16px 0 20px;
  border-bottom: 2px solid var(--line);
}

.field { display: grid; gap: 6px; }

.field label {
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input[type="search"],
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: 17px var(--sans);
  color: var(--ink);
  background: var(--ticket);
  border: 2px solid var(--line);
  border-radius: 4px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 44px;
}

.toggle,
.close,
.save,
#reset-filters {
  padding: 10px 16px;
  background: var(--ticket);
  border: 2px solid var(--line);
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.toggle[aria-pressed="true"],
.save[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ticket);
}

.count {
  display: inline-block;
  min-width: 1.6em;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--clay);
  color: var(--ticket);
  font-size: 13px;
  text-align: center;
}

.status {
  min-height: 1.5em;
  margin: 12px 0;
  font-size: 14px;
  color: var(--moss);
}

/* The board: one column per calendar day, a ticket pinned to each date. */
.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.day {
  position: relative;
  padding-top: 8px;
}

.day-label {
  margin: 0 0 10px;
  font: 700 15px/1.2 var(--serif);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.day-label span {
  display: block;
  font: 600 12px/1.2 var(--sans);
  letter-spacing: 0.1em;
  color: var(--moss);
}

.ticket {
  position: relative;
  margin: 0 0 18px;
  padding: 0;
  background: var(--ticket);
  border: 2px solid var(--line);
  border-radius: 4px;
  box-shadow: 6px 6px 0 var(--line);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 180ms ease;
}

.ticket:nth-child(3n) { --tilt: -0.6deg; }
.ticket:nth-child(3n+1) { --tilt: 0.5deg; }
.ticket:hover { transform: rotate(0deg) translateY(-2px); }

.ticket::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--clay);
  border: 2px solid var(--line);
}

.ticket img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 2px solid var(--line);
}

.ticket-body { padding: 12px 14px 14px; }

.ticket-cat {
  margin: 0;
  font: 600 12px/1.2 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plum);
}

.ticket h3 {
  margin: 4px 0 6px;
  font: 700 22px/1.15 var(--serif);
}

.ticket-meta {
  margin: 0 0 12px;
  font-size: 14px;
}

.ticket-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.open-item {
  padding: 8px 12px;
  background: var(--ink);
  color: var(--ticket);
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-weight: 600;
}

.pinned-mark {
  font: 600 12px/1 var(--sans);
  color: var(--clay);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty {
  margin-top: 40px;
  padding: 32px;
  text-align: center;
  font-family: var(--serif);
  font-size: 22px;
  border: 2px dashed var(--line);
}

.empty p { margin: 0 0 16px; }

/* The tote: a fixed shelf along the bottom holding saved tickets. */
.tote {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(1100px, 100%);
  transform: translateX(-50%);
  z-index: 5;
  padding: 12px 32px 16px;
  background: var(--moss);
  color: var(--ticket);
  border-top: 2px solid var(--line);
}

.tote h2 {
  margin: 0 0 8px;
  font: 700 18px/1 var(--serif);
}

.tote-list {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0 0 4px;
  list-style: none;
  overflow-x: auto;
  min-height: 32px;
}

.tote-list li { flex: 0 0 auto; }

.tote-chip {
  min-height: 36px;
  padding: 4px 12px;
  background: var(--ticket);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 999px;
  font: 600 14px/1.2 var(--sans);
  white-space: nowrap;
}

.tote-empty { color: var(--ticket); font-size: 14px; opacity: 0.85; }

/* Detail view: a full-screen sheet rendered over the board. */
.detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(42, 33, 24, 0.55);
}

.detail[hidden] { display: none; }

.detail-sheet {
  width: min(680px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  background: var(--ticket);
  border: 2px solid var(--line);
  border-radius: 4px;
  box-shadow: 10px 10px 0 var(--line);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.detail-kicker {
  margin: 0;
  font: 600 13px/1.2 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plum);
}

.detail-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 16px 0;
  border: 2px solid var(--line);
}

.detail-title {
  margin: 0 0 12px;
  font: 900 clamp(32px, 6vw, 48px)/1.05 var(--serif);
  letter-spacing: -0.02em;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.facts dt {
  font: 600 12px/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--moss);
}

.facts dd { margin: 2px 0 0; font-weight: 600; }

.detail-body {
  margin: 0 0 20px;
  font: 19px/1.5 var(--serif);
}

.save { width: 100%; font-size: 17px; }

@media (max-width: 760px) {
  .masthead,
  main { padding-left: 18px; padding-right: 18px; }
  .controls { grid-template-columns: 1fr; }
  .toggle { width: 100%; }
  .board { grid-template-columns: 1fr; }
  main { padding-bottom: 240px; }
  .tote { padding-left: 18px; padding-right: 18px; }
  .detail { padding: 0; place-items: end stretch; }
  .detail-sheet { width: 100%; max-height: 92vh; border-radius: 0; box-shadow: none; border-left: 0; border-right: 0; border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
