/* Manifest — a team task inbox styled as a shop-floor signal-card board.
   Palette, type and structure are documented in asset-sources.json / commit notes. */

:root {
  --paper: #f1f1eb;
  --card: #fbfaf6;
  --ink: #1b1b18;
  --ink-soft: #57554a;
  --ink-faint: #6e6b59;
  --line: #d9d6c9;
  --line-strong: #1b1b18;

  --amber: #c9861a;
  --amber-bg: #f6e6c6;
  --steel: #2f5f8f;
  --steel-bg: #dce7f1;
  --rust: #ab3d24;
  --rust-bg: #f2dbd2;
  --moss: #336b47;
  --moss-bg: #dbe8dd;

  --font-display: "Century Gothic", "Avenir Next", Futura, "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Courier New", monospace;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink);
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus {
  outline: none;
}

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

.site-header :focus-visible {
  outline-color: #ffffff;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 22px 32px;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--amber);
}

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

.brand-mark {
  color: var(--amber);
  display: inline-flex;
}

.brand-name {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--paper);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

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

.field label {
  font-size: 11.5px;
  color: #c9c6b6;
  font-weight: 600;
}

.field-search {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 10px;
  bottom: 9px;
  color: var(--ink-faint);
  pointer-events: none;
}

#search-input {
  width: 240px;
  max-width: 60vw;
  padding: 8px 10px 8px 32px;
  border: 1px solid #4b4a3f;
  border-radius: 2px;
  background: var(--card);
  color: var(--ink);
}

#filter-select {
  padding: 8px 10px;
  border: 1px solid #4b4a3f;
  border-radius: 2px;
  background: var(--card);
  color: var(--ink);
  min-width: 152px;
}

#search-input::placeholder {
  color: var(--ink-faint);
}

/* ---------- board ---------- */

.board {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

.board-summary {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-soft);
}

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.card-item {
  min-width: 0;
}

.card {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--ink-faint);
}

.card-stripe {
  height: 7px;
  width: 100%;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-serial {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.status-tag {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
}

.status-tag[data-status="todo"] { background: var(--amber-bg); color: #7a5411; }
.status-tag[data-status="in-progress"] { background: var(--steel-bg); color: #1f4266; }
.status-tag[data-status="blocked"] { background: var(--rust-bg); color: #7a2a16; }
.status-tag[data-status="done"] { background: var(--moss-bg); color: #204a2e; }

.card-title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
}

.card-sentence {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

.card-summary {
  font-size: 13.5px;
  color: var(--ink);
  margin: 2px 0 0;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-faint);
}

.card-foot .comments {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stripe-todo { background: var(--amber); }
.stripe-in-progress { background: var(--steel); }
.stripe-blocked { background: var(--rust); }
.stripe-done { background: var(--moss); }

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

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  padding: 40px 24px;
  text-align: center;
  max-width: 440px;
  margin: 40px auto 0;
}

.empty-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 6px;
}

.empty-copy {
  color: var(--ink-soft);
  margin: 0 0 16px;
  font-size: 14px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.btn:hover {
  background: #322f26;
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
}

.btn-quiet:hover {
  background: var(--line);
}

/* ---------- detail dialog ---------- */

.detail {
  border: none;
  border-radius: 4px;
  padding: 0;
  width: min(620px, 92vw);
  max-height: min(760px, 88vh);
  overflow: hidden;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.detail::backdrop {
  background: rgba(27, 27, 24, 0.55);
}

.detail[open] {
  display: flex;
  flex-direction: column;
  animation: card-in 0.18s ease-out;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-stripe {
  height: 8px;
  width: 100%;
  flex: none;
}

.detail-inner {
  padding: 22px 26px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-serial {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.detail-close {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
}

.detail-close:hover {
  background: var(--line);
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.detail-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 13.5px;
}

.detail-facts dt {
  color: var(--ink-faint);
  font-weight: 600;
}

.detail-facts dd {
  margin: 0;
  color: var(--ink);
}

.detail-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.detail-body p {
  margin: 0 0 12px;
}

.detail-body p:last-child {
  margin-bottom: 0;
}

.detail-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.detail-status-row label {
  font-weight: 600;
  font-size: 13.5px;
}

.detail-status-row select {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--paper);
}

.status-feedback {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--moss);
  font-weight: 600;
  min-height: 1.3em;
}

.detail-comments {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .site-header {
    padding: 18px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #search-input {
    width: 100%;
    max-width: none;
  }

  #filter-select {
    width: 100%;
  }

  .board {
    padding: 18px 16px 48px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .detail {
    width: 100%;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }

  .detail-inner {
    padding: 18px 18px 24px;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
