:root {
  color-scheme: dark;
  --bg: #141019;
  --ink: #221519;
  --paper: #fff4df;
  --panel: rgba(31, 24, 33, 0.9);
  --panel-strong: rgba(43, 34, 43, 0.96);
  --panel-border: rgba(255, 224, 168, 0.42);
  --text: #fff7e8;
  --muted: #ffdca8;
  --accent: #ff8a24;
  --accent-strong: #ffd34d;
  --mecha: #57b8ff;
  --dora: #7fe7ff;
  --danger: #ff5b6e;
  --shadow: 0 26px 80px rgba(19, 13, 19, 0.58);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 138, 36, 0.34), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(87, 184, 255, 0.24), transparent 26%),
    linear-gradient(135deg, rgba(255, 211, 77, 0.11) 0 10%, transparent 10% 23%, rgba(127, 231, 255, 0.08) 23% 30%, transparent 30%),
    linear-gradient(180deg, #24141a 0%, var(--bg) 54%, #0d111b 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: -12%;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 16% 18%, rgba(255, 244, 223, 0.14) 0 1px, transparent 1px 8px),
    linear-gradient(112deg, transparent 0 35%, rgba(255, 211, 77, 0.1) 35% 36%, transparent 36% 100%),
    linear-gradient(72deg, transparent 0 42%, rgba(87, 184, 255, 0.1) 42% 43%, transparent 43% 100%);
  opacity: 0.8;
  animation: drift 12s ease-in-out infinite alternate;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(120deg, transparent 0 20%, rgba(255, 244, 223, 0.05) 20% 21%, transparent 21% 100%),
    repeating-linear-gradient(100deg, transparent 0 24px, rgba(255, 255, 255, 0.035) 24px 26px),
    linear-gradient(rgba(255, 244, 223, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 244, 223, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 120px 120px, 42px 42px, 42px 42px;
  mask-image: radial-gradient(circle at center, black 58%, transparent 100%);
  opacity: 0.72;
}

.shell {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
  display: grid;
  gap: 18px;
}

.card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(43, 34, 43, 0.95), rgba(22, 18, 27, 0.88)),
    linear-gradient(135deg, rgba(255, 138, 36, 0.16), rgba(87, 184, 255, 0.09));
  border: 2px solid var(--ink);
  box-shadow: var(--shadow), 8px 8px 0 rgba(255, 211, 77, 0.14);
  backdrop-filter: blur(14px);
  border-radius: 18px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(255, 244, 223, 0.16);
  border-radius: 11px;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 0%, rgba(255, 244, 223, 0.15) 48%, transparent 56%);
  transform: translateX(-120%);
  animation: cardShine 7s ease-in-out infinite;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 30px;
  min-height: 180px;
  background:
    linear-gradient(110deg, rgba(255, 138, 36, 0.9) 0 18%, transparent 18% 100%),
    repeating-linear-gradient(112deg, rgba(255, 244, 223, 0.08) 0 2px, transparent 2px 20px),
    linear-gradient(135deg, rgba(50, 35, 38, 0.98), rgba(18, 25, 38, 0.94));
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 720px;
  color: var(--paper);
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow:
    3px 3px 0 var(--ink),
    6px 6px 0 rgba(255, 138, 36, 0.72),
    10px 10px 0 rgba(87, 184, 255, 0.3);
}

h2 {
  color: var(--paper);
  font-size: 1.2rem;
}

.status-pill {
  align-self: start;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd34d, #ff8a24 62%, #57b8ff);
  color: #201218;
  font-weight: 800;
  box-shadow: 4px 4px 0 rgba(34, 21, 25, 0.5);
}

.composer,
.toolbar,
.list-panel,
.edit-form {
  padding: 22px;
}

form {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  border: 2px solid rgba(34, 21, 25, 0.95);
  background: rgba(255, 244, 223, 0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 15px;
  font: inherit;
  box-shadow: 3px 3px 0 rgba(255, 211, 77, 0.08);
}

input::placeholder {
  color: rgba(255, 220, 168, 0.62);
}

input:focus {
  outline: 3px solid rgba(127, 231, 255, 0.6);
  outline-offset: 3px;
}

.actions-row,
.button-group,
.task-topline,
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.inline input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.ghost,
.primary,
.filter {
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.ghost:hover,
.primary:hover,
.filter:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 rgba(34, 21, 25, 0.42);
}

.ghost:active,
.primary:active,
.filter:active {
  transform: translateY(0) scale(0.98);
}

.ghost {
  background: rgba(255, 244, 223, 0.1);
  color: var(--paper);
  border-color: rgba(34, 21, 25, 0.9);
}

.primary {
  background: linear-gradient(135deg, #ffd34d, #ff8a24 54%, #57b8ff);
  color: #1d1218;
  box-shadow: 4px 4px 0 rgba(34, 21, 25, 0.5);
}

.small {
  padding: 8px 12px;
  border-radius: 10px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.search {
  flex: 1;
}

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

.filter {
  background: rgba(255, 244, 223, 0.08);
  color: var(--paper);
}

.filter.is-active {
  background: linear-gradient(135deg, rgba(255, 138, 36, 0.32), rgba(87, 184, 255, 0.22));
  border-color: #ffd34d;
  color: #fff7e8;
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(255, 138, 36, 0.16) 0 8px, transparent 8px),
    linear-gradient(180deg, rgba(45, 38, 44, 0.94), rgba(18, 19, 27, 0.92));
  transform-origin: top center;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  box-shadow: 5px 5px 0 rgba(255, 211, 77, 0.09);
}

.task-item:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: #ffd34d;
  background:
    linear-gradient(90deg, rgba(87, 184, 255, 0.24) 0 8px, transparent 8px),
    linear-gradient(180deg, rgba(56, 44, 48, 0.98), rgba(22, 25, 36, 0.96));
  box-shadow: 7px 7px 0 rgba(87, 184, 255, 0.14);
}

.task-check {
  display: inline-flex;
  align-items: start;
  margin-top: 4px;
}

.task-check input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--accent);
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 0 0 0 rgba(255, 138, 36, 0.22);
}

.task-check input:hover {
  transform: scale(1.08);
}

.task-body {
  min-width: 0;
}

.task-topline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-topline h3 {
  color: var(--paper);
  font-size: 1.08rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(34, 21, 25, 0.88);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.important {
  background: rgba(255, 91, 110, 0.24);
  color: #ffe1d5;
}

.chip {
  background: rgba(127, 231, 255, 0.12);
  color: #d9f7ff;
}

.task-controls {
  display: flex;
  gap: 10px;
}

.task-item.is-complete {
  opacity: 0.72;
}

.task-item.is-complete h3 {
  color: #d7c8b4;
  text-decoration: line-through;
}

.task-item.is-complete .important {
  opacity: 0.7;
}

.empty-state {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
  border: 2px dashed rgba(255, 211, 77, 0.42);
  border-radius: 14px;
  background: rgba(255, 244, 223, 0.06);
}

dialog {
  width: min(560px, calc(100vw - 24px));
  padding: 0;
  color: var(--text);
  background: linear-gradient(180deg, rgba(43, 34, 43, 0.99), rgba(18, 19, 27, 0.98));
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow), 8px 8px 0 rgba(255, 211, 77, 0.14);
}

dialog::backdrop {
  background:
    repeating-radial-gradient(circle at 30% 22%, rgba(255, 244, 223, 0.12) 0 1px, transparent 1px 9px),
    rgba(11, 10, 16, 0.78);
}

.edit-form h2 {
  margin-bottom: 4px;
}

.right {
  justify-content: end;
}

@media (max-width: 860px) {
  .hero,
  .toolbar,
  .actions-row,
  .task-item {
    grid-template-columns: 1fr;
  }

  .hero,
  .toolbar,
  .actions-row {
    display: grid;
  }

  .hero {
    min-height: 0;
  }

  .hero-actions {
    justify-content: start;
  }

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

  .list-header,
  .task-topline {
    align-items: start;
    flex-direction: column;
  }

  .task-controls,
  .button-group {
    flex-wrap: wrap;
  }
}

@keyframes drift {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.03);
  }
}

@keyframes cardShine {
  0%,
  58% {
    transform: translateX(-120%);
  }

  78%,
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body::before,
  .card::after {
    animation: none;
  }
}
