/* Relay — team task inbox
   Direction: a screen-printed dispatch sheet. Two riso inks on newsprint,
   condensed display type, thick rules, one halftone texture. */

@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: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #e9eaf3;
  --paper-2: #dcddef;
  --sheet: #fcfbf7;
  --ink: #191826;
  --ink-2: #514f60;
  --cobalt: #2438e8;
  --cobalt-deep: #17259f;
  --pink: #ff5ca8;
  --pink-deep: #b01e68;
  --line: #191826;
  --focus: #2438e8;
  --rail-w: 9px;
  --pad: clamp(16px, 4vw, 40px);
  --display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--pink);
  color: var(--ink);
}

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

.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;
}

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

body.dialog-open {
  overflow: hidden;
}

/* ---------------- Masthead ---------------- */

.masthead {
  position: relative;
  overflow: hidden;
  background: var(--cobalt);
  color: var(--paper);
  border-bottom: 3px solid var(--line);
}
.masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.22) 1px,
    transparent 1.4px
  );
  background-size: 7px 7px;
  opacity: 0.45;
  pointer-events: none;
}
.masthead-inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px) var(--pad);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(38px, 7vw, 62px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 4px 4px 0 var(--pink);
}
.brand-sub {
  margin-top: 10px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #dfe3ff;
}
.masthead-stat {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(15px, 2.2vw, 19px);
  letter-spacing: 0.02em;
  text-align: right;
  color: #fff;
  padding-bottom: 4px;
}

/* ---------------- Workspace ---------------- */

.workspace {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px) var(--pad) 0;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: clamp(12px, 2.5vw, 26px);
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 3px solid var(--line);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-search {
  flex: 1 1 320px;
  min-width: 220px;
}
.field-status {
  flex: 0 0 auto;
}
.field label {
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
}
#search {
  width: 100%;
  background: var(--sheet);
  border: 2px solid var(--line);
  border-radius: 0;
  padding: 11px 13px;
  appearance: none;
}
#search::placeholder {
  color: #6f6c7a;
}
#search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
#filter {
  appearance: none;
  background: var(--sheet);
  border: 2px solid var(--line);
  border-radius: 0;
  padding: 11px 40px 11px 13px;
  cursor: pointer;
  min-width: 180px;
}

.btn-clear,
.btn-reset {
  border: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 9px 15px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.btn-clear {
  margin-left: auto;
}
.btn-clear:hover:not(:disabled),
.btn-reset:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn-clear:active:not(:disabled),
.btn-reset:active {
  transform: translate(2px, 2px);
}
.btn-clear:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ---------------- Ledger ---------------- */

.ledger {
  padding-top: 26px;
}
.ledger-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ledger-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.ledger-count {
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--line);
}

.task {
  border-bottom: 2px solid var(--line);
}

.task-open {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr auto;
  align-items: center;
  gap: 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.12s ease;
}
.task-open:hover {
  background: var(--paper-2);
}
.task-open:hover .task-title {
  color: var(--cobalt);
}
.task-open:active .task-main {
  transform: translate(1px, 1px);
}

.task-rail {
  align-self: stretch;
  min-height: 100%;
  background: transparent;
}
.task-main {
  min-width: 0;
  padding: 15px 18px 15px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.task-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.005em;
  transition: color 0.12s ease;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 16px 20px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-2);
}
.meta-project {
  font-weight: 600;
  color: var(--ink);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--display);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.meta-priority .dot {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
}
.prio-high .dot {
  background: var(--pink);
}
.prio-medium .dot {
  background: var(--cobalt);
}
.prio-low .dot {
  background: var(--paper);
}
.meta-comments svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.7;
}

.task-side {
  padding: 15px 0 15px 18px;
  display: flex;
  justify-content: flex-end;
}

/* Status stamps — one consistent object across list and detail */
.stamp {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.045em;
  line-height: 1;
  padding: 7px 10px 6px;
  border: 1.75px solid var(--line);
  border-radius: 0;
}
.st-todo {
  background: transparent;
  color: var(--ink);
}
.st-in-progress {
  background: var(--pink);
  color: var(--ink);
}
.st-blocked {
  background: var(--ink);
  color: #ffd0e5;
  border-color: var(--ink);
}
.st-done {
  background: var(--cobalt);
  color: #fff;
  border-color: var(--cobalt-deep);
}

.task-rail.st-todo {
  background: repeating-linear-gradient(
    -45deg,
    var(--paper) 0 5px,
    #b9bdd6 5px 10px
  );
}
.task-rail.st-in-progress {
  background: var(--pink);
}
.task-rail.st-blocked {
  background: var(--ink);
}
.task-rail.st-done {
  background: var(--cobalt);
}

.task[data-status="done"] .task-title {
  color: var(--ink-2);
}
.task[data-status="done"] .task-rail {
  opacity: 0.5;
}

/* Entrance: one quiet reveal on the list, staggered slightly */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.task-list.animate .task {
  animation: rise 0.26s ease both;
}

/* ---------------- Empty state ---------------- */

.empty-state {
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: clamp(34px, 7vw, 64px) 20px;
  text-align: center;
}
.empty-state[hidden] {
  display: none;
}
.empty-mark {
  font-family: var(--display);
  font-weight: 300;
  font-size: 58px;
  line-height: 1;
  color: var(--cobalt);
  margin-bottom: 8px;
}
.empty-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.01em;
}
.empty-text {
  max-width: 52ch;
  margin: 8px auto 20px;
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------------- Footer ---------------- */

.site-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px var(--pad) 46px;
}
.site-foot p {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 14px;
}

/* ---------------- Detail drawer ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(27, 26, 36, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.overlay.open {
  opacity: 1;
}
.overlay:not(.open) {
  pointer-events: none;
}
.overlay[hidden] {
  display: none;
}

.detail {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  height: 100%;
  width: min(540px, 94vw);
  background: var(--sheet);
  border-left: 3px solid var(--line);
  box-shadow: -14px 0 0 rgba(36, 56, 232, 0.14);
  overflow-y: auto;
  transform: translateX(104%);
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.detail.open {
  transform: translateX(0);
}
.detail[hidden] {
  display: none;
}
.detail::before {
  content: "";
  display: block;
  height: 8px;
  background: var(--pink);
}

.detail-inner {
  padding: 20px clamp(20px, 4vw, 34px) 44px;
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.detail-project {
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--cobalt);
}
.detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.detail-close:hover {
  background: var(--ink);
  color: var(--paper);
}
.detail-close:active {
  transform: translate(2px, 2px);
}
.detail-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.detail-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(26px, 4.6vw, 34px);
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin-bottom: 6px;
}

.detail-status {
  margin: 22px 0 4px;
  padding: 16px;
  border: 2px solid var(--line);
  background: var(--paper);
  position: relative;
}
.detail-status::after {
  content: "";
  position: absolute;
  inset: 4px -6px -6px 4px;
  border-right: 2px solid var(--pink);
  border-bottom: 2px solid var(--pink);
  pointer-events: none;
}
.detail-status label {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.detail-status .select-wrap {
  max-width: 260px;
}
.detail-status #status-select {
  width: 100%;
}
.detail-feedback {
  min-height: 22px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--cobalt-deep);
  font-weight: 600;
}

.detail-body {
  margin-top: 22px;
  max-width: 66ch;
}
.detail-body p {
  margin-bottom: 14px;
  line-height: 1.65;
}
.detail-body p:last-child {
  margin-bottom: 0;
}

.detail-meta {
  margin: 26px 0 0;
  border-top: 2px solid var(--line);
}
.detail-meta div {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1.5px solid #d3d5e4;
}
.detail-meta dt {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.detail-meta dd {
  margin: 0;
  font-size: 15px;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tag-list li {
  border: 1.5px solid var(--line);
  padding: 2px 9px;
  font-size: 13px;
}

/* Stamp pulse when the status changes */
@keyframes stamp-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.14) rotate(-1.5deg);
  }
  100% {
    transform: scale(1);
  }
}
.stamp.pop {
  animation: stamp-pop 0.32s ease;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .masthead-inner {
    align-items: flex-start;
  }
  .masthead-stat {
    text-align: left;
    width: 100%;
  }
  .toolbar {
    align-items: stretch;
  }
  .field-search,
  .field-status {
    flex: 1 1 100%;
  }
  .btn-clear {
    margin-left: 0;
    align-self: flex-start;
  }
  .task-open {
    grid-template-columns: var(--rail-w) 1fr;
    align-items: start;
  }
  .task-side {
    grid-column: 2;
    padding: 0 18px 15px 0;
    justify-content: flex-start;
  }
  .task-main {
    padding-bottom: 9px;
  }
  .task-meta {
    gap: 8px 16px;
  }
  .detail {
    width: 100%;
    border-left: 0;
    box-shadow: none;
  }
  .detail-status::after {
    inset: 4px -4px -4px 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .task {
    animation: none;
  }
}
