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

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #152238;
  --navy-deep: #0b1526;
  --paper: #f4f0e7;
  --paper-light: #fbf9f4;
  --ink-muted: #667080;
  --line: #c9c6be;
  --blue: #2e6bff;
  --red: #e45b4c;
  --green: #397c64;
  --amber: #e2a93b;
  --white: #fffdf8;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --body: "Work Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(21, 34, 56, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 48px;
  color: var(--navy);
  font-family: var(--body);
  font-size: 15px;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.page-shell {
  width: min(100%, 1600px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  border-inline: 1px solid rgba(21, 34, 56, 0.12);
}

.masthead {
  min-height: 82px;
  padding: 16px clamp(20px, 4vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--navy);
  color: var(--white);
}

.brand {
  display: grid;
  grid-template-columns: 48px auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  grid-row: 1 / 3;
  fill: none;
  stroke: var(--paper);
  stroke-width: 2;
}

.brand-name {
  font-family: var(--display);
  font-size: 29px;
  line-height: 1;
  letter-spacing: 0.025em;
}

.brand-subtitle {
  color: #b8c5d8;
  font-size: 12px;
  line-height: 1.3;
}

.masthead-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #cbd4e1;
  font-size: 12px;
}

.masthead-note time::before {
  content: "/";
  margin-right: 9px;
  color: #738098;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #75d6a8;
  box-shadow: 0 0 0 4px rgba(117, 214, 168, 0.14);
}

.command {
  padding: clamp(30px, 4vw, 56px) clamp(20px, 4vw, 58px) 34px;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(500px, 0.9fr);
  align-items: end;
  gap: 48px;
  border-bottom: 1px solid var(--line);
}

.intro h1 {
  margin: 0;
  max-width: 720px;
  font-family: var(--display);
  font-size: clamp(52px, 6.4vw, 92px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.intro p {
  max-width: 520px;
  margin: 20px 0 0;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
}

.controls {
  display: grid;
  grid-template-columns: minmax(250px, 1.7fr) minmax(180px, 1fr);
  gap: 14px;
}

.control {
  display: grid;
  gap: 8px;
  color: #4a5567;
  font-size: 12px;
  font-weight: 600;
}

.input-shell,
.select-shell {
  min-height: 50px;
  display: flex;
  align-items: center;
  background: var(--paper-light);
  border: 1px solid #9fa4aa;
}

.input-shell:focus-within,
.select-shell:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.input-shell svg {
  width: 20px;
  margin-left: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.input-shell input,
.select-shell select {
  min-width: 0;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--navy);
}

.input-shell input::placeholder {
  color: #8d929a;
}

.input-shell kbd {
  margin-right: 12px;
  padding: 3px 7px;
  border: 1px solid #c5c3bc;
  border-radius: 3px;
  background: #eae7df;
  color: #777c84;
  font: 11px var(--body);
}

.select-shell {
  position: relative;
}

.select-shell select {
  padding-right: 38px;
  appearance: none;
}

.select-shell svg {
  position: absolute;
  right: 14px;
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  pointer-events: none;
}

.board-wrap {
  padding: 28px clamp(20px, 4vw, 58px) 50px;
}

.board-meta {
  margin-bottom: 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.board-meta h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.board-meta p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.board-hint span {
  color: var(--blue);
  font-size: 18px;
}

.board {
  min-height: 455px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--navy);
  background: var(--paper-light);
}

.lane {
  min-width: 0;
  position: relative;
}

.lane + .lane {
  border-left: 1px solid var(--navy);
}

.lane-heading {
  min-height: 64px;
  padding: 13px 15px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--navy);
  color: var(--white);
  border-top: 5px solid var(--status-color);
}

.lane-heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.lane-heading span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #657189;
  border-radius: 50%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lane-copy {
  margin: 0;
  padding: 12px 14px;
  color: var(--ink-muted);
  border-bottom: 1px dashed var(--line);
  font-size: 11px;
}

.lane-list {
  min-height: 350px;
  margin: 0;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
  list-style: none;
}

.lane-empty {
  margin: 14px;
  color: #8a8f97;
  font-size: 12px;
}

.task-strip {
  position: relative;
  background: var(--white);
  border: 1px solid #aeb0b1;
  border-left: 5px solid var(--status-color);
  box-shadow: 2px 3px 0 rgba(21, 34, 56, 0.1);
}

.task-strip::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  background: linear-gradient(135deg, transparent 48%, #aeb0b1 49%, #aeb0b1 55%, var(--paper-light) 56%);
}

.task-open {
  width: 100%;
  padding: 13px 14px 11px;
  display: block;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.task-open:hover {
  background: #f0f4ff;
}

.task-project {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 650;
}

.priority-mark {
  color: var(--priority-color, var(--ink-muted));
  white-space: nowrap;
}

.task-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.28;
}

.task-foot {
  margin-top: 11px;
  padding-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px dashed #d2d0ca;
  color: var(--ink-muted);
  font-size: 10px;
}

.assignee {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #a9adb4;
  border-radius: 50%;
  background: #edf0f4;
  color: var(--navy);
  font-size: 8px;
  font-weight: 700;
}

.due {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.lane[data-status="todo"] { --status-color: var(--amber); }
.lane[data-status="in-progress"] { --status-color: var(--blue); }
.lane[data-status="blocked"] { --status-color: var(--red); }
.lane[data-status="done"] { --status-color: var(--green); }

.priority-high { --priority-color: #bd3f35; }
.priority-medium { --priority-color: #8b6207; }
.priority-low { --priority-color: #397c64; }

.empty-state {
  min-height: 300px;
  padding: 40px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  border: 1px dashed #8f959d;
  background: var(--paper-light);
}

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

.empty-state[hidden],
.board[hidden] {
  display: none;
}

.empty-symbol {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--display);
  font-size: 38px;
}

.empty-state h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
}

.empty-state p {
  max-width: 440px;
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.5;
}

.button-dark {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
}

.footer {
  min-height: 65px;
  padding: 20px clamp(20px, 4vw, 58px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
}

.detail-dialog {
  width: min(560px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--paper-light);
  color: var(--navy);
  box-shadow: -18px 0 50px rgba(7, 14, 26, 0.28);
}

.detail-dialog::backdrop {
  background: rgba(11, 21, 38, 0.63);
  backdrop-filter: blur(2px);
}

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

.detail-topbar {
  min-height: 74px;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--navy);
  color: var(--white);
  border-top: 6px solid var(--status-color);
}

.detail-topbar p {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
}

.detail-topbar span {
  display: block;
  margin-top: 3px;
  color: #aeb9ca;
  font-family: var(--body);
  font-size: 11px;
}

.close-detail {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #647087;
  background: transparent;
  color: var(--white);
}

.close-detail svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.detail-body {
  padding: 36px 36px 50px;
}

.detail-route {
  margin: 0 0 16px;
  color: var(--status-color);
  font-size: 13px;
  font-weight: 650;
}

.detail-body h2 {
  max-width: 470px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.detail-meta {
  margin: 28px 0 32px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.detail-meta div {
  min-width: 0;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-meta dt {
  margin-bottom: 5px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
}

.detail-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
}

.brief-label {
  margin: 0 0 10px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
}

.brief-copy {
  max-width: 62ch;
  margin-bottom: 34px;
  font-size: 16px;
  line-height: 1.65;
}

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

.status-station {
  padding: 20px;
  background: #e9e6de;
  border: 1px solid #c6c3bb;
}

.status-station label {
  display: grid;
  gap: 9px;
  color: #424c5c;
  font-size: 12px;
  font-weight: 650;
}

.status-station .select-shell {
  background: var(--white);
  border-color: var(--navy);
}

.status-help {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.45;
}

.detail-dialog[data-status="todo"] { --status-color: var(--amber); }
.detail-dialog[data-status="in-progress"] { --status-color: var(--blue); }
.detail-dialog[data-status="blocked"] { --status-color: var(--red); }
.detail-dialog[data-status="done"] { --status-color: var(--green); }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 26px;
  padding: 12px 18px;
  transform: translate(-50%, calc(100% + 50px));
  background: var(--navy-deep);
  color: var(--white);
  border: 1px solid #63728a;
  box-shadow: 0 8px 26px rgba(7, 14, 26, 0.25);
  opacity: 0;
  font-size: 13px;
  pointer-events: none;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  transition: transform 180ms ease-out, opacity 180ms ease-out;
}

@media (max-width: 980px) {
  .command {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .board {
    grid-template-columns: 1fr 1fr;
  }

  .lane:nth-child(3) {
    border-left: 0;
  }

  .lane:nth-child(n + 3) {
    border-top: 1px solid var(--navy);
  }
}

@media (max-width: 620px) {
  body {
    background-size: 100% 40px;
  }

  .page-shell {
    border: 0;
  }

  .masthead {
    min-height: 72px;
    padding: 13px 16px;
  }

  .brand {
    grid-template-columns: 40px auto;
    column-gap: 9px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 24px;
  }

  .masthead-note time,
  .masthead-note span:not(.live-dot) {
    display: none;
  }

  .command {
    padding: 30px 16px 24px;
    gap: 26px;
  }

  .intro h1 {
    font-size: 52px;
  }

  .intro p {
    margin-top: 14px;
    line-height: 1.45;
  }

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

  .input-shell kbd {
    display: none;
  }

  .board-wrap {
    padding: 22px 16px 36px;
  }

  .board-hint {
    display: none;
  }

  .board {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }

  .lane + .lane,
  .lane:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--navy);
  }

  .lane-heading {
    min-height: 54px;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .lane-list {
    min-height: 0;
    padding: 10px;
  }

  .task-open {
    padding: 14px;
  }

  .empty-state:not([hidden]) {
    min-height: 330px;
    padding: 30px 24px;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    padding: 18px 16px;
    display: grid;
  }

  .detail-dialog {
    width: 100%;
  }

  .detail-body {
    padding: 28px 20px 40px;
  }

  .detail-body h2 {
    font-size: 40px;
  }

  .detail-meta {
    margin-top: 24px;
  }

  .toast {
    width: calc(100% - 32px);
    bottom: 16px;
    text-align: center;
  }
}

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

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