:root {
  color-scheme: dark;
  --bg: #081019;
  --bg-alt: #101824;
  --card: rgba(14, 22, 33, 0.82);
  --card-strong: rgba(17, 27, 39, 0.96);
  --surface: rgba(21, 32, 46, 0.9);
  --surface-soft: rgba(33, 47, 65, 0.72);
  --surface-strong: rgba(25, 38, 54, 0.96);
  --field-bg: rgba(11, 18, 29, 0.94);
  --field-border: rgba(154, 177, 201, 0.16);
  --text: #edf3fb;
  --muted: #94a5ba;
  --line: rgba(154, 177, 201, 0.14);
  --shadow: 0 24px 60px rgba(2, 8, 18, 0.42);
  --shadow-float: 0 36px 72px rgba(2, 8, 18, 0.58);
  --accent: #ff8265;
  --accent-dark: #ffb29f;
  --cyan: #61bdb7;
  --gold: #e7b45f;
  --green: #5aa27b;
  --danger: #f07d72;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 130, 101, 0.2), transparent 24%),
    radial-gradient(circle at top right, rgba(97, 189, 183, 0.16), transparent 22%),
    linear-gradient(160deg, #071019 0%, #0c1520 45%, #121926 100%);
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.dragging-board {
  user-select: none;
  cursor: grabbing;
}

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

button {
  cursor: pointer;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 22px 22px;
}

.ambient {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.35;
  z-index: 0;
}

.ambient-left {
  background: rgba(255, 130, 101, 0.34);
  top: -12rem;
  left: -10rem;
}

.ambient-right {
  background: rgba(97, 189, 183, 0.28);
  right: -12rem;
  bottom: -16rem;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.card,
.column {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.brand-lockup h1,
.hero h2,
.login-card h2,
.column h3,
.composer h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.brand-lockup p,
.hero p,
.column-copy,
.login-card p,
.stat-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), #ff9d5c);
  box-shadow: 0 16px 40px rgba(239, 111, 94, 0.32);
}

.eyebrow,
.muted-label,
.column-kicker,
.stat-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
}

.account {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(2, 8, 18, 0.24);
}

.account-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 24px;
  padding: 28px;
  margin-bottom: 22px;
}

.hero h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.98;
  margin-bottom: 14px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 130, 101, 0.12), rgba(22, 33, 47, 0.9));
}

.hero-hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 20px;
  min-height: 132px;
}

.stat-card .stat-value {
  display: block;
  margin-bottom: 8px;
  font-size: 2.2rem;
  letter-spacing: -0.04em;
}

.stat-new {
  background: linear-gradient(160deg, rgba(255, 130, 101, 0.18), rgba(18, 29, 42, 0.96));
}

.stat-progress {
  background: linear-gradient(160deg, rgba(231, 180, 95, 0.18), rgba(18, 29, 42, 0.96));
}

.stat-done {
  background: linear-gradient(160deg, rgba(90, 162, 123, 0.18), rgba(18, 29, 42, 0.96));
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(100%, 360px);
}

.search-field span,
.composer-form label span,
.login-form label span {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-field input,
.composer-form input,
.composer-form textarea,
.composer-form select,
.login-form input {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.search-field input:focus,
.composer-form input:focus,
.composer-form textarea:focus,
.composer-form select:focus,
.login-form input:focus {
  outline: none;
  border-color: rgba(79, 169, 163, 0.6);
  box-shadow: 0 0 0 5px rgba(79, 169, 163, 0.14);
  transform: translateY(-1px);
}

.toolbar-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.toolbar-chip,
.task-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.composer {
  padding: 24px;
  margin-bottom: 22px;
}

.composer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.composer-form {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(220px, 0.7fr);
  gap: 16px;
  align-items: end;
}

.composer-form label {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.composer-form textarea {
  resize: vertical;
  min-height: 125px;
}

.composer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.column {
  position: relative;
  padding: 20px;
  min-height: 520px;
  overflow: visible;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease,
    background 0.24s ease;
}

.column::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: calc(var(--radius-xl) - 8px);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.column-new {
  border-top: 5px solid rgba(239, 111, 94, 0.78);
}

.column-progress {
  border-top: 5px solid rgba(226, 174, 72, 0.82);
}

.column-completed {
  border-top: 5px solid rgba(76, 139, 104, 0.82);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.column-count {
  min-width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 700;
}

.column-copy {
  margin-bottom: 16px;
}

.task-list {
  display: grid;
  gap: 14px;
}

.task-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift-z: 0px;
  --drag-scale: 1;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--card-strong);
  border: 1px solid var(--line);
  box-shadow: 0 18px 34px rgba(2, 8, 18, 0.24);
  transform: translateY(18px);
  opacity: 0;
  animation: card-in 0.45s ease forwards;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease;
}

.task-card:hover {
  transform: translateY(-4px) rotateX(1.8deg) rotateY(-1.8deg);
  box-shadow: 0 24px 40px rgba(2, 8, 18, 0.32);
}

.task-card-top,
.task-meta,
.task-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-card-top {
  touch-action: none;
}

body.dragging-board .task-card,
body.dragging-board .task-card-top {
  cursor: grabbing;
}

.task-card h4 {
  margin: 12px 0 10px;
  font-size: 1.08rem;
  line-height: 1.35;
}

.task-description {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.task-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.83rem;
  font-family: "IBM Plex Mono", monospace;
}

.task-actions {
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.task-action {
  padding: 10px 12px;
  border: none;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.task-action:hover {
  background: var(--surface);
}

.task-action-danger {
  color: var(--danger);
}

.task-pill-new {
  background: rgba(255, 130, 101, 0.18);
  color: var(--accent-dark);
}

.task-pill-in_progress {
  background: rgba(231, 180, 95, 0.18);
  color: #ffd79a;
}

.task-pill-completed {
  background: rgba(90, 162, 123, 0.18);
  color: #9de0b7;
}

.task-grip {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: "IBM Plex Mono", monospace;
}

.task-card-dragging {
  opacity: 1;
}

.task-card-floating {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  margin: 0;
  pointer-events: none;
  animation: none;
  will-change: left, top, transform, box-shadow;
}

.task-card.task-card-floating,
.task-card.task-card-floating:hover {
  transform:
    translate3d(0, 0, var(--lift-z))
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    scale(var(--drag-scale));
  box-shadow: var(--shadow-float);
}

.task-card-placeholder {
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(79, 169, 163, 0.32);
  background: linear-gradient(135deg, rgba(97, 189, 183, 0.12), rgba(24, 37, 51, 0.9));
}

.column-drop-ready {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(79, 169, 163, 0.5);
  box-shadow: 0 28px 54px rgba(79, 169, 163, 0.2);
  background: linear-gradient(180deg, rgba(18, 34, 41, 0.96), rgba(17, 29, 39, 0.96));
}

.column-drop-ready::after {
  opacity: 1;
  transform: scale(1);
  background: linear-gradient(180deg, rgba(79, 169, 163, 0.12), rgba(79, 169, 163, 0.03));
}

.column-drop-commit {
  animation: column-land 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.empty-state {
  padding: 22px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: rgba(17, 28, 40, 0.86);
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.primary-button,
.ghost-button,
.icon-button {
  border: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
  padding: 14px 18px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--accent), #ff9851);
  box-shadow: 0 16px 36px rgba(239, 111, 94, 0.3);
}

.ghost-button {
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-soft);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-2px);
}

.login-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 15, 0.72);
  backdrop-filter: blur(18px);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  padding: 30px;
  background: rgba(14, 22, 33, 0.96);
}

.login-card h2 {
  margin-bottom: 12px;
  font-size: 2rem;
}

.login-form {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 10px;
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  gap: 10px;
}

.toast {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(20, 33, 45, 0.9);
  color: white;
  box-shadow: 0 18px 40px rgba(20, 33, 45, 0.22);
  animation: toast-in 0.22s ease;
}

.toast-success {
  background: rgba(56, 121, 88, 0.94);
}

.toast-danger {
  background: rgba(183, 69, 60, 0.94);
}

.toast-out {
  opacity: 0;
  transform: translateY(12px);
}

.hidden {
  display: none !important;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes column-land {
  0% {
    transform: translateY(-8px) scale(1.01);
  }
  55% {
    transform: translateY(-2px) scale(1.015);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .hero,
  .composer-form,
  .board,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-chip-row {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 20px 16px 34px;
  }

  .topbar,
  .brand-row,
  .account,
  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero {
    padding: 22px;
  }

  .hero h2 {
    font-size: 2.35rem;
  }

  .column {
    min-height: unset;
  }
}
