:root {
  color-scheme: light;
  --paper: #fffdf8;
  --canvas: #f4f0e8;
  --ink: #26251f;
  --muted: #777267;
  --line: #ded8cc;
  --accent: #cf5b3e;
  --accent-dark: #a9412b;
  --green: #517760;
  --shadow: 0 24px 60px rgba(65, 55, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(207, 91, 62, 0.09), transparent 26rem),
    linear-gradient(135deg, #f8f5ee 0%, var(--canvas) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px 20px;
}

.todo-card {
  width: min(100%, 650px);
  min-height: 630px;
  padding: clamp(28px, 6vw, 58px);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(111, 101, 86, 0.14);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.card-header {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.6rem, 12vw, 6.3rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.date {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 30px 0 38px;
}

.add-form input {
  width: 100%;
  min-width: 0;
  padding: 15px 17px;
  color: var(--ink);
  background: #f8f5ef;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}

.add-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(207, 91, 62, 0.12);
}

.add-form button {
  padding: 0 20px;
  color: white;
  font-weight: 750;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
}

.add-form button:hover {
  background: var(--accent-dark);
}

.add-form button:active {
  transform: translateY(1px);
}

.list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.list-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 500;
}

#task-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 17px 2px;
  border-bottom: 1px solid var(--line);
  animation: enter 180ms ease-out;
}

.toggle {
  display: grid;
  width: 23px;
  height: 23px;
  padding: 0;
  place-items: center;
  color: transparent;
  background: transparent;
  border: 1.5px solid #9c968a;
  border-radius: 50%;
  cursor: pointer;
}

.task.completed .toggle {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.task-text {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.task.completed .task-text {
  color: #999387;
  text-decoration: line-through;
}

.delete {
  padding: 6px 8px;
  color: #948d81;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  opacity: 0.5;
  transition: color 160ms, background 160ms, opacity 160ms;
}

.task:hover .delete,
.delete:focus-visible {
  opacity: 1;
}

.delete:hover {
  color: var(--accent-dark);
  background: rgba(207, 91, 62, 0.09);
}

.empty-state {
  padding: 70px 20px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-check {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.empty-state h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.empty-state p {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

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

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 0;
  }

  .todo-card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

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

  .add-form button {
    min-height: 48px;
  }
}

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