:root {
  color-scheme: light;
  --bg: #f3efe6;
  --bg-accent: #e5dcc8;
  --card: rgba(255, 252, 245, 0.92);
  --ink: #172121;
  --muted: #5f6b6d;
  --line: rgba(23, 33, 33, 0.12);
  --brand: #d95d39;
  --brand-dark: #a8452a;
  --success: #2c6e49;
  --shadow: 0 24px 60px rgba(23, 33, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 93, 57, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(44, 110, 73, 0.18), transparent 32%),
    linear-gradient(135deg, var(--bg), var(--bg-accent));
}

.app-shell {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 64px 20px 80px;
}

.hero {
  max-width: 640px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 0.95;
}

.subtitle {
  margin: 18px 0 0;
  max-width: 560px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.todo-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card-header,
.todo-form,
.todo-item,
.filters {
  display: flex;
  align-items: center;
}

.card-header,
.todo-form {
  justify-content: space-between;
  gap: 16px;
}

.card-header {
  margin-bottom: 22px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.task-summary {
  margin: 6px 0 0;
  color: var(--muted);
}

.ghost-button,
.todo-form button,
.filter,
.delete-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    background-color 180ms ease;
}

.ghost-button {
  padding: 10px 16px;
  color: var(--muted);
  background: rgba(23, 33, 33, 0.06);
}

.todo-form {
  margin-bottom: 18px;
}

.todo-form input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
}

.todo-form input:focus {
  outline: 2px solid rgba(217, 93, 57, 0.28);
  border-color: rgba(217, 93, 57, 0.4);
}

.todo-form button {
  padding: 16px 22px;
  font-weight: 700;
  color: white;
  background: var(--brand);
}

.filters {
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter {
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(23, 33, 33, 0.06);
}

.filter.is-active {
  color: white;
  background: var(--ink);
}

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

.todo-item {
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.todo-toggle {
  position: relative;
  display: inline-flex;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.toggle-mark {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(23, 33, 33, 0.24);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms ease;
}

.toggle-input:checked + .toggle-mark {
  background: var(--success);
  border-color: var(--success);
}

.toggle-input:checked + .toggle-mark::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
}

.todo-text {
  flex: 1;
  font-size: 1rem;
  line-height: 1.5;
}

.todo-item.is-complete .todo-text {
  color: var(--muted);
  text-decoration: line-through;
}

.delete-button {
  padding: 8px 12px;
  color: var(--brand-dark);
  background: rgba(217, 93, 57, 0.12);
}

.empty-state {
  padding: 28px 0 12px;
  color: var(--muted);
  text-align: center;
}

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

button:hover {
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .app-shell {
    padding-top: 42px;
  }

  .todo-card {
    padding: 18px;
  }

  .card-header,
  .todo-form {
    flex-direction: column;
    align-items: stretch;
  }

  .todo-form button,
  .ghost-button {
    width: 100%;
  }

  .todo-item {
    align-items: flex-start;
  }
}
