/* Signalborne: the roadmap (/roadmap/) and its private twin (/board/). Needs base.css.
   The network picture as a board: only work in progress is live, in colour; everything else is the grey of the feed.
   Done is solid, up next is a dashed outline (not there yet), later fades further. No boxes around columns: cards sit on the feed. */

html, body { height: 100%; }
body {
  font: 400 15px/1.5 var(--sans);
  padding-block: 0;
  padding-left: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 3vw, 40px), env(safe-area-inset-right, 0px));
}
/* scan lines and a vignette behind everything, as on the front page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 120% 90% at 50% 30%, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}
body.dragging, body.dragging * { cursor: grabbing !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
.app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- the header: the feed's last image behind the title ---------- */
.head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px 32px;
  padding-block: clamp(22px, 4vh, 44px) 22px;
}
.head::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: -10px;
  left: calc(-1 * max(clamp(16px, 3vw, 40px), env(safe-area-inset-left, 0px)));
  right: calc(-1 * max(clamp(16px, 3vw, 40px), env(safe-area-inset-right, 0px)));
  background: url("video/hero-poster.jpg") 50% 40% / cover no-repeat;
  opacity: 0.2;
  filter: grayscale(1) contrast(1.15);
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 20%, transparent 100%);
}
.head-title { display: grid; gap: 10px; min-width: 0; }
.home { display: inline-flex; align-items: center; gap: 12px; width: max-content; text-decoration: none; color: var(--muted); }
.home .mark { width: 30px; height: 30px; }
.home span { font: 600 15px/1 var(--cond); letter-spacing: 0.16em; text-transform: uppercase; }
.home:hover { color: var(--bright); }
.title { font: 700 clamp(40px, 6vw, 72px)/0.9 var(--cond); letter-spacing: 0.04em; text-transform: uppercase; color: var(--bright); }
.title small { margin-left: 14px; font: 500 14px/1 var(--sans); letter-spacing: 0; text-transform: none; color: var(--dim); vertical-align: middle; }
.lede { max-width: 62ch; font-size: 16px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.head-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 18px; font-size: 14px; color: var(--dim); }
.head-side a, .quiet {
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s;
}
.head-side a:hover, .quiet:hover { color: var(--bright); }
.head-side .sep { width: 1px; height: 14px; background: var(--line-2); }

/* the one progress line: how much of Early Access is in the game */
.progress { display: grid; grid-template-columns: auto minmax(120px, 260px) auto; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.progress b { font-weight: 600; color: var(--text); }
.progress-bar { position: relative; height: 2px; background: var(--line-2); }
.progress-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--bright); transition: width 0.4s ease; }

/* ---------- the board ---------- */
.board {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: clamp(18px, 2.2vw, 32px);
  padding-bottom: 24px;
}
.lane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lane-head { display: flex; align-items: baseline; gap: 10px; padding: 4px 2px 12px; border-bottom: 1px solid var(--line-2); }
.lane-name { font: 700 21px/1 var(--cond); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text); }
.lane-count { font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; }
.lane-head .rec-dot { width: 8px; height: 8px; align-self: center; animation-duration: 2.4s; }
.lane-now .lane-head { border-bottom-color: rgba(255, 138, 31, 0.55); }
.lane-done .lane-name { color: var(--bright); }
.lane-later .lane-name { color: var(--muted); }
.lane-blurb { padding: 8px 2px 0; font-size: 13.5px; color: var(--dim); }
.list { display: flex; flex-direction: column; gap: 10px; min-height: 80px; padding: 14px 2px 12px; }
.empty { padding: 18px 2px; font-size: 14px; color: var(--dim); }
.list:has(.card) .empty { display: none; }

/* ---------- a card ---------- */
.card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 13px 16px 14px 36px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: rgba(17, 25, 29, 0.94);
  transition: border-color 0.18s, background-color 0.18s, transform 0.18s, opacity 0.18s;
}
/* the marker: a filled diamond is in the game, an orange one is live, an outline is not there yet */
.card::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 19px;
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: var(--muted);
}
.c-done::before { background: var(--green); box-shadow: 0 0 8px rgba(79, 207, 127, 0.45); }
.c-doing { border-color: rgba(255, 138, 31, 0.42); background: rgba(23, 34, 41, 0.96); }
.c-doing::before { background: var(--orange); box-shadow: 0 0 10px rgba(255, 138, 31, 0.7); }
.c-planned { border-style: dashed; background: rgba(14, 20, 23, 0.72); }
.c-planned::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.c-ideas { border-style: dashed; border-color: var(--line); background: rgba(14, 20, 23, 0.45); }
.c-ideas::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--dim); }
.c-ideas .card-title { color: var(--muted); }
.card-area { font-size: 13px; line-height: 1.3; color: var(--dim); }
.card-title { font: 600 16px/1.3 var(--sans); color: var(--text); overflow-wrap: anywhere; }
.c-doing .card-title { color: var(--bright); }
.card-text { margin-top: 2px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.card-flag { position: absolute; top: 12px; right: 12px; display: inline-flex; color: var(--dim); }
.card-flag svg { width: 14px; height: 14px; }

/* the first load: cards settle in, a column at a time */
@keyframes settle { from { opacity: 0; transform: translateY(6px); } }
.app.entering .card { animation: settle 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 28ms); }

/* ---------- the private board: cards you can move ---------- */
.card.movable { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.card.movable:hover { border-color: var(--line-3); transform: translateY(-1px); }
.card.movable:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 2px; }
.dragging .card.movable:hover { transform: none; border-color: var(--line-2); }
.card.placeholder { border: 1px dashed var(--line-3); background: transparent; transform: none; }
.card.placeholder > *, .card.placeholder::before { visibility: hidden; }
.card.floating {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 70;
  margin: 0;
  pointer-events: none;
  border-color: var(--line-3);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  transition: none;
}
.add-card { margin: 2px 0 0; padding: 6px 2px; border: 0; background: none; color: var(--dim); font-size: 14px; text-align: left; transition: color 0.15s; }
.add-card:hover { color: var(--bright); }
.add-form .field-input { padding: 9px 12px; border: 1px solid var(--line-3); border-radius: 3px; background: rgba(17, 25, 29, 0.94); }
.dragging .board .lane { scroll-snap-align: none; }

.search { position: relative; display: inline-flex; align-items: center; }
.search svg { position: absolute; left: 0; width: 15px; height: 15px; color: var(--dim); pointer-events: none; }
.search input { width: 150px; padding: 6px 0 6px 22px; border: 0; border-bottom: 1px solid var(--line-2); background: none; color: var(--text); font-size: 14px; transition: width 0.2s, border-color 0.2s; }
.search input:focus { width: 210px; border-bottom-color: var(--orange); outline: none; }
.search input::placeholder { color: var(--dim); }
.saving { min-width: 64px; font-size: 13.5px; color: var(--dim); transition: color 0.2s; }
.saving.busy { color: var(--muted); }
.saving.bad { color: var(--red-2); }

/* ---------- phone: one column at a time ---------- */
.tabs { display: none; }
@media (max-width: 760px) {
  .head { grid-template-columns: 1fr; align-items: start; }
  .head-side { justify-content: flex-start; }
  .tabs {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0 0 4px;
    padding: 8px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-2);
  }
  .tabs button { padding: 8px 2px; border: 0; background: none; color: var(--dim); font: 600 14px/1.1 var(--cond); letter-spacing: 0.06em; text-transform: uppercase; }
  .tabs button[aria-selected="true"] { color: var(--bright); box-shadow: inset 0 -2px 0 var(--bright); }
  .tabs button.t-now[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--orange); }
  .tabs small { display: block; margin-top: 3px; font: 500 12px/1 var(--sans); letter-spacing: 0; color: var(--dim); }
  .progress { grid-template-columns: auto minmax(60px, 1fr) auto; }
  .progress > span:last-child { white-space: nowrap; }
  .board { display: block; }
  .lane:not(.shown) { display: none; }
  .lane-head { display: none; }
  .lane-blurb { padding-top: 6px; }
  .search input, .search input:focus { width: 130px; }
}
/* on a desk the board fills the window and each column scrolls */
@media (min-width: 761px) and (min-height: 620px) {
  .app.fit { height: 100%; }
  .fit .lane { max-height: 100%; }
  .fit .list { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
}
@media (min-width: 761px) and (max-width: 1120px) {
  .board { overflow-x: auto; grid-template-columns: repeat(4, minmax(250px, 300px)); }
}

/* ---------- the card panel and the small dialogs ---------- */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(3, 6, 8, 0.55); }
.drawer {
  width: min(460px, 100%);
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line-2);
  background: #0c1215;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
}
.drawer[open] { animation: drawer-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.drawer.closing { animation: drawer-out 0.18s ease-in forwards; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes drawer-out { to { transform: translateX(40px); opacity: 0; } }
.modal {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: #0c1215;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal[open] { animation: modal-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal.closing { animation: modal-out 0.15s ease-in forwards; }
@keyframes modal-in { from { transform: translateY(8px); opacity: 0; } }
@keyframes modal-out { to { transform: translateY(8px); opacity: 0; } }
.sheet { display: flex; flex-direction: column; min-height: 100%; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 6px; }
.sheet-top h2 { font: 700 15px/1 var(--cond); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.sheet-body { flex: 1 1 auto; display: grid; align-content: start; gap: 22px; padding: 10px 24px 24px; overflow-y: auto; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.sheet-foot .spacer { flex: 1 1 auto; }
.close { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; color: var(--dim); }
.close:hover { color: var(--bright); }
.close svg { width: 16px; height: 16px; }

.field { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--dim); }
.field-label em { font-style: normal; font-variant-numeric: tabular-nums; }
.field-input {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
  background: none;
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s;
}
.field-input:focus { border-bottom-color: var(--orange); outline: none; }
textarea.field-input { resize: vertical; min-height: 44px; line-height: 1.5; }
textarea.grow { resize: none; overflow-y: auto; }
.title-input { min-height: 0; font: 600 22px/1.25 var(--sans); }
select.field-input { padding-right: 18px; background: none; }
select.field-input option { background: #0c1215; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }

.segments { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-2); border-radius: 3px; }
.segments button { padding: 9px 4px; border: 0; background: none; color: var(--dim); font-size: 13.5px; transition: color 0.15s, background-color 0.15s; }
.segments button + button { border-left: 1px solid var(--line-2); }
.segments button[aria-pressed="true"] { background: rgba(244, 247, 248, 0.08); color: var(--bright); }
.segments button[data-col="doing"][aria-pressed="true"] { background: var(--orange-wash); color: var(--orange-2); }

.public-box { display: grid; gap: 18px; padding: 16px 16px 18px; border: 1px solid var(--line-2); border-radius: 3px; }
.public-box.off .public-fields { display: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch span { font-size: 15px; color: var(--text); }
.switch small { display: block; margin-top: 2px; font-size: 13px; color: var(--dim); }
.switch input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 11px; background: var(--line-2); cursor: pointer; transition: background-color 0.18s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.18s, background-color 0.18s; }
.switch input:checked { background: rgba(255, 138, 31, 0.55); }
.switch input:checked::after { transform: translateX(16px); background: var(--bright); }
.switch input:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border: 0;
  border-radius: 3px;
  background: var(--bright);
  color: #0a0e10;
  font: 600 14.5px/1.2 var(--sans);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: #fff; }
.btn.plain { background: none; color: var(--muted); padding-inline: 4px; }
.btn.plain:hover { color: var(--bright); }
.btn.danger { background: none; color: var(--dim); padding-inline: 4px; }
.btn.danger:hover { color: var(--red-2); }
.btn.danger.armed { color: var(--red-2); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.hint { font-size: 13.5px; line-height: 1.45; color: var(--dim); }
.error { min-height: 1.2em; font-size: 14px; color: var(--red-2); }
.opts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--muted); }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--orange); }
.msgs { display: grid; gap: 18px; }
.msg { display: grid; gap: 8px; }
.msg-head { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--dim); }
.msg-head .grow { flex: 1 1 auto; }
.msg-head .over { color: var(--red-2); }
.msg textarea { min-height: 170px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 3px; background: rgba(17, 25, 29, 0.9); color: var(--text); font: 400 12.5px/1.5 var(--mono); resize: vertical; }

/* the login */
.login { flex: 1 1 auto; display: grid; place-items: center; padding-block: 48px; }
.login-box { display: grid; gap: 22px; width: min(360px, 100%); }
.login-box .title { font-size: clamp(36px, 8vw, 52px); }
.login-box p { color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: #121a1e;
  color: var(--text);
  font-size: 14px;
  transform: translateX(-50%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.status-msg { padding: 40px 0; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .app.entering .card, .drawer[open], .drawer.closing, .modal[open], .modal.closing { animation: none; }
  .card, .card.movable:hover { transition: none; transform: none; }
}
