@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 {
  --sky: #dce7f4;
  --paper: #fbfcfe;
  --ink: #16233c;
  --ink-soft: #44526f;
  --ink-mute: #5c6a86;
  --sun: #f2ae3c;
  --sun-deep: #9a620a;
  --sun-soft: #fcf3df;
  --brick: #b6482e;
  --sage: #2e6b5a;
  --line: #dee6f1;
  --line-strong: #c7d4e4;
  --todo: #4c5d7c;
  --todo-bg: #e9eef6;
  --progress: #2552c0;
  --progress-bg: #e3ebfb;
  --blocked: #a53e26;
  --blocked-bg: #fbe6e0;
  --done: #25604f;
  --done-bg: #e0eee8;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Work Sans", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}

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

.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Left rail ---------- */

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 34px 22px 28px;
  overflow-y: auto;
  background: var(--ink);
  color: #e8f0fa;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: #f8fbff;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  border-radius: 6px;
}

.wordmark:focus-visible {
  outline-color: var(--sun);
}

.sun-icon {
  width: 27px;
  height: 27px;
  color: var(--sun);
  flex: none;
}

.rail-tagline {
  max-width: 180px;
  margin: 12px 0 0 1px;
  color: #aebfd8;
  font-size: 13.5px;
  line-height: 1.45;
}

.rail-queue {
  margin-top: 48px;
}

.rail-heading {
  margin: 0 0 10px 12px;
  color: #8fa4c1;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rail-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #dbe6f5;
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.rail-filter:hover {
  background: rgba(255, 255, 255, 0.07);
}

.rail-filter[aria-pressed="true"] {
  border-color: rgba(242, 174, 60, 0.35);
  background: rgba(242, 174, 60, 0.14);
}

.rail-filter:focus-visible {
  outline-color: var(--sun);
  outline-offset: 1px;
}

.rail-filter-label {
  font-size: 14px;
  font-weight: 500;
}

.rail-filter[aria-pressed="true"] .rail-filter-label {
  color: #fff7e6;
}

.rail-count {
  min-width: 20px;
  color: #9db0ca;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rail-filter[aria-pressed="true"] .rail-count {
  color: var(--sun);
}

.rail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--todo);
}

.rail-dot[data-dot="todo"] {
  background: #91a3c0;
}

.rail-dot[data-dot="in-progress"] {
  background: #6e9bff;
}

.rail-dot[data-dot="blocked"] {
  background: #f08363;
}

.rail-dot[data-dot="done"] {
  background: #74b9a2;
}

.rail-dot-all {
  background: var(--sun);
}

.rail-foot {
  margin-top: auto;
  padding: 20px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.rail-stat {
  margin: 0;
  color: #b7c7dd;
  font-size: 13px;
  line-height: 1.65;
}

.rail-week {
  margin: 14px 0 0;
  color: #7f94b1;
  font-size: 12px;
}

/* ---------- Main ---------- */

.main {
  min-width: 0;
  padding: 46px clamp(24px, 4.4vw, 64px) 72px;
}

.masthead,
.toolbar,
.result-line,
.ledger {
  width: 100%;
  max-width: 1080px;
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.masthead h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(64px, 6.4vw, 88px);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 0.88;
}

.masthead-lede {
  max-width: 570px;
  margin: 19px 0 0;
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.56;
}

.masthead-count {
  flex: none;
  margin: 0 0 4px;
  color: var(--ink-mute);
  font-size: 12.5px;
  line-height: 1.35;
  text-align: right;
}

.masthead-count strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

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

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.search-wrap,
.select-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  color: #687793;
  transform: translateY(-50%);
  pointer-events: none;
}

#search,
#status-filter {
  width: 100%;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15.5px;
}

#search {
  padding: 0 18px 0 44px;
}

#search::placeholder {
  color: #65738a;
  opacity: 1;
}

#search:hover,
#status-filter:hover {
  border-color: #9fb1c8;
}

#search:focus-visible,
#status-filter:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 35, 60, 0.16);
}

#status-filter {
  appearance: none;
  padding: 0 44px 0 16px;
  font-weight: 500;
}

.chevron {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  transform: translateY(-50%);
  pointer-events: none;
}

.result-line {
  min-height: 19px;
  margin: 14px 0 12px;
  color: var(--ink-mute);
  font-size: 13px;
}

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

.ledger {
  overflow: hidden;
  border: 1px solid rgba(22, 35, 60, 0.09);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 26px 60px -48px rgba(22, 35, 60, 0.7);
}

.task-list:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
  border-radius: 18px;
}

.task-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  width: 100%;
  min-height: 105px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background-color 130ms ease, box-shadow 130ms ease;
}

.task-item + .task-item .task-row {
  border-top: 1px solid var(--line);
}

.task-row:hover {
  background: #f3f7fc;
  box-shadow: inset 4px 0 0 var(--sun);
}

.task-row:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: -3px;
  background: #f3f7fc;
}

.date-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 20px 18px 24px;
  border-right: 1px dashed #c9d6e6;
}

.date-day {
  font-family: var(--font-display);
  font-size: 33px;
  font-weight: 500;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.date-detail {
  margin-top: 5px;
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.row-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 17px 24px;
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.task-title {
  min-width: 0;
  margin: 0;
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: -0.006em;
  line-height: 1.36;
}

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

.status-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: var(--todo-bg);
  color: var(--todo);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.status-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill[data-status="in-progress"] {
  background: var(--progress-bg);
  color: var(--progress);
}

.status-pill[data-status="blocked"] {
  background: var(--blocked-bg);
  color: var(--blocked);
}

.status-pill[data-status="done"] {
  background: var(--done-bg);
  color: var(--done);
}

.task-summary {
  max-width: 78ch;
  margin: 0;
  overflow: hidden;
  color: #586684;
  font-size: 13.8px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 14px;
  min-width: 0;
  margin-top: 1px;
  color: var(--ink-mute);
  font-size: 12.2px;
  line-height: 1.4;
}

.assignee {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
}

.avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #e4ecf7;
  color: #2b4162;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.project-tag {
  padding: 2px 7px;
  border: 1px solid #d6dfeb;
  border-radius: 6px;
  color: #516079;
  font-size: 11.4px;
  font-weight: 500;
  line-height: 1.35;
}

.priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.priority::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8290a7;
  content: "";
}

.priority[data-priority="high"]::before {
  background: var(--brick);
}

.priority[data-priority="medium"]::before {
  background: var(--sun);
}

.priority[data-priority="low"]::before {
  background: var(--sage);
}

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

.empty-state {
  padding: 62px 32px 66px;
  text-align: center;
}

.empty-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 0 18px;
  color: var(--sun-deep);
}

.empty-mark svg {
  width: 42px;
  height: 42px;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
}

.empty-state > p:not(.empty-mark) {
  max-width: 46ch;
  margin: 0 auto 22px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.55;
}

.button-primary {
  padding: 11px 17px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: #f8fbff;
  font-size: 13.5px;
  font-weight: 600;
}

.button-primary:hover {
  background: #263957;
}

.button-primary:focus-visible {
  outline-color: var(--ink);
}

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

.detail {
  width: min(580px, 100%);
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: -22px 0 60px -30px rgba(8, 16, 30, 0.55);
}

.detail[open] {
  animation: drawer-in 240ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.detail::backdrop {
  background: rgba(13, 22, 39, 0.42);
}

@keyframes drawer-in {
  from {
    opacity: 0.5;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.detail-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.detail-bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.detail-kicker {
  margin: 0;
  color: var(--ink-mute);
  font-size: 12.5px;
  font-weight: 600;
}

.close-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border: 1px solid #d2dce9;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.close-button:hover {
  background: #eef3fa;
}

.close-button svg {
  width: 16px;
  height: 16px;
}

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 30px 34px 56px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-tags .project-tag {
  font-size: 11.5px;
}

#detail-title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.006em;
  line-height: 1.08;
  outline: none;
}

#detail-title:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 4px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
  margin: 0 0 28px;
  padding: 19px 0 23px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.meta-label {
  margin: 0 0 4px;
  color: var(--ink-mute);
  font-size: 11.8px;
  font-weight: 600;
}

.meta-value {
  margin: 0;
  color: #263652;
  font-size: 13.8px;
  font-weight: 500;
  line-height: 1.42;
}

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

.tag-list span {
  padding: 1px 7px;
  border-radius: 5px;
  background: #edf2f9;
  color: #43536f;
  font-size: 11.5px;
  font-weight: 500;
}

.detail-body {
  max-width: 63ch;
  margin-top: 30px;
  color: #33415e;
  font-size: 16.2px;
  line-height: 1.66;
}

.detail-body p {
  margin: 0 0 16px;
}

.detail-body p:last-child {
  margin-bottom: 0;
}

.detail-body .outcome {
  margin-top: 22px;
  padding: 14px 17px;
  border-left: 3px solid var(--sun);
  border-radius: 0 8px 8px 0;
  background: #fcf8ee;
  color: #3f3a2c;
}

.status-panel {
  margin-top: 32px;
  padding: 19px 20px 17px;
  border: 1px solid #ead3a5;
  border-radius: 14px;
  background: var(--sun-soft);
}

.status-panel label {
  display: block;
  margin-bottom: 7px;
  color: #6b4d15;
  font-size: 12.5px;
  font-weight: 700;
}

.status-select-wrap {
  position: relative;
}

#status-control {
  width: 100%;
  height: 48px;
  appearance: none;
  padding: 0 42px 0 14px;
  border: 1px solid #d3b676;
  border-radius: 9px;
  background: #fffdf7;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
}

#status-control:hover {
  border-color: #b6934c;
}

#status-control:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 35, 60, 0.16);
}

.status-panel .chevron {
  color: #6b4d15;
}

.status-help {
  margin: 8px 0 0;
  color: #78643b;
  font-size: 12px;
  line-height: 1.45;
}

.status-feedback {
  min-height: 20px;
  margin: 8px 0 0;
  color: #245b4b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.status-feedback:empty {
  display: none;
}

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

@media (max-width: 980px) {
  .app {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .rail {
    padding: 28px 16px 24px;
  }

  .wordmark {
    font-size: 28px;
  }

  .main {
    padding: 36px 30px 60px;
  }

  .masthead h1 {
    font-size: 68px;
  }

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

@media (max-width: 760px) {
  .app {
    display: block;
  }

  .rail {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: auto;
    padding: 13px 20px;
    overflow: visible;
  }

  .wordmark {
    font-size: 25px;
  }

  .sun-icon {
    width: 23px;
    height: 23px;
  }

  .rail-tagline,
  .rail-queue,
  .rail-foot {
    display: none;
  }

  .main {
    padding: 25px 20px 52px;
  }

  .masthead {
    display: block;
    margin-bottom: 25px;
  }

  .masthead h1 {
    font-size: 54px;
  }

  .masthead-lede {
    display: none;
  }

  .masthead-count {
    margin-top: 12px;
    font-size: 12.5px;
    text-align: left;
  }

  .masthead-count strong {
    display: inline;
    margin-right: 4px;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 700;
  }

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

  .field-filter {
    max-width: none;
  }

  .ledger {
    border-radius: 16px;
  }

  .task-row {
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 96px;
  }

  .date-block {
    padding: 14px 10px 14px 15px;
  }

  .date-day {
    font-size: 27px;
  }

  .date-detail {
    font-size: 11px;
  }

  .row-content {
    gap: 5px;
    padding: 14px 15px 14px 13px;
  }

  .title-row {
    gap: 10px;
  }

  .task-title {
    font-size: 16px;
  }

  .status-pill {
    padding: 4px 8px 4px 7px;
    font-size: 10.8px;
  }

  .task-summary {
    font-size: 13px;
  }

  .task-meta {
    gap: 6px 10px;
  }

  .assignee {
    font-size: 12px;
  }

  .avatar {
    width: 21px;
    height: 21px;
    font-size: 9px;
  }

  .detail {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .detail[open] {
    animation: sheet-in 200ms cubic-bezier(0.2, 0.75, 0.25, 1);
  }

  @keyframes sheet-in {
    from {
      opacity: 0.6;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .detail-bar {
    padding: 12px 18px;
  }

  .detail-scroll {
    padding: 22px 20px 44px;
  }

  #detail-title {
    font-size: 34px;
  }

  .detail-meta {
    gap: 16px;
    padding: 17px 0 20px;
  }

  .detail-body {
    margin-top: 26px;
    font-size: 15.8px;
    line-height: 1.64;
  }
}

@media (max-width: 520px) {
  .masthead h1 {
    font-size: 50px;
  }

  .title-row {
    display: block;
  }

  .status-pill {
    margin-top: 6px;
  }

  .task-summary {
    display: none;
  }

  .date-weekday {
    display: none;
  }

  .priority {
    display: none;
  }

  .detail-meta {
    grid-template-columns: 1fr 1fr;
  }
}

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