/* Relay — team task inbox */
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  --paper: #f6f3ec;
  --paper-2: #fffdf7;
  --ink: #1c2420;
  --ink-soft: #4c5751;
  --line: #e2dccc;
  --teal: #0e7c6b;
  --teal-dark: #0a5c4f;
  --teal-wash: #dcebe4;
  --amber: #e9a100;
  --amber-wash: #f9ecc8;
  --rust: #c14e2a;
  --rust-wash: #f6ddd2;
  --sage: #5c7a68;
  --violet: #5b5fa6;
  --violet-wash: #e0e1f2;
  --sky: #2b7fb8;
  --sky-wash: #d8e9f5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 36, 32, 0.07), 0 8px 28px rgba(28, 36, 32, 0.09);
  --focus: 0 0 0 3px #f6f3ec, 0 0 0 6px #0e7c6b;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(1100px 320px at 12% -60px, #e7f0e8 0%, transparent 60%),
    radial-gradient(900px 300px at 95% 0%, #f3e7c8 0%, transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.topnav-link:hover { background: #ece6d4; color: var(--ink); }
.topnav-link.is-active {
  background: var(--ink);
  color: var(--paper);
}
.topbar-team {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.avatar-stack { display: flex; }
.avatar-stack .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  margin-left: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.avatar-stack .avatar:first-child { margin-left: 0; }
.team-note { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.team-note strong { color: var(--ink); }

/* ---------- Page ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }

.intro {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}
.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin: 0 0 8px;
}
.intro h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.lede { margin: 0; color: var(--ink-soft); font-size: 17px; max-width: 52ch; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0;
}
.stat {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.stat:hover { border-color: var(--teal); }
.stat.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.stat .num {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.stat .lbl { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.stat .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: grid;
  grid-template-columns: 1fr 210px 190px;
  gap: 12px;
  align-items: end;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 61px;
  z-index: 20;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg {
  position: absolute;
  left: 12px;
  color: var(--ink-soft);
  pointer-events: none;
}
input[type="search"], select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
.search-field input[type="search"] { padding-left: 36px; }
input[type="search"]:hover, select:hover { border-color: #c9c0a8; }
input[type="search"]:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-wash);
  background: #fff;
}
.result-count {
  grid-column: 1 / -1;
  margin: 2px 2px 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
  margin-top: 18px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.task-card {
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}
.task-card:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.task-card.is-selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink), var(--shadow); }
.task-card.is-done .card-title { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: var(--sage); }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.25;
}
.card-summary { margin: 0; color: var(--ink-soft); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  align-items: center;
}
.card-meta .who { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.mini-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex: none;
}
.card-actions { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.btn {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  transition: transform 0.1s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.open-btn { padding: 7px 14px; font-size: 13.5px; }
.card-due-over { color: var(--rust); font-weight: 700; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-todo { background: #ece7d6; color: #5c5644; border-color: #d5cdb2; }
.pill-in-progress { background: var(--sky-wash); color: #17567f; border-color: #b7d3e7; }
.pill-blocked { background: var(--rust-wash); color: #93350f; border-color: #e7bda6; }
.pill-done { background: var(--teal-wash); color: var(--teal-dark); border-color: #b4d4c7; }

.pri {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 6px;
  padding: 2px 7px;
  border: 1px dashed currentColor;
}
.pri-high { color: var(--rust); }
.pri-medium { color: #8a6d00; }
.pri-low { color: var(--sage); }
.tag {
  font-size: 12px;
  background: #efe9d8;
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------- Detail pane ---------- */
.detail-pane {
  position: sticky;
  top: 61px;
  max-height: calc(100vh - 90px);
  overflow: auto;
  background: var(--ink);
  color: var(--paper);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.detail-empty { padding: 34px 26px; text-align: center; }
.detail-empty h2 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  margin: 14px 0 8px;
  font-size: 22px;
}
.detail-empty p { color: #c9c4b4; margin: 0 0 10px; font-size: 14.5px; }
.detail-empty kbd {
  font-family: "IBM Plex Mono", monospace;
  background: #2c3531;
  border: 1px solid #4a5450;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 13px;
}
.detail-card { padding: 20px 20px 22px; display: grid; gap: 14px; }
.detail-head { display: flex; align-items: flex-start; gap: 10px; }
.detail-head .pill { flex: none; margin-top: 3px; }
.detail-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  flex: 1;
}
.detail-close {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid #4a5450;
  background: #242c28;
  color: var(--paper);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.detail-close:hover { background: #39423d; border-color: #6b756f; }
.detail-id {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #a9b3aa;
  text-transform: uppercase;
}
.detail-body {
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 14px;
  padding: 16px;
  font-size: 15px;
  white-space: pre-line;
  margin: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-fact {
  background: #242c28;
  border: 1px solid #39423d;
  border-radius: 12px;
  padding: 10px 12px;
}
.detail-fact dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a9b3aa;
  margin-bottom: 3px;
}
.detail-fact dd { margin: 0; font-weight: 600; font-size: 14.5px; }
.status-form {
  background: #242c28;
  border: 1px solid #39423d;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.status-form label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a9b3aa;
  font-weight: 500;
}
.status-row { display: flex; gap: 10px; }
.status-row select {
  background: var(--paper);
  flex: 1;
}
.status-feedback { font-size: 13.5px; color: #9fd8c6; min-height: 20px; margin: 0; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-actions .btn-ghost { color: var(--paper); border-color: #4a5450; }
.detail-actions .btn-ghost:hover { border-color: var(--paper); }
.comment-note { font-size: 13px; color: #a9b3aa; margin: 0; }
.detail-backdrop { display: none; }

/* ---------- Empty state ---------- */
.empty {
  background: var(--paper-2);
  border: 1.5px dashed #b9b2a2;
  border-radius: 18px;
  padding: 48px 24px;
  text-align: center;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.empty h2 { font-family: "Space Grotesk", sans-serif; margin: 8px 0 0; font-size: 24px; }
.empty p { color: var(--ink-soft); margin: 0 0 10px; max-width: 40ch; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: var(--shadow);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 520px);
}
.toast[hidden], .empty[hidden] { display: none !important; }
.toast .tick {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; flex: none;
}

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .intro { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .detail-pane {
    position: static;
    max-height: none;
  }
  .toolbar { position: static; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .topbar-team .team-note { display: none; }
}

@media (max-width: 560px) {
  .page { padding: 20px 14px 48px; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .topnav-link { white-space: nowrap; }
  .toolbar { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .detail-pane-floating {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    border-radius: 22px 22px 0 0;
    max-height: 88vh;
    box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.35);
  }
  .detail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 25, 22, 0.5);
    z-index: 40;
  }
  .detail-backdrop[hidden] { display: none; }
}

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