/* hand/off — the team task inbox */

@font-face {
  font-family: 'Oswald';
  src: url('assets/oswald.ttf') format('truetype');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('assets/dm-sans.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ecefe8;
  --grid-dot: rgba(38, 66, 52, 0.14);
  --card: #ffffff;
  --card-soft: #f8faf6;
  --drawer-bg: #fdfcf9;
  --line: #d3dcd1;
  --line-strong: #b4c4b0;
  --ink: #1d2a24;
  --muted: #5f6e66;
  --faint: #8a978e;
  --forest: #2e6b4e;
  --forest-deep: #215239;
  --forest-tint: #e4efe7;
  --s-todo: #5b6771;
  --s-progress: #8a6310;
  --s-blocked: #b03a20;
  --s-done: #2e6b4e;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.25px);
  background-size: 22px 22px;
}
body.drawer-open { overflow: hidden; }

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

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  background: var(--forest);
  color: #fff;
  padding: 9px 15px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { left: 12px; }

/* ---------- masthead ---------- */

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-top: 26px;
  padding-bottom: 18px;
}
.brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.wordmark {
  margin: 0;
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-weight: 500;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.015em;
  color: var(--ink);
}
.wordmark .slash { color: var(--forest); font-weight: 600; }
.tagline { margin: 0; font-size: 14px; color: var(--muted); }
.masthead-meta {
  margin: 0;
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 4px;
}
.masthead-meta span { white-space: nowrap; }

/* ---------- toolbar ---------- */

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px max-content;
  gap: 16px 18px;
  align-items: end;
  padding: 22px 0 18px;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.input-wrap { position: relative; }
.input-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
input[type="search"],
select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
input#search { padding-left: 37px; }
input::placeholder { color: var(--faint); }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='8'%20viewBox='0%200%2012%208'%3E%3Cpath%20d='M1%201l5%205%205-5'%20fill='none'%20stroke='%235f6e66'%20stroke-width='2'%20stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.count {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  padding-bottom: 11px;
  white-space: nowrap;
}

/* ---------- the tray of slips ---------- */

.tray {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.slip {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.slip:hover { border-color: var(--line-strong); background: var(--card-soft); }
.slip[data-open="true"] { border-color: var(--forest); background: #f3f8f3; }

/* the status track: a real sequence — todo → in progress → blocked → done */
.track {
  position: relative;
  width: 64px;
  height: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.track::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: calc(50% - 1px);
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
.stop {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #c4d1c1;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.stop.current { transform: scale(1.32); box-shadow: 0 0 0 3px rgba(29, 42, 36, 0.12); }

.track[data-status="todo"] .stop.filled { background: var(--s-todo); border-color: var(--s-todo); }
.track[data-status="in-progress"] .stop.filled { background: var(--s-progress); border-color: var(--s-progress); }
.track[data-status="blocked"] .stop.filled { background: var(--s-blocked); border-color: var(--s-blocked); }
.track[data-status="done"] .stop.filled { background: var(--s-done); border-color: var(--s-done); }

.track.big { width: 100px; height: 22px; }
.track.big .stop { width: 11px; height: 11px; }

.slip-main { min-width: 0; }
.slip-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.slip-title {
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-weight: 450;
  font-size: 18.5px;
  line-height: 1.28;
  letter-spacing: 0.004em;
  color: var(--ink);
}
.slip-open:hover .slip-title {
  color: var(--forest-deep);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}
mark {
  background: #f3e7ae;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.slip-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.status-word { font-weight: 600; font-size: 12.5px; }
.status-word[data-status="todo"] { color: var(--s-todo); }
.status-word[data-status="in-progress"] { color: var(--s-progress); }
.status-word[data-status="blocked"] { color: var(--s-blocked); }
.status-word[data-status="done"] { color: var(--s-done); }
.fact { white-space: nowrap; }
.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--forest-deep);
  background: var(--forest-tint);
  border-radius: 999px;
  padding: 2px 10px;
}
.prio { font-size: 12.5px; }
.prio-high { color: var(--ink); font-weight: 600; }
.prio-medium { color: var(--muted); }
.prio-low { color: var(--faint); }

.slip-side {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}
.comments { display: inline-flex; align-items: center; gap: 5px; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.avatar.small { width: 24px; height: 24px; font-size: 9.5px; }

/* ---------- empty state ---------- */

.empty {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 46px 24px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.empty svg { color: var(--forest); margin-bottom: 10px; }
.empty h2 {
  margin: 0;
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
}
.empty p { margin: 0 0 12px; font-size: 14.5px; }
.btn-primary {
  border: 0;
  background: var(--forest);
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--forest-deep); }

.hint { margin: 16px 2px 32px; font-size: 12.5px; color: var(--faint); }

/* ---------- detail drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(24, 38, 31, 0.42);
  opacity: 0;
  transition: opacity 0.24s ease;
  z-index: 40;
}
.scrim.show { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(540px, 100%);
  background: var(--drawer-bg);
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 44px rgba(24, 40, 32, 0.14);
  transform: translateX(103%);
  transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.3, 1);
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.drawer.open { transform: none; }
.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px 48px;
}

.drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.icon-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--forest); }

.detail-title {
  margin: 14px 0 16px;
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-weight: 500;
  font-size: 27px;
  line-height: 1.22;
  letter-spacing: 0.005em;
  color: var(--ink);
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin: 0 0 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts dt { margin-bottom: 2px; font-size: 12px; font-weight: 500; color: var(--faint); }
.facts dd { margin: 0; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; padding: 0; }
.tags li {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.status-block {
  background: #f0f4ec;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 24px;
}
.status-block label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}
.status-row { display: flex; align-items: center; gap: 18px; }
.status-row select { flex: 1; }
.status-note { margin: 10px 0 0; font-size: 13px; font-weight: 600; }
.status-note[data-status="todo"] { color: var(--s-todo); }
.status-note[data-status="in-progress"] { color: var(--s-progress); }
.status-note[data-status="blocked"] { color: var(--s-blocked); }
.status-note[data-status="done"] { color: var(--s-done); }

.detail-body { font-size: 16px; line-height: 1.66; }
.detail-body p { margin: 0 0 14px; max-width: 62ch; white-space: pre-line; }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .shell { padding: 0 14px; }
  .masthead-inner { padding-top: 18px; padding-bottom: 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .brand { align-items: baseline; gap: 10px; }
  .wordmark { font-size: 30px; }
  .masthead-meta { padding-bottom: 0; }
  .toolbar { grid-template-columns: 1fr; gap: 12px; padding: 14px 0 14px; }
  .count { padding-bottom: 0; }
  .slip { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px 11px 10px; border-radius: 8px; }
  .track { width: 38px; height: 14px; }
  .track .stop { width: 7px; height: 7px; border-width: 1.5px; }
  .slip-title { font-size: 16.5px; }
  .slip-meta { gap: 4px 10px; font-size: 12px; }
  .comments { display: none; }
  .avatar { width: 27px; height: 27px; }
  .hint { margin: 12px 2px 24px; }
  .drawer-scroll { padding: 14px 16px 42px; }
  .detail-title { font-size: 23px; }
  .track.big { width: 76px; }
}

/* ---------- reduced motion ---------- */

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