@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #121728;
  --ink-soft: #4a5266;
  --paper: #f7f8fc;
  --paper-blue: #e9edff;
  --white: #ffffff;
  --line: #ccd2e3;
  --line-strong: #9ca6c0;
  --blue: #2447f9;
  --blue-dark: #1832ba;
  --blue-pale: #dce4ff;
  --todo: #3558f5;
  --progress: #8a3ffc;
  --blocked: #d13a28;
  --done: #137a52;
  --focus: #ffb000;
  --shadow-panel: -18px 0 44px rgba(18, 23, 40, 0.18);
  color-scheme: light;
  font-family: "Work Sans", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(36, 71, 249, 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--paper);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--white);
  background: var(--blue);
}

* {
  scrollbar-color: var(--blue) var(--paper-blue);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--paper-blue);
}

*::-webkit-scrollbar-thumb {
  background: var(--blue);
  border: 2px solid var(--paper-blue);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  color: var(--white);
  background: var(--blue);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.topbar__inner {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 1fr auto;
  align-items: center;
  width: min(100%, 1540px);
  min-height: 58px;
  margin: 0 auto;
  padding: 0 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 10px;
  color: inherit;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand__mark {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.workspace-label,
.topbar__meta {
  margin: 0;
  font-size: 13px;
  font-weight: 570;
}

.workspace-label {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.88;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #bafc62;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(186, 252, 98, 0.18);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}

.topbar__rule {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.35);
}

main {
  width: min(100%, 1540px);
  margin: 0 auto;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(500px, 0.92fr);
  gap: 70px;
  align-items: end;
  padding: 48px 52px 38px;
  background: var(--paper-blue);
  border-bottom: 1px solid var(--line-strong);
}

.masthead__intro h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(52px, 5vw, 76px);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 0.94;
}

.masthead__intro > p:not(.status-summary) {
  max-width: 38ch;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.45;
}

.status-summary {
  margin: 21px 0 0;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.controls {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 190px;
  gap: 14px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 720;
}

.input-shell,
.select-shell {
  position: relative;
  display: block;
}

.input-shell svg {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.8;
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select {
  width: 100%;
  height: 50px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

input {
  padding: 0 15px 0 46px;
  caret-color: var(--blue);
}

input::placeholder {
  color: #667087;
}

select {
  appearance: none;
  padding: 0 42px 0 14px;
}

.select-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

input:hover,
select:hover {
  border-color: var(--blue);
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 71, 249, 0.14);
}

.queue {
  padding: 32px 52px 48px;
}

.queue__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
}

.queue__bar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.queue__bar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.column-head,
.task-row {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) minmax(116px, 0.55fr) minmax(140px, 0.7fr) minmax(106px, 0.48fr) minmax(86px, 0.42fr) minmax(54px, 0.25fr);
  column-gap: 18px;
  align-items: center;
}

.column-head {
  min-height: 38px;
  padding: 0 16px;
  color: #646e85;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
}

.task-list {
  border-bottom: 1px solid var(--ink);
}

.task-row {
  position: relative;
  min-height: 62px;
  padding: 8px 16px;
  background: rgba(247, 248, 252, 0.82);
  border-bottom: 1px solid var(--line);
  transition: background-color 170ms ease-out;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row:hover,
.task-row:focus-within {
  background: var(--blue-pale);
}

.task-row.is-updated {
  animation: signal-update 820ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes signal-update {
  0% { background: #bff4d7; }
  100% { background: rgba(247, 248, 252, 0.82); }
}

.task-title-cell {
  min-width: 0;
}

.open-task {
  display: block;
  width: 100%;
  padding: 2px 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 670;
  letter-spacing: -0.015em;
}

.open-task:hover {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.task-project {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 620;
}

.status-pill::before,
.detail-status span {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--status-color);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 16%, transparent);
}

[data-status="todo"] { --status-color: var(--todo); }
[data-status="in-progress"] { --status-color: var(--progress); }
[data-status="blocked"] { --status-color: var(--blocked); }
[data-status="done"] { --status-color: var(--done); }

.task-owner,
.task-date,
.task-comments {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-date,
.task-comments {
  font-variant-numeric: tabular-nums;
}

.task-comments {
  color: var(--ink);
}

.priority {
  width: max-content;
  padding: 4px 7px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.priority--high {
  color: #a22618;
  border-color: #e7a297;
  background: #fff0ed;
}

.loading-state,
.empty-state,
.error-state {
  min-height: 240px;
  border-bottom: 1px solid var(--ink);
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-soft);
}

.loader {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: rotate 680ms linear infinite;
}

@keyframes rotate { to { transform: rotate(360deg); } }

.empty-state,
.error-state {
  align-items: center;
  gap: 24px;
  padding: 40px max(24px, 7vw);
  background: var(--paper-blue);
}

.empty-state:not([hidden]),
.error-state:not([hidden]) {
  display: flex;
}

.empty-state svg {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.6;
}

.empty-state h3,
.empty-state p,
.error-state strong,
.error-state span {
  margin: 0;
}

.empty-state h3 {
  font-size: 21px;
  letter-spacing: -0.025em;
}

.empty-state p,
.error-state span {
  margin-top: 6px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.error-state {
  flex-wrap: wrap;
}

.error-state strong,
.error-state span {
  flex-basis: 100%;
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-weight: 680;
}

.button--ink {
  color: var(--white);
  background: var(--ink);
}

.button--ink:hover {
  background: var(--blue);
  border-color: var(--blue);
}

.detail-panel {
  position: fixed;
  z-index: 20;
  inset: 0 0 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(520px, 48vw);
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background: var(--white);
  border-left: 1px solid var(--ink);
  box-shadow: var(--shadow-panel);
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-panel.is-open {
  transform: translateX(0);
}

.detail-panel__signal {
  position: absolute;
  inset: 0 0 auto;
  width: auto;
  height: 6px;
  background: var(--status-color, var(--blue));
}

.detail-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 28px 12px 34px;
  background: var(--paper-blue);
  border-bottom: 1px solid var(--line-strong);
}

.detail-panel__context {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.detail-sequence {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.detail-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.detail-status span {
  display: block;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.icon-button:hover {
  color: var(--white);
  background: var(--ink);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.detail-panel__body {
  overflow-y: auto;
  padding: 42px 38px 48px 44px;
}

.detail-project {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 720;
}

.detail-panel h2 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(31px, 3vw, 43px);
  font-weight: 730;
  letter-spacing: -0.04em;
  line-height: 1.03;
  text-wrap: balance;
}

.detail-copy {
  max-width: 66ch;
  margin-top: 28px;
  color: #343c50;
  font-size: 15px;
  line-height: 1.62;
}

.detail-copy p {
  margin: 0 0 14px;
}

.detail-copy p:last-child {
  margin-bottom: 0;
  padding-top: 16px;
  color: var(--ink);
  border-top: 1px solid var(--line);
  font-weight: 560;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 34px 0 0;
  border-top: 1px solid var(--ink);
}

.fact-grid div {
  min-height: 74px;
  padding: 13px 10px 12px 0;
  border-bottom: 1px solid var(--line);
}

.fact-grid div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.fact-grid div:nth-child(even) {
  padding-left: 16px;
}

.fact-grid dt {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.fact-grid dd {
  margin: 7px 0 0;
  font-size: 14px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.status-editor {
  margin-top: 40px;
  padding: 24px;
  color: var(--white);
  background: var(--blue);
}

.status-editor label {
  display: block;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.status-editor > p:not(.status-feedback) {
  margin: 6px 0 18px;
  color: #e0e6ff;
  font-size: 13px;
  line-height: 1.4;
}

.select-shell--large select {
  height: 52px;
  border-color: var(--white);
  font-weight: 650;
}

.status-feedback {
  min-height: 19px;
  margin: 12px 0 0;
  color: #d9ff9d;
  font-size: 12px;
  font-weight: 680;
}

.tag-section {
  margin-top: 38px;
}

.tag-section h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 720;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 6px 10px;
  color: var(--ink-soft);
  background: var(--paper-blue);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 620;
}

.detail-panel__footer {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 38px 10px 44px;
  color: var(--ink-soft);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.detail-panel__footer p {
  margin: 0;
}

.detail-panel__footer svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .topbar__inner {
    grid-template-columns: auto 1fr;
    padding: 0 28px;
  }

  .workspace-label {
    justify-self: end;
  }

  .topbar__meta {
    display: none;
  }

  .masthead {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 40px 28px 32px;
  }

  .controls {
    max-width: 720px;
  }

  .queue {
    padding: 28px 28px 44px;
  }

  .column-head,
  .task-row {
    grid-template-columns: minmax(240px, 1.5fr) minmax(112px, 0.6fr) minmax(120px, 0.65fr) minmax(94px, 0.45fr) 76px;
  }

  .column-head span:last-child,
  .task-comments {
    display: none;
  }

  .detail-panel {
    width: min(540px, 70vw);
  }
}

@media (max-width: 680px) {
  body {
    background-size: 44px 44px;
  }

  .topbar__inner {
    min-height: 54px;
    padding: 0 18px;
  }

  .brand {
    font-size: 19px;
  }

  .brand__mark {
    width: 25px;
    height: 25px;
  }

  .workspace-label {
    font-size: 11px;
  }

  .workspace-label .live-dot {
    display: none;
  }

  .masthead {
    gap: 25px;
    padding: 30px 18px 24px;
  }

  .masthead__intro h1 {
    font-size: 48px;
  }

  .masthead__intro > p:not(.status-summary) {
    margin-top: 12px;
    font-size: 15px;
  }

  .status-summary {
    margin-top: 16px;
    line-height: 1.45;
  }

  .controls {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  input,
  select {
    height: 48px;
  }

  .queue {
    padding: 23px 18px 34px;
  }

  .queue__bar {
    padding-bottom: 12px;
  }

  .queue__bar h2 {
    font-size: 18px;
  }

  .column-head {
    display: none;
  }

  .task-list {
    border-top: 1px solid var(--ink);
  }

  .task-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
    min-height: 98px;
    padding: 13px 4px;
    background: rgba(247, 248, 252, 0.9);
  }

  .task-title-cell {
    align-self: start;
  }

  .open-task {
    padding-right: 4px;
    overflow: visible;
    white-space: normal;
    line-height: 1.25;
  }

  .status-pill {
    align-self: start;
    justify-self: end;
    font-size: 11px;
  }

  .task-owner,
  .task-date,
  .priority {
    grid-row: 2;
    align-self: center;
  }

  .task-owner {
    display: none;
  }

  .task-date {
    grid-column: 1;
    color: var(--ink-soft);
  }

  .task-date::before {
    content: "Due ";
  }

  .priority {
    grid-column: 2;
    justify-self: end;
  }

  .task-comments {
    display: none;
  }

  .empty-state,
  .error-state {
    align-items: flex-start;
    flex-direction: column;
    min-height: 300px;
    gap: 18px;
    padding: 36px 24px;
  }

  .detail-panel {
    width: 100%;
    border-left: 0;
  }

  .detail-panel__header {
    min-height: 66px;
    padding: 10px 18px 10px 25px;
  }

  .detail-panel__body {
    padding: 30px 24px 40px 30px;
  }

  .detail-panel h2 {
    max-width: 17ch;
    font-size: 34px;
  }

  .detail-copy {
    margin-top: 22px;
  }

  .status-editor {
    margin-top: 32px;
    padding: 20px;
  }

  .detail-panel__footer {
    padding: 10px 24px 10px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
