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

@font-face {
  font-family: "DM Serif Display";
  src: url("assets/dm-serif.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --canvas: #ece9df;
  --paper: #f7f5ed;
  --ink: #20201d;
  --muted: #6c6b64;
  --line: #d4d0c3;
  --line-dark: #bab5a7;
  --lime: #d9ff43;
  --orange: #ff6f3c;
  --violet: #9e8cff;
  --blue: #4389e6;
  --green: #2a9a67;
  --focus: #126bd1;
  --rail-width: 224px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Work Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

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

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 25px 18px 22px;
  display: flex;
  flex-direction: column;
  color: #f7f5ed;
  background: var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 25px;
  border-bottom: 1px solid #44433e;
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 26px;
  height: 24px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  transform: skew(-8deg);
}

.brand-mark i { display: block; width: 6px; background: var(--lime); }
.brand-mark i:nth-child(1) { height: 12px; }
.brand-mark i:nth-child(2) { height: 19px; }
.brand-mark i:nth-child(3) { height: 7px; }

.nav { display: grid; gap: 4px; margin-top: 26px; }
.nav-link {
  min-height: 43px;
  display: grid;
  grid-template-columns: 26px 1fr 8px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  color: #e8e5dc;
  text-decoration: none;
  font-size: 13px;
}

.nav-link.active { background: #373732; }
.nav-link.muted { color: #8d8b83; cursor: default; }
.nav-index { color: #85837b; font-size: 9px; letter-spacing: .08em; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }

.rail-note {
  margin: auto 8px 25px;
  padding: 17px 0 0;
  border-top: 1px solid #44433e;
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rail-note .eyebrow { color: var(--lime); }
.rail-note p { margin: 9px 0 0; max-width: 150px; color: #aaa89f; font-family: "DM Serif Display", Georgia, serif; font-size: 20px; line-height: 1.12; }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 8px 0;
  border-top: 1px solid #44433e;
  font-size: 11px;
}

.avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--violet);
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
}

.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 11px; font-weight: 620; }
.user-card small { margin-top: 2px; color: #96948c; font-size: 9px; }

.workspace { width: min(100%, 1216px); padding: 38px 44px 60px; margin: 0 auto; }

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: end;
  gap: 50px;
  padding-bottom: 34px;
}

.kicker {
  margin: 0 0 16px;
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.kicker span + span::before { content: "◆"; margin-right: 22px; color: var(--orange); font-size: 7px; }

h1 {
  margin: 0;
  font-size: clamp(58px, 5.7vw, 82px);
  line-height: .88;
  letter-spacing: -.065em;
  font-weight: 620;
}

h1 em { color: var(--orange); font-family: "DM Serif Display", Georgia, serif; font-weight: 400; }

.intro {
  margin: 0 0 2px;
  padding-left: 23px;
  border-left: 2px solid var(--ink);
  color: #4f4e48;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 20px;
  line-height: 1.35;
}

.signal-board {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 102px;
  background: var(--ink);
  color: #f6f3ea;
}

.signal-copy { display: flex; gap: 17px; padding: 25px 27px; align-items: flex-start; }
.section-no { color: #85837b; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.signal-copy .eyebrow { color: #aaa89f; }
.signal-copy p:last-child { margin: 7px 0 0; font-size: 12px; color: #aaa89f; }
.signal-copy strong { color: #fff; font-size: 17px; }

.status-summary { display: grid; grid-template-columns: repeat(4, 1fr); }
.summary-stat {
  position: relative;
  padding: 24px 19px 18px;
  border-left: 1px solid #42413c;
  overflow: hidden;
}
.summary-stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--status-color); }
.summary-stat span { display: block; color: #aaa89f; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.summary-stat strong { display: block; margin-top: 5px; font-size: 27px; line-height: 1; font-weight: 560; }

.inbox { margin-top: 32px; }
.inbox-heading { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 2px 14px; }
.inbox-heading > div { display: flex; gap: 18px; align-items: baseline; }
.inbox-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.result-count { margin: 0; color: var(--muted); font-size: 11px; font-weight: 560; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px;
  gap: 1px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
}

.toolbar label { background: var(--paper); }
.search-field, .filter-field { display: grid; grid-template-columns: 90px 1fr; align-items: center; min-height: 59px; padding: 0 16px; gap: 12px; }
.search-field > span:first-child, .filter-field > span:first-child { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.search-box { display: flex; align-items: center; gap: 9px; min-width: 0; }
.search-box svg { width: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-box input::placeholder { color: #939187; }
.search-box kbd { padding: 3px 6px; border: 1px solid var(--line); color: #89877f; background: #eeece4; font-family: inherit; font-size: 9px; }
.select-wrap { position: relative; }
.select-wrap::after { content: "↓"; position: absolute; top: 50%; right: 1px; transform: translateY(-50%); pointer-events: none; font-size: 13px; }
.filter-field select { width: 100%; appearance: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; }

.list-labels {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 132px 104px 112px 32px;
  gap: 12px;
  padding: 13px 17px 9px 22px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-dark);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

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

.task-row {
  --status-color: var(--blue);
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 132px 104px 112px 32px;
  gap: 12px;
  align-items: center;
  min-height: 73px;
  padding: 10px 17px 10px 22px;
  border: 1px solid var(--line-dark);
  border-width: 0 1px;
  background: rgba(247, 245, 237, .72);
  transition: background-color 150ms ease, transform 150ms ease;
}
.task-row + .task-row { border-top: 1px solid var(--line); }
.task-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--status-color); }
.task-row:hover { background: var(--paper); }

.task-primary { min-width: 0; display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 12px; align-items: start; }
.task-number { color: #8e8b81; font-size: 9px; font-variant-numeric: tabular-nums; padding-top: 3px; }
.task-title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.3; font-weight: 640; letter-spacing: -.012em; }
.task-project { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: var(--muted); font-size: 9px; }
.priority-mark { width: 5px; height: 5px; border-radius: 50%; background: #aaa69b; }
.priority-high .priority-mark { background: var(--orange); }
.owner { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 10px; }
.mini-avatar { width: 23px; height: 23px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--avatar-color, #ded9ca); font-size: 7px; font-weight: 750; }
.owner span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due { color: #5f5d56; font-size: 10px; font-variant-numeric: tabular-nums; }

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: #e6e3d9;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; background: var(--status-color); }
.status-blocked { background: #f5d7cd; }
.status-done { background: #d5eadf; }

.open-button {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.open-button:hover { background: var(--ink); color: #fff; }

.empty-state { padding: 54px 24px; border: 1px solid var(--line-dark); border-top: 0; text-align: center; background: var(--paper); }
.empty-state[hidden], .load-error[hidden] { display: none; }
.empty-glyph { display: block; color: var(--orange); font-family: "DM Serif Display", Georgia, serif; font-size: 46px; line-height: 1; }
.empty-state h3 { margin: 10px 0 6px; font-size: 20px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.text-button { margin-top: 20px; padding: 9px 13px; border: 1px solid var(--ink); background: transparent; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.text-button:hover { background: var(--lime); }
.load-error { display: flex; flex-direction: column; gap: 4px; padding: 32px; border: 1px solid var(--orange); background: #fff0e9; font-size: 13px; }

.detail-dialog {
  width: min(670px, calc(100vw - 32px));
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: -28px 0 80px rgba(20, 20, 17, .24);
}
.detail-dialog[open] { animation: slide-in 250ms cubic-bezier(.2,.7,.2,1); }
.detail-dialog::backdrop { background: rgba(28, 28, 25, .54); backdrop-filter: blur(2px); }
.detail-view { min-height: 100%; }
.detail-topbar { position: sticky; top: 0; z-index: 2; height: 70px; display: flex; justify-content: space-between; align-items: center; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(247, 245, 237, .96); backdrop-filter: blur(8px); }
.detail-brand { display: flex; align-items: center; gap: 9px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.detail-brand i { width: 5px; height: 18px; background: var(--detail-color, var(--blue)); }
.close-button { display: flex; align-items: center; gap: 13px; border: 0; background: transparent; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; cursor: pointer; }
.close-button span:last-child { font-size: 24px; line-height: .8; font-weight: 350; }

.detail-body { padding: 38px 48px 52px; }
.detail-meta-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.detail-id { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.priority-label { display: flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.priority-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aaa69b; }
.priority-label.high::before { background: var(--orange); }
.detail-body h2 { max-width: 510px; margin: 23px 0 30px; font-size: clamp(38px, 4vw, 54px); line-height: .99; letter-spacing: -.055em; font-weight: 590; }
.detail-rule { height: 6px; margin: 0 0 28px; background: var(--detail-color, var(--blue)); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.detail-fact { padding: 17px 18px; min-height: 67px; }
.detail-fact:nth-child(even) { border-left: 1px solid var(--line); }
.detail-fact:nth-child(n+3) { border-top: 1px solid var(--line); }
.detail-fact span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.detail-fact strong { font-size: 12px; font-weight: 620; }

.detail-section { margin-top: 35px; }
.detail-section > .eyebrow { color: var(--muted); }
.body-copy { margin-top: 14px; }
.body-copy p { max-width: 560px; margin: 0; font-family: "DM Serif Display", Georgia, serif; font-size: 19px; line-height: 1.52; }
.body-copy p + p { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.tag { padding: 6px 9px; border: 1px solid var(--line-dark); font-size: 9px; font-weight: 650; }

.status-editor { margin-top: 38px; padding: 20px; display: grid; grid-template-columns: 1fr 210px; align-items: center; gap: 18px; background: var(--ink); color: #fff; }
.status-editor p { margin: 5px 0 0; color: #aaa89f; font-size: 10px; }
.status-editor label > span { display: block; margin-bottom: 7px; color: #aaa89f; font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.status-editor select { width: 100%; height: 39px; padding: 0 34px 0 11px; appearance: none; border: 1px solid #5d5c55; border-radius: 0; color: #fff; background: #363631 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%23fff'/%3E%3C/svg%3E") no-repeat right 12px center; font-size: 11px; cursor: pointer; }

.toast {
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 10;
  padding: 13px 17px;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 0 8px 30px rgba(20,20,17,.18);
  font-size: 11px;
  font-weight: 700;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes slide-in { from { transform: translateX(30px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail { position: static; height: 68px; padding: 0 22px; flex-direction: row; align-items: center; justify-content: space-between; }
  .brand { padding: 0; border: 0; }
  .nav { margin: 0; display: block; }
  .nav-link { display: none; }
  .nav-link.active { display: flex; min-height: auto; padding: 8px 11px; gap: 9px; }
  .nav-link.active .nav-index { display: none; }
  .rail-note, .user-card { display: none; }
  .workspace { padding: 34px 28px 50px; }
  .masthead { grid-template-columns: 1fr; gap: 24px; }
  .intro { max-width: 440px; }
  .signal-board { grid-template-columns: 230px 1fr; }
  .list-labels, .task-row { grid-template-columns: minmax(260px, 1fr) 120px 102px 32px; }
  .list-labels span:nth-child(3), .task-row .due { display: none; }
}

@media (max-width: 650px) {
  .rail { height: 61px; padding: 0 20px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 23px; transform: scale(.88) skew(-8deg); transform-origin: left; }
  .nav-link.active { background: transparent; padding: 0; font-size: 11px; }
  .nav-dot { display: none; }
  .workspace { padding: 29px 20px 45px; }
  .masthead { gap: 21px; padding-bottom: 29px; }
  .kicker { margin-bottom: 13px; gap: 0; }
  .kicker span + span { margin-left: auto; }
  .kicker span + span::before { margin-right: 10px; }
  h1 { font-size: clamp(51px, 15vw, 64px); }
  .intro { padding-left: 16px; font-size: 17px; line-height: 1.35; }
  .signal-board { display: block; }
  .signal-copy { padding: 20px; }
  .status-summary { border-top: 1px solid #42413c; }
  .summary-stat { padding: 15px 10px 14px; }
  .summary-stat span { font-size: 7px; letter-spacing: .05em; }
  .summary-stat strong { font-size: 21px; }
  .inbox { margin-top: 27px; }
  .inbox-heading { align-items: center; }
  .inbox-heading h2 { font-size: 20px; }
  .toolbar { grid-template-columns: 1fr; }
  .search-field, .filter-field { grid-template-columns: 80px 1fr; min-height: 55px; }
  .search-box kbd { display: none; }
  .list-labels { display: none; }
  .task-list { margin-top: 13px; border-top: 1px solid var(--line-dark); }
  .task-row {
    grid-template-columns: minmax(0, 1fr) 30px;
    min-height: 91px;
    gap: 10px;
    padding: 13px 12px 13px 17px;
  }
  .task-row .owner, .task-row .due { display: none; }
  .task-row .status-pill { grid-column: 1; margin-left: 39px; grid-row: 2; }
  .task-row .open-button { grid-column: 2; grid-row: 1 / span 2; }
  .task-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .detail-dialog { width: 100vw; }
  .detail-topbar { height: 61px; padding: 0 20px; }
  .detail-body { padding: 28px 20px 40px; }
  .detail-body h2 { margin: 18px 0 24px; font-size: 38px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-fact:nth-child(even) { border-left: 0; }
  .detail-fact:nth-child(n+2) { border-top: 1px solid var(--line); }
  .body-copy p { font-size: 18px; }
  .status-editor { grid-template-columns: 1fr; padding: 18px; }
  .toast { right: 16px; bottom: 16px; left: 16px; text-align: center; }
}

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