/* Kanban board. Loaded after ../assets/style.css: uses the portfolio's tokens
   (--bg, --fg, --muted, --border, --accent, --nav-accent, --serif ...) and its
   shared nav, and only adds what the board needs. Class names avoid the
   portfolio's own (.card, .tag, ...). */
:root {
  --border-strong: #2a2b31;
  --danger: #ef4444;
}

:root[data-theme="light"] {
  --border-strong: #c9b994;
  --danger: #b91c1c;
}

.board-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.board-wrap { padding-top: 2rem; padding-bottom: 3rem; }

/* ---- Summary + clock ------------------------------------------------------ */

.intro-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.intro-row .tagline { margin: 0; }

.mini-clock {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--nav-font);
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mini-clock time { color: var(--fg); }
/* Every 5 seconds the time and date flare lime together and fade back. */
.mini-clock.glow, .mini-clock.glow time { animation: minute-glow 1.6s ease-out; }
@keyframes minute-glow {
  0%, 15% {
    color: var(--nav-accent);
    text-shadow: 0 0 12px color-mix(in srgb, var(--nav-accent) 70%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) { .mini-clock.glow, .mini-clock.glow time { animation: none; } }
.mini-clock:hover, .mini-clock:hover time, .mini-clock:focus-visible time { color: var(--nav-accent); }
.mini-clock:focus-visible { outline: none; }
@media (max-width: 480px) {
  .mini-clock .sep, #mini-date { display: none; }
}

/* ---- Heading --------------------------------------------------------------- */

.tagline { font-size: 0.95rem; }

.progress {
  height: 2px;
  margin: 1.5rem 0 2.25rem;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--nav-accent);
  transition: width 0.3s ease;
}

/* ---- Columns --------------------------------------------------------------- */

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 720px) {
  main.board-wrap { padding-top: 2rem; }
  .board { grid-template-columns: 1fr; gap: 2rem; }
}

.column-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.15rem 0.75rem;
}
.column-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
}
/* Each column's color: its dot, and the tint and stripe on its cards. Only the
   site's own palette: neutral zinc for waiting, the lime accent for what's in
   progress, and a faded lime for what's finished. */
:root {
  --col-todo: var(--muted);
  --col-doing: var(--nav-accent);
  --col-done: color-mix(in srgb, var(--nav-accent) 45%, var(--muted));
}
[data-col="todo"] { --col: var(--col-todo); }
[data-col="doing"] { --col: var(--col-doing); }
[data-col="done"] { --col: var(--col-done); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--col); }
.count {
  margin-left: auto;
  font-family: var(--serif);
  font-size: 0.75rem;
  color: var(--muted);
}

.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-radius: 10px;
  outline: 1px dashed transparent;
  outline-offset: 4px;
  transition: background 0.15s, outline-color 0.15s;
}
/* An empty column takes no room. While a card is dragged over it, a drop
   area opens up (the whole column, heading included, accepts the drop). */
.column.drop .tasks { outline-color: var(--accent); background: var(--card-bg); }
.column.drop .tasks.empty { min-height: 3.25rem; }

/* ---- Tasks: same look as the portfolio's project cards --------------------- */

.task {
  position: relative;
  background: color-mix(in srgb, var(--col) 7%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--col) 22%, var(--border));
  border-radius: 10px;
  padding: 0.85rem 1rem 0.85rem 1.3rem;
  box-shadow: inset 3px 0 0 var(--col), 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: grab;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.task:active { cursor: grabbing; }
.task:hover { border-color: color-mix(in srgb, var(--col) 55%, var(--border)); box-shadow: inset 3px 0 0 var(--col), 0 2px 6px rgba(0, 0, 0, 0.1); }
.task:focus-visible, .task:focus-within { border-color: var(--col); outline: none; }
.task.dragging { opacity: 0.35; }

/* Grip dots on hover: this card can be dragged. */
.task::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 6px;
  height: 14px;
  transform: translateY(-50%);
  background-image: radial-gradient(circle, var(--muted) 1px, transparent 1.5px);
  background-size: 3px 3.5px;
  opacity: 0;
  transition: opacity 0.15s;
}
.task:hover::before { opacity: 0.8; }
.task:has(.title[contenteditable="true"]) { cursor: text; }
.task:has(.title[contenteditable="true"])::before { opacity: 0; }
@media (hover: none) { .task::before { content: none; } }

.title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.92rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
}
/* Done: muted text with a clear strike in the column's faded lime. */
[data-col="done"] .title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--col);
  text-decoration-thickness: 2px;
}
[data-col="done"] .title[contenteditable="true"] { color: var(--fg); text-decoration: none; }

/* A card that just changed column: it lands in its old column's color, pops,
   and settles into the new one while a ring in the new color ripples out.
   Done gets a bigger ring. --from is set by board.js. */
.task.arrived { animation: arrive 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
[data-col="done"] .task.arrived { animation-name: arrive-done; animation-duration: 0.9s; }
[data-col="done"] .task.arrived .title { animation: strike 0.5s 0.15s ease-out both; }

@keyframes arrive {
  0% {
    transform: scale(0.94);
    background: color-mix(in srgb, var(--from) 18%, var(--bg));
    border-color: var(--from);
    box-shadow: inset 3px 0 0 var(--from), 0 0 0 0 color-mix(in srgb, var(--col) 55%, transparent);
  }
  45% { transform: scale(1.025); }
  100% {
    transform: scale(1);
    box-shadow: inset 3px 0 0 var(--col), 0 0 0 10px transparent;
  }
}
@keyframes arrive-done {
  0% {
    transform: scale(0.94);
    background: color-mix(in srgb, var(--from) 18%, var(--bg));
    border-color: var(--from);
    box-shadow: inset 3px 0 0 var(--from), 0 0 0 0 color-mix(in srgb, var(--nav-accent) 70%, transparent);
  }
  40% { transform: scale(1.04); }
  100% {
    transform: scale(1);
    box-shadow: inset 3px 0 0 var(--col), 0 0 0 16px transparent;
  }
}
/* The strike-through fades in on a card that just got done. */
@keyframes strike {
  from { color: var(--fg); text-decoration-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .task.arrived, [data-col="done"] .task.arrived, [data-col="done"] .task.arrived .title { animation: none; }
}

/* The floating copy that follows the finger during a touch drag. */
.task.ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  border-color: var(--col);
  box-shadow: inset 3px 0 0 var(--col), 0 12px 28px rgba(0, 0, 0, 0.35);
  transition: none;
}

/* Touch: holding a card starts a drag, so don't select its text or pop the
   browser's callout. Editing turns selection back on. */
@media (pointer: coarse) {
  .task { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .title[contenteditable="true"] { -webkit-user-select: text; user-select: text; }
}

/* Drop marker: where the dragged card will land. */
.placeholder {
  height: 2px;
  margin: -0.35rem 0.25rem;
  border-radius: 2px;
  background: var(--nav-accent);
}

/* Delete: always there, quiet until the card is hovered or focused, red when
   pointed at. */
.delete {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -0.3rem -0.4rem -0.3rem 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.delete svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.task:hover .delete, .task:focus-visible .delete { opacity: 1; }
.delete:hover, .delete:focus-visible {
  opacity: 1;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  outline: none;
}
.task:has(.title[contenteditable="true"]) .delete { visibility: hidden; }
@media (hover: none) { .delete { opacity: 0.8; width: 36px; height: 36px; } }

/* ---- Add: a quiet + that turns into a card as you type ------------------- */

/* At rest it's just a faint + lined up with the cards' text. Hovering shows
   the outline of a card; focusing makes it look exactly like a card in this
   column (tint, border, stripe), so what you type is already a card. */
.add { margin-top: 0.6rem; }
.add input {
  width: 100%;
  background: none;
  color: var(--fg);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.85rem 1rem 0.85rem 1.3rem;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.add input::placeholder { color: var(--muted); opacity: 0.6; transition: opacity 0.15s; }
.add input:hover { border-color: var(--border); }
.add input:hover::placeholder { opacity: 1; }
.add input:focus {
  outline: none;
  cursor: text;
  background: color-mix(in srgb, var(--col) 7%, var(--bg));
  border-color: color-mix(in srgb, var(--col) 40%, var(--border));
  box-shadow: inset 3px 0 0 var(--col);
}
.add input:focus::placeholder { opacity: 0; }

/* ---- Footer ---------------------------------------------------------------- */

.foot { display: flex; justify-content: space-between; gap: 0.5rem; }
.status { color: var(--nav-accent); }
