@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-display: swap;
}

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

:root {
  --paper: #e5eae6;
  --sheet: #f8faf8;
  --ink: #17201e;
  --ink-soft: #4f5c58;
  --rule: #c3cdc8;
  --field: #ffffff;
  --focus: #0b5cad;
  --todo: #4a5a78;
  --in-progress: #b7791f;
  --blocked: #9b2335;
  --done: #2e6b4e;
  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "Work Sans", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

/* Masthead */

.masthead {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 32px 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.masthead h1 {
  font: 600 30px/1 var(--serif);
}

.masthead p {
  color: var(--ink-soft);
}

/* Workspace */

.workspace {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 32px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.workspace[data-detail="open"] {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.inbox {
  background: var(--sheet);
  padding: 24px 28px 28px;
  border-radius: 2px;
}

/* Toolbar */

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px 16px;
  align-items: end;
}

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

.field label,
.status-field label {
  font: 500 14px/1.2 var(--sans);
  color: var(--ink-soft);
}

input[type="text"],
select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #8d9b96;
  border-radius: 2px;
  background: var(--field);
  color: var(--ink);
  font: 400 16px var(--sans);
  appearance: auto;
}

input[type="text"]::placeholder {
  color: #6b7974;
}

input[type="text"]:disabled,
select:disabled {
  opacity: 0.6;
}

/* Inbox head and list */

.inbox-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 4px;
}

.inbox-head h2 {
  font: 600 22px/1.2 var(--serif);
}

.count {
  font-size: 14px;
  color: var(--ink-soft);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}

.row.is-flash {
  animation: row-flash 1.4s ease-out;
}

@keyframes row-flash {
  from {
    background-color: #f5e9c4;
  }
  to {
    background-color: transparent;
  }
}

.row-stripe {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  background: var(--stripe, var(--rule));
}

.row-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 16px 0;
}

.status {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  padding: 6px 10px;
  border-radius: 2px;
  font: 600 13px/1 var(--sans);
  white-space: nowrap;
}

.row[data-status="todo"] {
  --stripe: var(--todo);
}

.row[data-status="in-progress"] {
  --stripe: var(--in-progress);
}

.row[data-status="blocked"] {
  --stripe: var(--blocked);
}

.row[data-status="done"] {
  --stripe: var(--done);
}

.row-title {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 19px/1.3 var(--serif);
  text-align: left;
  cursor: pointer;
}

/* The title button covers its whole row so the full line is a tap target. */
.row-title::after {
  content: "";
  position: absolute;
  inset: 0;
}

.row-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.status-todo {
  background: #dde3ee;
  color: #2f3d5a;
}

.status-in-progress {
  background: #f3e3c2;
  color: #5e3d07;
}

.status-blocked {
  background: #f2d6da;
  color: #7a1a2a;
}

.status-done {
  background: #d4e9dc;
  color: #1d4f38;
}

/* Empty state */

.empty {
  margin-top: 24px;
  padding: 32px 24px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.empty h3 {
  font: 600 22px/1.2 var(--serif);
}

.empty p {
  color: var(--ink-soft);
}

/* Buttons */

.btn {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: 600 15px var(--sans);
  cursor: pointer;
}

.btn:hover {
  background: var(--ink);
  color: var(--sheet);
}

/* Detail sheet */

.detail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px 32px 40px;
  background: var(--sheet);
  border-radius: 2px;
}

.detail-top {
  display: flex;
  justify-content: flex-end;
}

.detail h2 {
  margin: 12px 0 24px;
  font: 600 30px/1.15 var(--serif);
  text-wrap: balance;
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 20px;
  margin: 0 0 28px;
  font-size: 15px;
}

.facts dt {
  color: var(--ink-soft);
}

.facts dd {
  margin: 0;
}

.status-field {
  display: grid;
  gap: 8px;
  padding: 16px;
  margin-bottom: 28px;
  background: #eef2ef;
  border-radius: 2px;
}

.feedback {
  min-height: 1.4em;
  font-size: 14px;
  color: var(--done);
}

.body p {
  max-width: 62ch;
  margin-bottom: 1em;
  font: 400 17px/1.65 var(--serif);
}

/* Narrow screens: the detail becomes a full-height page over the list. */

@media (max-width: 900px) {
  .workspace[data-detail="open"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail {
    position: fixed;
    inset: 0;
    z-index: 10;
    max-height: none;
    padding: 16px 20px 40px;
    border-radius: 0;
  }
}

@media (max-width: 640px) {
  .masthead,
  .workspace {
    padding-left: 16px;
    padding-right: 16px;
  }

  .inbox {
    padding: 18px 16px 20px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .row {
    grid-template-columns: 5px minmax(0, 1fr);
  }

  .row-stripe {
    grid-row: 1 / span 2;
  }

  .status {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    margin-top: 14px;
  }

  .row-main {
    grid-column: 2;
    grid-row: 2;
    padding-top: 10px;
  }

  .detail h2 {
    font-size: 26px;
  }
}

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