 :root {
    --paper: #eef1ed;
    --paper-card: #fbfbf9;
    --ink: #1f2d27;
    --ink-soft: #52635a;
    --teal: #3b6e62;
    --teal-dark: #2a4f46;
    --gold: #b8935f;
    --line: #dcded6;
    --danger: #b5573f;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(31,45,39,0.04), 0 8px 24px rgba(31,45,39,0.06);
  }
 
  * { box-sizing: border-box; }
 
  html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'IBM Plex Sans', sans-serif;
    min-height: 100vh;
  }
 
  /* subtle paper texture */
  body {
    background-image:
      radial-gradient(circle at 1px 1px, rgba(31,45,39,0.05) 1px, transparent 0);
    background-size: 22px 22px;
  }
 
  .wrap {
    max-width: 560px;
    margin: 0 auto;
    padding: 56px 20px 80px;
  }
 
  /* ---------- Header ---------- */
  header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
  }
 
  .header-text .eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
    margin: 0 0 6px;
  }
 
  h1 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 34px;
    line-height: 1.1;
    margin: 0;
    color: var(--ink);
  }
 
  h1 em {
    font-style: italic;
    font-weight: 500;
    color: var(--teal-dark);
  }
 
  /* ---------- Ink-well progress ring ---------- */
  .ring-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
  }
 
  .ring-wrap svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
    display: block;
  }
 
  .ring-track { fill: none; stroke: var(--line); stroke-width: 6; }
  .ring-fill {
    fill: none;
    stroke: var(--teal);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  }
 
  .ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--ink-soft);
  }
 
  /* ---------- Input row ---------- */
  .composer {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
  }
 
  .composer input {
    flex: 1;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 15px;
    color: var(--ink);
    box-shadow: var(--shadow);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
 
  .composer input::placeholder { color: #9aa39c; }
 
  .composer input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(59,110,98,0.15);
  }
 
  .composer button {
    background: var(--ink);
    color: var(--paper-card);
    border: none;
    border-radius: var(--radius);
    padding: 0 22px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
  }
 
  .composer button:hover { background: var(--teal-dark); }
  .composer button:active { transform: scale(0.97); }
 
  /* ---------- Filters ---------- */
  .filters {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
  }
 
  .filters button {
    background: transparent;
    border: none;
    color: var(--ink-soft);
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.2s ease, color 0.2s ease;
  }
 
  .filters button:hover { color: var(--ink); }
 
  .filters button.active {
    background: var(--ink);
    color: var(--paper-card);
  }
 
  /* ---------- Task list ---------- */
  .list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
 
  .task {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 14px;
    box-shadow: var(--shadow);
    animation: rise 0.28s ease both;
  }
 
  @keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
 
  /* Hand-drawn checkbox */
  .check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.6px solid var(--ink-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: border-color 0.2s ease, background 0.2s ease;
  }
 
  .check svg {
    width: 13px;
    height: 13px;
    stroke: var(--paper-card);
    stroke-width: 2.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: stroke-dashoffset 0.3s ease 0.05s;
  }
 
  .task.done .check {
    background: var(--teal);
    border-color: var(--teal);
  }
 
  .task.done .check svg { stroke-dashoffset: 0; }
 
  .task-body { flex: 1; min-width: 0; }
 
  .task-text {
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink);
    word-break: break-word;
    outline: none;
  }
 
  .task.done .task-text {
    color: var(--ink-soft);
    text-decoration: line-through;
    text-decoration-color: var(--gold);
    text-decoration-thickness: 1.5px;
  }
 
  .task-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #9aa39c;
    margin-top: 4px;
  }
 
  .task-delete {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #b7bdb4;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    transition: color 0.2s ease, background 0.2s ease;
  }
 
  .task-delete:hover { color: var(--danger); background: rgba(181,87,63,0.08); }
 
  /* ---------- Empty state ---------- */
  .empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--ink-soft);
  }
 
  .empty svg { margin-bottom: 14px; opacity: 0.5; }
 
  .empty p {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 17px;
    margin: 0;
  }
 
  /* ---------- Footer ---------- */
  .footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--ink-soft);
  }
 
  .footer-row button {
    background: none;
    border: none;
    color: var(--ink-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
  }
 
  .footer-row button:hover { color: var(--danger); }
 
  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
  }
 
  @media (max-width: 480px) {
    h1 { font-size: 28px; }
    .ring-wrap { width: 58px; height: 58px; }
  }
