:root {
  --ink: #1a2332;
  --muted: #5c6b7a;
  --paper: rgba(255, 252, 248, 0.92);
  --line: rgba(26, 35, 50, 0.12);
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --done: #94a3b8;
  --shadow: 0 24px 60px rgba(15, 40, 60, 0.18);
  --radius: 18px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

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

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: #0b1f2a;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, #1d4e5f 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, #0f766e55 0%, transparent 50%),
    linear-gradient(165deg, #072029 0%, #0b1f2a 45%, #123040 100%);
  z-index: -1;
}

.shell {
  width: min(560px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
}

.brand {
  margin-bottom: 1.75rem;
  animation: rise 0.6s ease both;
}

.logo {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f4faf9;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7dd3c7;
}

.tagline {
  margin: 0.65rem 0 0;
  color: #a8c0c8;
  font-size: 0.98rem;
}

.composer {
  display: flex;
  gap: 0.6rem;
  padding: 0.7rem;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.7s ease both;
  animation-delay: 0.08s;
}

.composer input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.7rem 0.85rem;
  color: var(--ink);
}

.composer button {
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 1.15rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.composer button:hover {
  background: var(--accent-hover);
}

.composer button:active {
  transform: scale(0.97);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.1rem 0.35rem 0.55rem;
  min-height: 1.25rem;
  animation: rise 0.7s ease both;
  animation-delay: 0.14s;
}

.count {
  margin: 0;
  color: #9bb4bc;
  font-size: 0.88rem;
}

.linkish {
  border: 0;
  background: transparent;
  color: #7dd3c7;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
}

.linkish:hover {
  text-decoration: underline;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.75s ease both;
  animation-delay: 0.18s;
}

.list:empty {
  display: none;
}

.list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  animation: item-in 0.28s ease both;
}

.list li:last-child {
  border-bottom: 0;
}

.list label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.list input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.list .text {
  flex: 1;
  word-break: break-word;
  line-height: 1.35;
}

.list li.done .text {
  color: var(--done);
  text-decoration: line-through;
}

.delete {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 8px;
}

.delete:hover {
  color: #b91c1c;
  background: #fee2e2;
}

.empty {
  margin: 1rem 0.35rem 0;
  color: #8aa3ab;
  font-size: 0.95rem;
  animation: rise 0.75s ease both;
  animation-delay: 0.2s;
}

.empty[hidden],
#clear-done[hidden] {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .shell {
    padding-top: 3rem;
  }

  .composer {
    flex-direction: column;
  }

  .composer button {
    width: 100%;
  }
}
