/* Pigeonhole — a sorting desk for a small team's task inbox */

@font-face {
  font-family: "DM Serif Display";
  src: url("assets/dm-serif.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ececea;
  --card: #fdfdfc;
  --ink: #23262b;
  --muted: #636a74;
  --line: #d6d5cf;
  --line-strong: #23262b;
  --accent: #2c55d9;
  --accent-ink: #1d3ba0;
  --todo: #57616f;
  --in-progress: #2c55d9;
  --blocked: #c43a20;
  --done: #2e7d4f;
  --focus: #2c55d9;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "DM Serif Display", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 60;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Masthead ---------- */

.masthead {
  background: var(--card);
  border-bottom: 2px solid var(--line-strong);
}

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  color: var(--ink);
  flex: none;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  margin: 0;
  letter-spacing: 0.01em;
}

.brand-sub {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.tally {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
  padding-bottom: 4px;
}

.tally strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Workspace ---------- */

.workspace {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 90px;
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 30px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field-search { flex: 1 1 340px; }
.field-filter { flex: 0 1 220px; }

.toolbar input,
.toolbar select {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: 3px;
  padding: 10px 13px;
  width: 100%;
}

.toolbar input::placeholder { color: #9aa0a8; }

/* ---------- Pigeonholes (status sections) ---------- */

.hole { margin-bottom: 34px; }

.hole-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.hole-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex: none;
}

.hole-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.005em;
}

.hole-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 7px;
  background: var(--card);
}

.hole-rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.hole-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Task cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 15px 16px 13px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  align-items: start;
  cursor: pointer;
}

.card:hover { border-color: var(--line-strong); }

.card-title {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
}

.card-title:hover { color: var(--accent); }

.card-done .card-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: #b9bcb2;
}

.card-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.card-meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }

.meta-label {
  font-weight: 600;
  color: #878d96;
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.priority-high .priority-dot { background: var(--blocked); }
.priority-medium .priority-dot { background: var(--accent); }
.priority-low .priority-dot { background: #a9adb4; }

/* ---------- Rubber stamps ---------- */

.stamp {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1;
  padding: 5px 9px 4px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: rotate(-3deg);
  white-space: nowrap;
  margin-top: 2px;
}

.stamp-todo { color: var(--todo); }
.stamp-in-progress { color: var(--in-progress); }
.stamp-blocked { color: var(--blocked); }
.stamp-done { color: var(--done); }

.stamp-lg {
  font-size: 17px;
  padding: 7px 12px 6px;
  border-width: 2.5px;
}

/* ---------- Buttons ---------- */

.btn {
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 3px;
  padding: 10px 18px;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
}
.btn-primary:hover { background: #000; }

/* ---------- Empty state ---------- */

.empty {
  border: 1.5px dashed #b6b7b0;
  border-radius: 4px;
  background: var(--card);
  text-align: center;
  padding: 54px 24px 58px;
  max-width: 560px;
  margin: 30px auto 0;
}

.empty-title {
  font-family: var(--serif);
  font-size: 26px;
  margin: 0 0 8px;
}

.empty-body {
  color: var(--muted);
  margin: 0 0 22px;
}

/* ---------- Detail drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(35, 38, 43, 0.42);
  z-index: 30;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: var(--card);
  border-left: 2px solid var(--line-strong);
  z-index: 40;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .drawer.open { animation: drawer-in 0.22s ease; }
  .scrim.open { animation: fade-in 0.22s ease; }
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.btn-close {
  background: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.btn-close:hover { background: var(--bg); }

.drawer-body {
  padding: 22px 26px 40px;
  overflow-y: auto;
}

.detail-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.18;
  margin: 0 0 20px;
}

.status-field {
  margin-bottom: 22px;
}

.status-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.status-field select {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: 3px;
  padding: 9px 12px;
  width: 100%;
  max-width: 260px;
}

.status-hint {
  font-size: 13px;
  color: var(--done);
  margin: 8px 0 0;
  min-height: 1.2em;
}

.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 18px;
  margin: 0 0 22px;
  padding: 14px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.meta-grid dt {
  color: #878d96;
  font-weight: 600;
}

.meta-grid dd {
  margin: 0;
  color: var(--ink);
}

.detail-text p {
  font-size: 15.5px;
  line-height: 1.65;
  margin: 0 0 14px;
  max-width: 60ch;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 4px;
  z-index: 50;
  max-width: min(90vw, 440px);
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .masthead-inner { padding: 18px 18px 14px; }
  .brand { gap: 12px; }
  .brand-mark { width: 38px; height: 38px; }
  .wordmark { font-size: 32px; }
  .tally { text-align: left; padding-bottom: 0; }
  .workspace { padding: 20px 16px 80px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .toolbar .field { flex: 0 0 auto; }
  .hole-cards { grid-template-columns: 1fr; }
  .drawer { width: 100vw; border-left: 0; }
  .drawer-body { padding: 20px 18px 40px; }
  .detail-title { font-size: 24px; }
}

/* ---------- Motion ---------- */

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