:root {
  --ink: #121212;
  --paper: #f4f0ff;
  --acid: #c8ff38;
  --pink: #ff5ca8;
  --purple: #7157ff;
  --orange: #ff6937;
  --blue: #3de1ff;
  font-family: "Space Mono", monospace;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--paper); }
button, input { font: inherit; }

.noise {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.ticker { display: flex; overflow: hidden; border-bottom: 3px solid var(--ink); background: var(--acid); font-weight: 700; font-size: .72rem; line-height: 30px; white-space: nowrap; }
.ticker div { flex: none; min-width: max-content; animation: ticker 25s linear infinite; }

.app-shell { position: relative; width: min(90%, 840px); margin: 0 auto; padding: 72px 0 40px; }
.weird-shapes { position: fixed; inset: 0; pointer-events: none; }
.shape { position: absolute; z-index: 0; display: grid; place-items: center; font-family: "Archivo Black", sans-serif; }
.shape-one { top: 14%; left: 4%; color: var(--pink); font-size: clamp(3rem, 7vw, 6rem); animation: spin 12s linear infinite; }
.shape-two { top: 46%; right: -24px; width: 105px; height: 105px; border: 3px solid var(--ink); border-radius: 50%; background: var(--blue); font-size: .78rem; transform: rotate(12deg); box-shadow: 7px 7px 0 var(--ink); }
.shape-three { bottom: 5%; left: 6%; color: var(--purple); font-size: 4rem; transform: rotate(-12deg); }

header { position: relative; display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 55px; }
.headline { position: relative; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; }
.eyebrow span { width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 50%; background: var(--acid); box-shadow: 2px 2px 0 var(--ink); animation: blink 1.2s steps(1) infinite; }
h1 { max-width: 710px; margin: 0; font: 400 clamp(3.5rem, 10vw, 7.4rem)/.78 "Archivo Black", sans-serif; letter-spacing: -.075em; text-transform: uppercase; }
h1 em { display: inline-block; color: var(--purple); font-style: normal; -webkit-text-stroke: 2px var(--ink); text-shadow: 6px 6px 0 var(--acid); transform: rotate(-2deg); }
.scribble { display: inline-block; margin: 26px 0 0 12%; padding: 6px 10px; border: 2px solid var(--ink); background: var(--pink); font-size: .68rem; font-weight: 700; transform: rotate(1.5deg); box-shadow: 3px 3px 0 var(--ink); }

.date-wrap { position: relative; flex: 0 0 auto; margin-bottom: 5px; }
.date-card { display: grid; width: 104px; padding: 17px 8px 14px; border: 3px solid var(--ink); border-radius: 52% 48% 42% 58%; background: var(--orange); text-align: center; transform: rotate(5deg); box-shadow: 7px 7px 0 var(--ink); }
.date-card span { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.date-card strong { margin: 2px 0; font: 400 2.45rem/1 "Archivo Black", sans-serif; }
.time-sticker { position: absolute; z-index: 1; top: -22px; left: -28px; width: max-content; padding: 5px 8px; background: var(--acid); border: 2px solid var(--ink); font-size: .58rem; font-weight: 700; transform: rotate(-11deg); }

.task-panel { position: relative; padding: clamp(24px, 5vw, 44px); border: 3px solid var(--ink); background: #fff; box-shadow: 12px 12px 0 var(--ink); }
.task-panel::before { content: ""; position: absolute; z-index: -1; inset: -18px 18px 18px -18px; border: 3px solid var(--ink); background: var(--pink); transform: rotate(-1deg); }
.panel-label { position: absolute; top: -18px; right: 35px; padding: 6px 12px; border: 2px solid var(--ink); background: var(--blue); font-size: .66rem; font-weight: 700; transform: rotate(2deg); }

.add-form { display: flex; align-items: stretch; gap: 12px; padding-bottom: 25px; border-bottom: 3px solid var(--ink); }
.form-fields { display: flex; align-items: center; min-width: 0; flex: 1; gap: 10px; padding: 5px 14px; border: 2px solid var(--ink); background: #f8f5ff; box-shadow: inset 4px 4px 0 #e7e0ff; }
.add-form #todo-input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .96rem; font-weight: 700; }
.add-form input::placeholder { color: #777182; }
.date-input { display: flex; align-items: center; gap: 5px; color: var(--purple); font-weight: 700; }
.date-input > span:first-child { font-size: 1.2rem; }
.date-input input { width: 120px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .68rem; cursor: pointer; }
.date-input input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .8; }
.add-form > button { width: 58px; flex: 0 0 auto; border: 3px solid var(--ink); background: var(--acid); color: var(--ink); cursor: pointer; box-shadow: 5px 5px 0 var(--ink); transition: transform .15s, box-shadow .15s, background .15s; }
.add-form > button span { display: block; font: 400 2rem/1 "Archivo Black", sans-serif; transition: transform .2s; }
.add-form > button:hover { background: var(--orange); transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.add-form > button:hover span { transform: rotate(45deg); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 25px 0 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter { border: 2px solid transparent; padding: 6px 9px; background: transparent; color: var(--ink); font-size: .61rem; font-weight: 700; cursor: pointer; }
.filter:hover { border-color: var(--ink); }
.filter.active { border-color: var(--ink); background: var(--acid); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1deg); }
#task-count { padding: 4px 7px; background: var(--ink); color: #fff; font-size: .62rem; white-space: nowrap; transform: rotate(1deg); }

#todo-list { counter-reset: tasks; list-style: none; padding: 0; margin: 0; }
.todo-item { counter-increment: tasks; position: relative; display: flex; align-items: center; gap: 13px; min-height: 70px; margin: 0 0 10px; padding: 5px 10px; border: 2px solid var(--ink); background: #fff; box-shadow: 4px 4px 0 var(--ink); animation: arrive .3s cubic-bezier(.2,.8,.2,1) both; transition: transform .15s, background .15s; }
.todo-item:nth-child(3n+1) { transform: rotate(-.35deg); }
.todo-item:nth-child(3n+2) { background: #f0ebff; transform: rotate(.3deg); }
.todo-item:hover { z-index: 2; background: var(--blue); transform: translate(-2px, -2px) rotate(0); }
.todo-item::before { content: "0" counter(tasks); align-self: start; margin-top: 9px; color: var(--purple); font-size: .56rem; font-weight: 700; }
.todo-copy { display: grid; flex: 1; min-width: 0; gap: 5px; padding: 11px 0; }
.todo-title { overflow-wrap: anywhere; font-size: .88rem; font-weight: 700; }
.todo-due { width: max-content; padding: 2px 6px; border: 1.5px solid var(--ink); background: var(--acid); color: var(--ink); font-size: .58rem; font-weight: 700; text-transform: uppercase; transform: rotate(-1deg); }
.todo-due.overdue { background: var(--orange); }
.check { width: 27px; height: 27px; flex: 0 0 auto; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 2px 2px 0 var(--ink); transition: .16s; }
.check span { opacity: 0; font-weight: 700; }
.check:hover { background: var(--acid); transform: scale(1.12) rotate(-8deg); }
.todo-item.completed { background: #ded9e8; box-shadow: 2px 2px 0 var(--ink); }
.todo-item.completed .check { background: var(--pink); transform: rotate(-8deg); }
.todo-item.completed .check span { opacity: 1; }
.todo-item.completed .todo-title { color: #67616e; text-decoration: line-through 3px var(--pink); }
.todo-item.completed .todo-due { background: #aaa3b3; color: var(--ink); }
.delete { border: 0; background: transparent; color: var(--ink); font: 400 1.4rem "Archivo Black", sans-serif; cursor: pointer; opacity: .35; transition: opacity .15s, transform .15s; }
.todo-item:hover .delete, .delete:focus { opacity: 1; }
.delete:hover { color: var(--orange); transform: rotate(12deg) scale(1.2); }

.empty-state { padding: 48px 0 34px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 16px; border: 3px dashed var(--ink); border-radius: 50%; background: var(--acid); font: 400 2rem "Archivo Black", sans-serif; animation: spin 8s linear infinite; }
.empty-state p { margin: 0 0 7px; font: 400 1.5rem "Archivo Black", sans-serif; text-transform: uppercase; }
.empty-state span { font-size: .66rem; }
.clear-button { display: block; margin: 20px 0 0 auto; border: 2px solid var(--ink); padding: 7px 10px; background: var(--pink); color: var(--ink); font-size: .61rem; font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.clear-button:hover { transform: rotate(1deg) translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }

footer { margin-top: 34px; text-align: center; font-size: .61rem; }
footer span { display: inline-block; margin-right: 8px; padding: 3px 6px; background: var(--purple); color: #fff; transform: rotate(-2deg); }
#toast { position: fixed; z-index: 30; left: 50%; bottom: 25px; transform: translate(-50%, 20px) rotate(-1deg); padding: 10px 16px; border: 2px solid var(--ink); background: var(--orange); color: var(--ink); font-size: .72rem; font-weight: 700; box-shadow: 5px 5px 0 var(--ink); opacity: 0; pointer-events: none; transition: .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-1deg); }
.celebration { position: fixed; z-index: 50; top: 45%; left: 50%; width: max-content; padding: 14px 22px; border: 4px solid var(--ink); background: var(--acid); font: 400 clamp(1rem, 4vw, 2rem) "Archivo Black", sans-serif; box-shadow: 9px 9px 0 var(--pink); pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.5) rotate(-8deg); }
.celebration span { color: var(--purple); }
.celebration b { color: var(--orange); }
.celebrate .celebration { animation: celebrate .85s cubic-bezier(.15,.9,.25,1.2); }
.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:focus-visible, input:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }

@keyframes arrive { from { opacity: 0; transform: translateY(12px) rotate(1deg); } }
@keyframes ticker { to { transform: translateX(-100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { background: var(--pink); } }
@keyframes celebrate { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4) rotate(-12deg); } 35%, 70% { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(3deg); } 100% { opacity: 0; transform: translate(-50%,-70%) scale(1.15) rotate(-2deg); } }

@media (max-width: 700px) {
  .app-shell { width: min(90%, 600px); padding-top: 52px; }
  header { align-items: flex-start; }
  h1 { font-size: clamp(3rem, 15vw, 5.3rem); }
  .scribble { margin-left: 0; }
  .date-wrap { margin-top: 35px; }
  .date-card { width: 82px; padding: 13px 7px 11px; }
  .date-card strong { font-size: 2rem; }
  .shape-one, .shape-three { display: none; }
  .shape-two { opacity: .35; }
}

@media (max-width: 520px) {
  .ticker { font-size: .6rem; }
  .app-shell { width: 91%; padding-top: 44px; }
  header { margin-bottom: 46px; }
  .date-wrap { position: absolute; top: -15px; right: 3px; transform: scale(.72); transform-origin: top right; }
  .task-panel { padding: 27px 17px 22px; box-shadow: 7px 7px 0 var(--ink); }
  .task-panel::before { inset: -10px 10px 10px -10px; }
  .add-form { align-items: stretch; }
  .form-fields { align-items: stretch; flex-direction: column; gap: 9px; padding: 11px; }
  .date-input input { width: 130px; }
  .add-form > button { width: 52px; }
  .toolbar { align-items: flex-end; }
  .filters { gap: 2px; }
  .filter { padding-inline: 5px; font-size: .53rem; }
  .todo-item { gap: 9px; padding-inline: 7px; }
  .todo-item::before { display: none; }
  footer { line-height: 1.8; }
}

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