@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display&display=swap");

:root {
  color: #25241f;
  background: #f5f3ed;
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 5%, rgba(235, 103, 72, .11), transparent 24rem),
    linear-gradient(90deg, rgba(37, 36, 31, .025) 1px, transparent 1px);
  background-size: auto, 5rem 100%;
}

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

.app-shell {
  width: min(680px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 8vh 0 5rem;
}

header { margin-bottom: 3.5rem; }

.eyebrow {
  margin: 0 0 .7rem;
  color: #df6245;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: clamp(3.4rem, 10vw, 6.5rem);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.04em;
}

h1 span { color: #df6245; }

.date { margin: 1.25rem 0 0; color: #858278; font-size: .92rem; }

.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  margin-bottom: 3rem;
}

.add-form input {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid #aaa69b;
  outline: 0;
  padding: 1rem .15rem;
  background: transparent;
  color: #25241f;
  font-size: 1.05rem;
  transition: border-color .2s;
}

.add-form input:focus { border-color: #df6245; }
.add-form input::placeholder { color: #aaa69b; }

.add-form button {
  border: 0;
  border-radius: 999px;
  padding: 0 1.35rem;
  background: #25241f;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: transform .2s, background .2s;
}

.add-form button:hover { background: #df6245; transform: translateY(-2px); }
.add-form button span { margin-left: .3rem; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #d8d5cc;
}

.toolbar h2 { margin: 0; font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.filters { display: flex; gap: .15rem; }

.filter {
  border: 0;
  border-radius: 999px;
  padding: .4rem .7rem;
  background: transparent;
  color: #858278;
  cursor: pointer;
  font-size: .76rem;
}

.filter.active { background: #e7e3d9; color: #25241f; }

.todo-list { margin: 0; padding: 0; list-style: none; }

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  border-bottom: 1px solid #d8d5cc;
  animation: appear .25s ease-out;
}

@keyframes appear { from { opacity: 0; transform: translateY(-6px); } }

.check {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border: 1px solid #aaa69b;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.check span { opacity: 0; color: white; font-size: .75rem; }
.todo-title { margin: 0; overflow-wrap: anywhere; }

.delete {
  border: 0;
  padding: .4rem;
  background: transparent;
  color: #aaa69b;
  cursor: pointer;
  font-size: 1.35rem;
  opacity: 0;
  transition: color .2s, opacity .2s;
}

.todo-item:hover .delete, .delete:focus { opacity: 1; }
.delete:hover { color: #df6245; }
.todo-item.completed .check { border-color: #df6245; background: #df6245; }
.todo-item.completed .check span { opacity: 1; }
.todo-item.completed .todo-title { color: #9d998f; text-decoration: line-through; }

.empty-state { padding: 4rem 1rem; text-align: center; }
.empty-mark { color: #df6245; font-family: "DM Serif Display", serif; font-size: 2.8rem; }
.empty-state h3 { margin: .3rem 0; font-family: "DM Serif Display", serif; font-size: 1.6rem; font-weight: 400; }
.empty-state p { margin: 0; color: #858278; font-size: .9rem; }

.clear-button {
  margin-top: 1.2rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: #858278;
  cursor: pointer;
  font-size: .8rem;
  text-decoration: underline;
  text-underline-offset: .2rem;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  border-radius: .4rem;
  padding: .75rem 1rem;
  background: #25241f;
  color: white;
  font-size: .82rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(.5rem);
  transition: .2s;
}

.toast.show { opacity: 1; transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

@media (max-width: 520px) {
  .app-shell { padding-top: 3rem; }
  header { margin-bottom: 2.5rem; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .todo-item { min-height: 4rem; }
  .delete { opacity: 1; }
}

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