/* ============================================================
   Intake — shared task inbox
   Shape system: inputs & buttons 8px, chips/tags pill, panels 14px.
   One accent (deep green). Status colors are semantic only.
   ============================================================ */

@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: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f4f3ee;
  --surface: #fcfbf8;
  --surface-2: #edebe3;
  --ink: #23231e;
  --muted: #6d6c61;
  --faint: #73726a;
  --line: #e2e0d6;
  --line-strong: #c9c7ba;
  --accent: #33654e;
  --accent-soft: #e0e8e0;

  /* status: text / tinted chip background */
  --st-todo-t: #5d5c50;   --st-todo-b: #e9e7db;
  --st-prog-t: #2f5d8a;   --st-prog-b: #dfe8f1;
  --st-block-t: #98482e;  --st-block-b: #f3e2da;
  --st-done-t: #35684a;   --st-done-b: #dfe9e0;

  --scrim: rgba(31, 30, 25, 0.45);
  --shadow: 0 18px 48px rgba(48, 46, 36, 0.18), 0 2px 8px rgba(48, 46, 36, 0.08);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Work Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171714;
    --surface: #1f1e1a;
    --surface-2: #2a2922;
    --ink: #eae8de;
    --muted: #a5a294;
    --faint: #8b897c;
    --line: #2e2d27;
    --line-strong: #403e35;
    --accent: #8fc4a3;
    --accent-soft: #243128;

    --st-todo-t: #b1af9f;   --st-todo-b: #2b2a24;
    --st-prog-t: #9ec3e2;   --st-prog-b: #243140;
    --st-block-t: #e2a184;  --st-block-b: #3b2820;
    --st-done-t: #93caa6;   --st-done-b: #223229;

    --scrim: rgba(8, 8, 6, 0.6);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

html { scrollbar-gutter: stable; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body.locked { overflow: hidden; }

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

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

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.mark {
  width: 26px; height: 26px;
  color: var(--accent);
  flex: none;
}

.brand h1 {
  margin: 0;
  font: 700 18px/1.1 var(--font-display);
  letter-spacing: -0.01em;
}

.brand p {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.summary {
  margin: 0;
  font: 400 12.5px var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- main column ---------- */

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 64px;
}

/* toolbar */

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

.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1 1 auto; }

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

.field input,
.field select {
  height: 40px;
  padding: 0 12px;
  font: 400 14.5px var(--font-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}
.field select { padding-right: 34px; }
.field input::placeholder { color: var(--faint); }
.field input { width: 100%; }
.field.grow input { max-width: 460px; }

/* ---------- task list ---------- */

.tasklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tasklist:not(:empty) { border-top: 1px solid var(--line); }

.tasklist li + li { border-top: 1px solid var(--line); }

.row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 15px 10px;
  margin: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .row { transition: background-color 140ms ease; }
}

.row:hover { background: var(--surface); }
.row:active { transform: translateY(0.5px); }

.row-main { flex: 1 1 auto; min-width: 0; }

.row-title {
  display: inline-block;
  font: 600 15.5px/1.35 var(--font-body);
  margin: 3px 0 5px;
}

.prio-high {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 8px;
  padding: 1px 8px 2px;
  font: 500 11px/1.4 var(--font-body);
  color: var(--st-block-t);
  background: var(--st-block-b);
  border-radius: 999px;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--muted);
}

.assignee { display: inline-flex; align-items: center; gap: 7px; }

.avatar {
  width: 21px; height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 400 10px var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  flex: none;
}

.row-meta .mono { font: 400 12.5px var(--font-mono); }

/* status tag */

.tag {
  flex: none;
  min-width: 96px;
  margin-top: 4px;
  padding: 4px 11px 5px;
  text-align: center;
  font: 600 12px/1.3 var(--font-body);
  border-radius: 999px;
}
.tag-todo    { color: var(--st-todo-t);  background: var(--st-todo-b); }
.tag-in-progress { color: var(--st-prog-t); background: var(--st-prog-b); }
.tag-blocked { color: var(--st-block-t); background: var(--st-block-b); }
.tag-done    { color: var(--st-done-t);  background: var(--st-done-b); }

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

.empty {
  padding: 72px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.empty-title {
  margin: 0;
  font: 600 18px var(--font-display);
}

.empty-hint {
  margin: 6px 0 20px;
  font-size: 14px;
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 9px 16px;
  font: 500 14px var(--font-body);
  color: var(--accent-ink, #fcfbf8);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .button { color: #16241b; }
}
@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color 140ms ease, transform 100ms ease; }
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: scale(0.98); }

/* ---------- detail panel ---------- */

/* author display must not defeat the [hidden] attribute */
.panel[hidden], .scrim[hidden] { display: none; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--scrim);
  border: 0;
  padding: 0;
}

.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 50;
  width: min(520px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 14px 0 0 14px;
}

@media (prefers-reduced-motion: no-preference) {
  .panel {
    transform: translateX(24px);
    opacity: 0;
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
  }
  .panel.open { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head-text { flex: 1 1 auto; min-width: 0; }

.close {
  flex: none;
  margin: -2px -10px 0 0;
  padding: 6px 12px;
  font: 500 13px var(--font-body);
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.close:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.panel-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font: 400 12px var(--font-mono);
  color: var(--muted);
}

.kproj {
  font: 500 12.5px var(--font-body);
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px 10px;
}

.tagchip {
  font: 400 11.5px var(--font-mono);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 9px;
}

.panel-head h2 {
  margin: 0;
  font: 600 22px/1.3 var(--font-display);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 28px 40px;
}

/* status control + feedback */

.status-row {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.status-row .field { min-width: 180px; }

.status-note {
  margin: 4px 0 0;
  min-height: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--st-done-t);
}
@media (prefers-reduced-motion: no-preference) {
  .status-note { transition: opacity 400ms ease; }
}
.status-note.fade { opacity: 0; }

/* facts */

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin: 20px 0;
  padding: 16px 18px;
  background: var(--bg);
  border-radius: 10px;
}
.facts div { min-width: 0; }
.facts dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}
.facts dd {
  margin: 0;
  font-size: 14px;
}
.facts .mono { font: 400 13px var(--font-mono); }

/* body copy */

.detail-body p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.65;
  max-width: 62ch;
}

.outcome {
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}
.outcome strong { font-weight: 600; }

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

@media (max-width: 720px) {
  .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .field.grow input { max-width: none; }
  /* 16px prevents iOS Safari focus zoom */
  .field input, .field select { font-size: 16px; }

  .row { flex-direction: column; gap: 8px; padding: 14px 8px; }
  .tag { min-width: 0; align-self: flex-start; margin-top: 0; }
  .row-title { margin: 0 0 4px; }
  .row-meta { gap: 4px 14px; }

  .summary { display: none; }
  .brand p { display: none; }

  .panel {
    width: 100vw;
    border-left: 0;
    border-radius: 0;
  }
  .panel-head, .panel-body { padding-left: 20px; padding-right: 20px; }
  .facts { grid-template-columns: 1fr; }
}
