/* Handoff — team task inbox */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --paper: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #f0e9db;
  --ink: #22271f;
  --ink-soft: #5b6152;
  --ink-faint: #8a8f7f;
  --line: #ddd3c0;
  --accent: #1f6f54;
  --accent-strong: #15523e;
  --accent-soft: #dcece2;
  --focus: #b3541e;

  --c-todo: #3d6fd6;
  --c-todo-bg: #e3ebfb;
  --c-progress: #9a6b0c;
  --c-progress-bg: #f8ecd0;
  --c-blocked: #b03a2e;
  --c-blocked-bg: #f9e2de;
  --c-done: #1f6f54;
  --c-done-bg: #dcece2;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(34, 39, 31, 0.06), 0 8px 24px rgba(34, 39, 31, 0.07);
  --shadow-lg: 0 24px 64px rgba(34, 39, 31, 0.28);
  --font-body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(31, 111, 84, 0.08), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- focus ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 60;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.topbar-tag {
  margin: 0;
  color: var(--ink-faint);
  font-size: 14px;
}

/* ---------- layout ---------- */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.board-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.board-count { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-search { flex: 1 1 260px; }
.field-filter { flex: 0 1 220px; }
.field-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.search-wrap { position: relative; }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  pointer-events: none;
}
#search {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
#search::placeholder { color: var(--ink-faint); }

select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}

/* ---------- task list ---------- */
.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: start;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.task-card:hover { border-color: #c4b795; }

.task-card.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}

.task-topline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill-todo { color: var(--c-todo); background: var(--c-todo-bg); }
.pill-in-progress { color: var(--c-progress); background: var(--c-progress-bg); }
.pill-blocked { color: var(--c-blocked); background: var(--c-blocked-bg); }
.pill-done { color: var(--c-done); background: var(--c-done-bg); }

.pill-priority {
  color: var(--ink-soft);
  background: var(--surface-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}
.pill-priority::before { display: none; }

.task-title {
  grid-column: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 18.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.open-item {
  all: unset;
  cursor: pointer;
  color: var(--ink);
  border-radius: 6px;
}
.open-item:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.open-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.task-summary {
  grid-column: 1;
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 13.5px;
}
.task-meta .meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.task-meta svg { width: 15px; height: 15px; flex: none; }
.meta-project { color: var(--ink-soft); font-weight: 600; }

.task-open-cell {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: center;
}

.btn {
  font: inherit;
  font-weight: 600;
  color: var(--surface);
  background: var(--accent);
  border: 1.5px solid var(--accent-strong);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-strong); }
.btn-ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 14px; border-radius: 8px; }

/* ---------- empty state ---------- */
.empty-state[hidden] { display: none; }
.empty-state {
  margin-top: 8px;
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.empty-art { width: 64px; height: 64px; color: var(--ink-faint); }
.empty-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 4px 0 0;
}
.empty-text { margin: 0 0 10px; color: var(--ink-soft); max-width: 46ch; }

/* ---------- detail panel ---------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(34, 39, 31, 0.45);
  z-index: 30;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.scrim.is-visible { opacity: 1; }

.detail[hidden] { display: none; }
.detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  z-index: 40;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
}
.detail.is-open { transform: translateX(0); }

.detail-inner {
  overflow-y: auto;
  padding: 22px 26px 40px;
  flex: 1;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.detail-kicker {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 0 0 6px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 12px;
}
.close-detail {
  all: unset;
  cursor: pointer;
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.close-detail:hover { background: var(--surface-2); }
.close-detail svg { width: 18px; height: 18px; }

.detail-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }

.status-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.status-block-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0;
}
.status-block select { width: auto; min-width: 170px; background: var(--surface); }

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}
.detail-meta > div {
  border-left: 3px solid var(--surface-2);
  padding-left: 10px;
  min-width: 0;
}
.detail-meta dt {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
}
.detail-meta dd { margin: 2px 0 0; font-size: 15px; font-weight: 500; }

.detail-body-heading {
  font-family: var(--font-display);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.detail-body p { margin: 0 0 14px; color: var(--ink); }
.detail-body .expected {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

/* ---------- toast ---------- */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 50;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--ink);
  color: var(--surface);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.25s ease;
}
.toast .toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.toast.is-leaving { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .layout { padding: 20px 16px 90px; }
  .board-title { font-size: 28px; }
  .topbar-tag { display: none; }
  .task-card { grid-template-columns: minmax(0, 1fr); }
  .task-open-cell {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: 4px;
  }
  .task-summary { -webkit-line-clamp: 3; }
  .detail {
    width: 100vw;
    border-left: 0;
  }
  .detail-inner { padding: 18px 18px 36px; }
  .detail-meta { grid-template-columns: 1fr; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .detail { transform: none; visibility: hidden; }
  .detail.is-open { visibility: visible; }
}
