@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 200 700;
  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 {
  --bg: #e4e8f1;
  --surface: #f7f8fc;
  --cavity: #d3d9e8;
  --ink: #14182b;
  --ink-2: #444b69;
  --line: #b4bdd3;
  --brand: #2b3fd9;
  --focus: #14182b;

  --display: "Oswald", "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --text: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad: clamp(16px, 4vw, 40px);
}

[data-status="todo"]        { --s: #2b3fd9; --s-fg: #2335b8; --s-bg: #dde2fb; --s-on: #fff; }
[data-status="in-progress"] { --s: #f0a81c; --s-fg: #6b4300; --s-bg: #fbebc8; --s-on: #14182b; }
[data-status="blocked"]     { --s: #d8344f; --s-fg: #a81b35; --s-bg: #f9d9df; --s-on: #fff; }
[data-status="done"]        { --s: #187a5d; --s-fg: #125c46; --s-bg: #d2ede3; --s-on: #fff; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
}
body.locked { overflow: hidden; }

h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }
button, input, select { font: inherit; color: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--pad); }

/* Top bar */
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; border-radius: 6px; }
.brand-name { font: 600 24px/1 var(--display); letter-spacing: 0.01em; }
.topbar-note { color: var(--ink-2); font-size: 14px; text-align: right; }

/* Intro */
.intro { padding: clamp(28px, 5vw, 56px) 0 clamp(18px, 3vw, 28px); }
.intro h1 {
  font: 600 clamp(52px, 9vw, 104px)/0.95 var(--display);
  letter-spacing: -0.01em;
}
.summary { margin-top: 14px; color: var(--ink-2); font-size: 18px; max-width: 60ch; }

/* Pigeonhole board */
.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--ink);
  border-radius: 8px;
}
.hole {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  min-height: 168px;
  padding: 14px 16px 16px;
  border: 0; border-radius: 3px;
  background: var(--cavity);
  box-shadow: inset 0 10px 16px -10px rgba(20, 24, 43, 0.45);
  text-align: left;
  cursor: pointer;
}
.hole:hover { background: #dbe0ee; }
.hole:focus-visible { outline-color: #fff; outline-offset: -5px; z-index: 1; }
.hole[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: inset 0 -7px 0 var(--s);
}
.hole-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hole-label { font: 500 22px/1.1 var(--display); letter-spacing: 0.01em; }
.hole-count { font: 600 44px/1 var(--display); color: var(--s-fg); }
.tiles { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 6px; }
.tile {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 3px;
  background: var(--s); color: var(--s-on);
  font: 600 12px/1 var(--text);
  box-shadow: 0 2px 0 rgba(20, 24, 43, 0.35);
  transition: opacity 0.15s;
}
.tile.dim { opacity: 0.22; }

/* Tasks */
.tasks { padding: clamp(28px, 4vw, 44px) 0 80px; }
.tasks h2 { font: 600 32px/1.1 var(--display); letter-spacing: 0.01em; margin-bottom: 16px; }
.tasks h2:focus { outline: none; }

.toolbar { display: grid; grid-template-columns: 1fr 240px; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .status-box label { font-size: 14px; font-weight: 600; }
input[type="search"], select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 6px;
}
input[type="search"]::placeholder { color: #5b6280; opacity: 1; }
select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%2314182b' stroke-width='2.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.count { margin: 14px 0 10px; color: var(--ink-2); font-size: 14px; }

.list { display: flex; flex-direction: column; gap: 6px; }
.item {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 150px 60px 70px;
  align-items: center;
  column-gap: 20px;
  padding: 16px 20px 16px 22px;
  background: var(--surface);
  border-radius: 4px;
  border-left: 6px solid var(--s);
}
.item:hover { background: #fff; }
.item:has(.open:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.item.changed { animation: settle 1.4s ease-out; }
@keyframes settle {
  0%, 35% { background: var(--s-bg); }
  100% { background: var(--surface); }
}

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  justify-self: start;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--s-bg); color: var(--s-fg);
  font-size: 14px; font-weight: 600; line-height: 1.3;
  white-space: nowrap;
}
.badge svg { flex: none; }

.title { font-size: 17px; font-weight: 600; line-height: 1.35; }
.open {
  all: unset;
  cursor: pointer;
  border-radius: 3px;
}
.open::after { content: ""; position: absolute; inset: 0; }
.open:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.item:hover .open { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.sub { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--ink-2); }
.sub b { color: var(--ink); font-weight: 600; }
.chip {
  padding: 0 8px; border: 1px solid var(--line); border-radius: 4px;
  font-size: 13px; line-height: 1.55; color: var(--ink-2);
}

.who { display: flex; align-items: center; gap: 10px; font-size: 15px; min-width: 0; }
.avatar {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600;
}
.due, .prio { font-size: 14px; color: var(--ink-2); }
.due { font-weight: 600; color: var(--ink); }
.prio[data-p="high"] { color: #a81b35; font-weight: 600; }

/* Empty */
.empty {
  padding: 40px 24px; text-align: center;
  border: 2px dashed var(--line); border-radius: 8px;
}
.empty-title { font: 500 28px/1.2 var(--display); }
.empty-text { margin: 8px 0 20px; color: var(--ink-2); }

.btn {
  height: 44px; padding: 0 20px;
  background: var(--ink); color: #fff;
  border: 2px solid var(--ink); border-radius: 6px;
  font-weight: 600; cursor: pointer;
}
.btn:hover { background: #2a3052; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--cavity); }

/* Detail drawer */
.detail {
  position: fixed; inset: 0 0 0 auto;
  margin: 0; padding: 0;
  width: min(580px, 100%); max-width: none;
  height: 100dvh; max-height: none;
  border: 0; border-left: 3px solid var(--ink);
  background: var(--surface); color: var(--ink);
  overflow: hidden;
}
.detail[open] { display: flex; flex-direction: column; animation: slide-in 0.22s ease-out; }
.detail::backdrop { background: rgba(20, 24, 43, 0.5); }
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }

.d-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 12px 28px;
  border-bottom: 1px solid var(--line);
}
.d-bar p { font-size: 14px; color: var(--ink-2); }
.close { display: inline-flex; align-items: center; gap: 8px; }
.d-scroll { flex: 1; overflow-y: auto; padding: 28px 28px 48px; }
.d-project { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.d-title { margin-top: 6px; font: 600 clamp(32px, 6vw, 44px)/1.05 var(--display); letter-spacing: 0; overflow-wrap: anywhere; }

.status-box {
  margin-top: 24px; padding: 16px 16px 14px;
  background: var(--s-bg);
  border-left: 6px solid var(--s);
  border-radius: 4px;
}
.status-box select { margin-top: 6px; background-color: #fff; }
.feedback { margin-top: 10px; min-height: 24px; font-size: 15px; color: var(--ink); }
.feedback:empty { display: none; }
.feedback button {
  all: unset; cursor: pointer; margin-left: 6px;
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: 3px;
}
.feedback button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.facts {
  margin-top: 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px;
}
.facts dt { font-size: 14px; color: var(--ink-2); }
.facts dd { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags .chip { font-size: 14px; padding: 2px 10px; }

.d-body { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 62ch; }
.d-body p { font-size: 17px; line-height: 1.65; }
.d-body p + p { margin-top: 1em; }
.d-body strong { font-weight: 700; }

/* Narrow screens */
@media (max-width: 900px) {
  .topbar-note { display: none; }
  .item {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "badge badge badge"
      "main main main"
      "who due prio";
    row-gap: 10px;
    column-gap: 12px;
    padding: 16px 16px 14px 16px;
  }
  .item .badge { grid-area: badge; }
  .item .main  { grid-area: main; }
  .item .who   { grid-area: who; }
  .item .due   { grid-area: due; justify-self: end; }
  .item .prio  { grid-area: prio; justify-self: end; }
}
@media (max-width: 720px) {
  .board { grid-template-columns: 1fr 1fr; }
  .hole { min-height: 128px; padding: 12px; gap: 10px; }
  .hole-label { font-size: 20px; }
  .hole-count { font-size: 36px; }
  .tile { width: 26px; height: 26px; font-size: 11px; }
  .tiles { gap: 4px; }
  .toolbar { grid-template-columns: 1fr; gap: 12px; }
  .summary { font-size: 16px; }
  .detail { border-left: 0; }
  .d-bar { padding-left: 20px; }
  .d-scroll { padding: 22px 20px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .detail[open], .item.changed { animation: none; }
  .tile { transition: none; }
}
