:root {
  --bg:          #14161a;
  --panel:       #181b20;
  --card:        #1f2329;
  --line:        #2b3038;
  --line-strong: #3a414b;

  --text:  #ece8e1;
  --muted: #8d949e;

  --accent: #f2a9bf;

  --tcc:      #8fd3c0;
  --escola:   #f0cf8a;
  --desenhos: #f2a9bf;
  --academia: #9cc4f2;
  --pessoal:  #c8b8ee;

  --radius: 5px;

  --font-ui:   "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: dark;
}

[data-cat="tcc"]      { --c: var(--tcc); }
[data-cat="escola"]   { --c: var(--escola); }
[data-cat="desenhos"] { --c: var(--desenhos); }
[data-cat="academia"] { --c: var(--academia); }
[data-cat="pessoal"]  { --c: var(--pessoal); }

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

button, input, select { font: inherit; color: inherit; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px 40px;
  align-items: end;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--line);
}

.hero-text { min-width: 0; }

.ascii {
  display: block;
  width: 100%;
  height: 150px;
  transform-origin: center;
  animation: title-drift 4.8s ease-in-out infinite;
}

@keyframes title-drift {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-5px) rotate(-0.35deg); }
}

.focus {
  position: relative;
  display: flex;
  width: fit-content;
  gap: 0.6em;
  margin: 10px 0 0 6px;
  font: 600 1.25rem/1.2 var(--font-ui);
  letter-spacing: 0.01em;
}

.focus-word {
  color: var(--muted);
  filter: blur(3px);
  transition: filter 0.5s ease, color 0.5s ease;
}
.focus-word.is-active { color: var(--text); filter: blur(0); }

.focus.is-static .focus-word { color: var(--text); filter: none; }

.focus-frame {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
  pointer-events: none;
  transition:
    transform 0.5s cubic-bezier(0.3, 0.8, 0.2, 1),
    width     0.5s cubic-bezier(0.3, 0.8, 0.2, 1),
    height    0.5s cubic-bezier(0.3, 0.8, 0.2, 1);
}
.focus-frame.no-anim { transition: none; }

.focus-frame i {
  position: absolute;
  width: 10px; height: 10px;
  border: 0 solid var(--accent);
}
.focus-frame i:nth-child(1) { top: -6px;    left: -8px;  border-top-width: 2px;    border-left-width: 2px; }
.focus-frame i:nth-child(2) { top: -6px;    right: -8px; border-top-width: 2px;    border-right-width: 2px; }
.focus-frame i:nth-child(3) { bottom: -6px; left: -8px;  border-bottom-width: 2px; border-left-width: 2px; }
.focus-frame i:nth-child(4) { bottom: -6px; right: -8px; border-bottom-width: 2px; border-right-width: 2px; }

.swap {
  position: relative;
  height: 196px;
  perspective: 900px;
  perspective-origin: 70% 30%;
}

.swap-card {
  --slot: 0;
  position: absolute;
  right: 0; bottom: 0;
  width: min(300px, calc(100% - 40px));
  height: 156px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  z-index: calc(10 - var(--slot));
  filter: brightness(calc(1 - var(--slot) * 0.14));
  transform: translate3d(
    calc(var(--slot) * -18px),
    calc(var(--slot) * -18px),
    calc(var(--slot) * -70px)
  );
  transition:
    transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity   0.4s ease,
    filter    0.75s ease;
  will-change: transform;
}

.swap-card.is-dropping {
  transform: translate3d(0, 110px, 0);
  opacity: 0;
}

.swap-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}
.swap-meta { font: 500 0.72rem var(--font-mono); }

.swap-body { font-size: 0.95rem; line-height: 1.4; }

.swap-task { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.swap-task-title {
  margin: 0;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swap-big  { margin: 2px 0 0; font: 700 2rem/1 var(--font-mono); }
.swap-text { margin: 6px 0 12px; color: var(--muted); font-size: 0.85rem; }
.swap-quote { margin: 4px 0 0; font-size: 1.05rem; line-height: 1.35; font-weight: 500; }

.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar > span {
  display: block;
  width: 0; height: 100%;
  background: var(--tcc);
  transition: width 0.5s ease;
}

.composer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

#form-tarefa {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 560px;
}

input, select {
  height: 38px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
input::placeholder { color: var(--muted); }
input:hover, select:hover { border-color: var(--line-strong); }

#input-titulo { flex: 1 1 240px; min-width: 0; }

select {
  appearance: none;
  padding-right: 32px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5l4 4 4-4' fill='none' stroke='%238d949e' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.btn-primary {
  height: 38px;
  padding: 0 16px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-primary:hover { background: #fff; border-color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
}
.chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c, transparent);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] {
  color: var(--text);
  background: var(--card);
  border-color: var(--line-strong);
}
.chip[data-filter="all"]      { --c: transparent; }
.chip[data-filter="all"]::before { display: none; }
.chip[data-filter="tcc"]      { --c: var(--tcc); }
.chip[data-filter="escola"]   { --c: var(--escola); }
.chip[data-filter="desenhos"] { --c: var(--desenhos); }
.chip[data-filter="academia"] { --c: var(--academia); }
.chip[data-filter="pessoal"]  { --c: var(--pessoal); }

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  padding-bottom: 72px;
}

.kanban-column {
  min-height: 240px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.15s ease;
}
.kanban-column.is-over { border-color: var(--accent); }

.col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2px 2px 10px;
}
.col-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.count { font: 500 0.8rem var(--font-mono); color: var(--muted); }

.col-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  color: var(--escola);
  background: color-mix(in srgb, var(--escola) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--escola) 32%, transparent);
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.task-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }

.empty {
  padding: 18px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.task {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 2px solid var(--c, var(--line-strong));
  border-radius: var(--radius);
  cursor: grab;
}
.task:hover { border-color: var(--line-strong); border-left-color: var(--c); }
.task:focus { outline: none; }
.task:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.task.is-dragging { opacity: 0.4; }
.task.is-new { animation: settle 0.4s ease-out; }

@keyframes settle {
  from { opacity: 0.4; transform: translateY(-6px); box-shadow: 0 0 0 1px var(--accent); }
  to   { opacity: 1;   transform: none;             box-shadow: 0 0 0 1px transparent; }
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border-radius: 3px;
  font-weight: 500;
  font-size: 0.72rem;
}

.task-title { margin: 8px 0 10px; font-weight: 500; overflow-wrap: anywhere; }
.task.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.task-actions { display: flex; align-items: center; gap: 6px; }

.btn-ghost {
  height: 26px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.78rem;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }
.btn-ghost.is-primary { color: var(--text); border-color: var(--line-strong); }
.btn-ghost.is-primary:hover { background: var(--line); }

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  margin-left: auto;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.btn-icon:hover { color: var(--text); border-color: var(--line-strong); }

.toast {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 16px; padding-top: 20px; }
  .ascii { height: 120px; }
  .swap { max-width: 340px; }
  .kanban-board { grid-template-columns: 1fr; }
  .kanban-column { min-height: 0; }
}

@media (max-width: 560px) {
  .shell { padding: 0 14px; }
  #form-tarefa > input   { flex-basis: 100%; }
  #form-tarefa > select  { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}