@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Calendar paper on the pad's cardboard backing */
  --ink: #1a1814;
  --ink-2: #3d382f;
  --muted: #625b4e;
  --board: #d8cfbd;
  --paper: #fbf8f1;
  --rule: #ddd4c2;
  --edge: #c9bea8;
  --red: #c4122f;
  --red-ink: #9e0e26;
  --green: #2b7a52;
  --gold: #c9a65a;
  --shadow: 0 1px 1px rgba(26, 24, 20, 0.10), 0 3px 10px rgba(26, 24, 20, 0.07);
  --sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --radius: 3px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--edge) var(--board); }
body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  font-feature-settings: "tnum" 1;
}
::selection { background: var(--ink); color: var(--paper); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bar :focus-visible { outline-color: var(--gold); }

/* Top bar: the pad's black binding strip */
.bar { background: var(--ink); color: #fff; }
.bar-in {
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 24px; min-height: 60px;
}
.mark { font-weight: 650; letter-spacing: 0.32em; color: var(--gold); font-size: 15px; white-space: nowrap; }
.mark span { color: rgba(255, 255, 255, 0.62); letter-spacing: 0.08em; font-weight: 450; margin-left: 10px; }
.tabs { display: flex; gap: 4px; align-self: stretch; }
.tabs a {
  display: flex; align-items: center; padding: 0 14px; text-decoration: none;
  color: rgba(255, 255, 255, 0.7); border-bottom: 3px solid transparent; font-weight: 550;
}
.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.me { margin-left: auto; display: flex; align-items: center; gap: 14px; color: rgba(255, 255, 255, 0.72); font-size: 14px; }
.me b { color: #fff; font-weight: 600; }
.me a, .me button { background: none; border: 0; padding: 8px 0; color: rgba(255, 255, 255, 0.72); text-decoration: underline; }
.me a:hover, .me button:hover { color: #fff; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }

/* Perforated top edge shared by every sheet and slip */
.perf { position: relative; }
.perf::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 5px;
  background: radial-gradient(circle, var(--board) 1.7px, transparent 2.1px) 0 0 / 9px 5px repeat-x;
}

/* Sign in: one sheet on the board */
.login { display: grid; place-items: start center; padding-top: 12vh; }
.login form {
  width: min(360px, 100%); background: var(--paper); padding: 28px 24px 24px;
  border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 10px;
}
.login h1 { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }

input, select {
  border: 1px solid var(--edge); border-radius: var(--radius); background: var(--paper);
  padding: 10px 12px; min-height: 44px; width: 100%;
}
input::placeholder { color: var(--muted); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1814' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px 16px;
}
input:hover, select:hover { border-color: var(--muted); }
.btn {
  border: 0; border-radius: var(--radius); background: var(--red); color: #fff;
  font-weight: 600; padding: 10px 18px; min-height: 44px;
}
.btn:hover { background: var(--red-ink); }
.btn:disabled { opacity: 0.55; cursor: default; }
.error { color: var(--red-ink); min-height: 1.3em; margin: 6px 0 0; font-size: 14px; }
.error:empty { display: none; }

/* Tasks toolbar */
.toolbar { display: grid; gap: 12px; margin-bottom: 18px; }
.add { display: grid; grid-template-columns: 1fr 130px 120px auto; gap: 8px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  border: 1px solid var(--edge); background: var(--paper); border-radius: 999px;
  padding: 6px 14px; min-height: 36px; color: var(--ink-2); font-weight: 500;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Count row: every lane's figure in one glance (phones) */
.counts { display: none; }
.counts a { text-decoration: none; display: flex; align-items: baseline; gap: 6px; }
.counts .num { font-size: 34px; font-weight: 750; letter-spacing: -0.045em; line-height: 1; }
.counts .name { font-size: 11px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }

/* Lanes: each headed like a calendar day */
.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.lane-head { display: flex; align-items: baseline; gap: 10px; padding: 0 2px 8px; border-bottom: 2px solid var(--ink); margin-bottom: 12px; }
.lane-head .num { font-size: 68px; line-height: 0.86; font-weight: 750; letter-spacing: -0.05em; }
.lane-head .name { font-size: 13px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.lane.done .lane-head { border-bottom-color: var(--green); }
.lane.done .lane-head .num { color: var(--green); }

.slip {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 17px 10px 8px 14px; margin-bottom: 10px;
}
.slip .title { margin: 0 0 6px; font-weight: 550; overflow-wrap: anywhere; }
.slip .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slip .who { color: var(--muted); font-size: 13px; }
.slip .date { color: var(--green); font-weight: 600; margin-left: 8px; }
.lane.done .slip .title { color: var(--ink-2); }
.acts { display: flex; gap: 2px; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--rule); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty { color: var(--muted); font-size: 14px; padding: 14px 4px; }

/* Roadmap */
.overall { display: flex; align-items: baseline; gap: 12px; margin-bottom: 26px; }
.overall .num { font-size: 68px; line-height: 0.86; font-weight: 750; letter-spacing: -0.05em; }
.overall .of { color: var(--ink-2); font-weight: 550; }

.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.phase { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.phase-top { background: var(--ink); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; border-radius: var(--radius) var(--radius) 0 0; }
.phase.now .phase-top { background: var(--red); }
.phase.complete .phase-top { background: var(--green); }
.phase-top h2 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; }
.phase-top .tag { font-size: 12px; font-weight: 600; opacity: 0.92; }
.phase-body { padding: 16px 16px 18px; }
.phase-figure { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.phase-figure .num { font-size: 104px; line-height: 0.78; font-weight: 750; letter-spacing: -0.055em; }
.phase-figure .of { color: var(--muted); font-weight: 550; padding-bottom: 2px; }
.phase.now .phase-figure .num { color: var(--red); }

.ms { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.ms li { border-bottom: 1px solid var(--rule); }
.ms label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 2px; min-height: 44px; }
/* Drawn ink box on paper; the real checkbox stays for keyboard and screen readers */
.ms input {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; padding: 0;
  border: 1.5px solid var(--ink); border-radius: 2px; background: var(--paper); flex: none; cursor: pointer;
}
.ms input:hover { background: var(--rule); }
.ms input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ms input:disabled { border-color: var(--edge); cursor: default; background: var(--paper); }
.ms-all-done { color: var(--muted); font-size: 14px; padding: 10px 2px; margin: 0; }

/* The pile: one torn sheet per ticked milestone, stacked so it visibly grows */
.pile { margin: 16px 0 0; }
.pile-tray { border: 1.5px dashed var(--edge); border-radius: var(--radius); min-height: 44px; }
.pile-tray.has { border: 0; min-height: 0; display: grid; }
.sheet {
  position: relative; background: var(--paper); border: 1px solid var(--edge); border-radius: 2px;
  padding: 12px 10px 7px 12px; margin-top: -5px; box-shadow: 0 1px 0 var(--edge), 0 2px 4px rgba(26, 24, 20, 0.06);
  display: flex; gap: 10px; align-items: baseline; font-size: 14px;
}
.sheet:first-child { margin-top: 0; }
.sheet:nth-child(odd) { transform: translateX(3px) rotate(-0.6deg); }
.sheet:nth-child(even) { transform: translateX(-2px) rotate(0.5deg); }
.sheet::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 3px; height: 4px;
  background: radial-gradient(circle, var(--board) 1.5px, transparent 1.9px) 0 0 / 8px 4px repeat-x;
}
.sheet span { color: var(--ink-2); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sheet time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sheet button { border: 0; background: none; padding: 0 2px; color: var(--muted); text-decoration: underline; font-size: 12px; min-height: 24px; }
.sheet button:hover { color: var(--ink); }
.sheet:last-child { margin-bottom: 4px; }

/* The signature move: the ticked line tears off as a sheet and drops onto the pile */
.tear {
  position: fixed; z-index: 10; pointer-events: none; background: var(--paper); border: 1px solid var(--edge);
  border-radius: 2px; padding: 12px 10px 7px 12px; font-size: 14px; color: var(--ink-2);
  box-shadow: 0 10px 24px rgba(26, 24, 20, 0.22);
  transform-origin: 0 0;
  animation: tear 640ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.tear::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 3px; height: 4px;
  background: radial-gradient(circle, var(--board) 1.5px, transparent 1.9px) 0 0 / 8px 4px repeat-x;
}
@keyframes tear {
  0% { transform: translate(0, 0) rotate(0); }
  28% { transform: translate(4px, -12px) rotate(-5deg); }
  100% { transform: translate(var(--dx), var(--dy)) rotate(-0.6deg); }
}
@media (prefers-reduced-motion: reduce) { .tear { animation-duration: 1ms; } }

@media (max-width: 860px) {
  .lanes, .phases { grid-template-columns: 1fr; }
  .add { grid-template-columns: 1fr 1fr auto; }
  .add input { grid-column: 1 / -1; }
  .counts {
    display: flex; justify-content: space-between; gap: 8px; padding: 10px 2px 2px;
    border-top: 2px solid var(--ink);
  }
  .counts .done .num { color: var(--green); }
  .lane-head .num { display: none; }
  .lane-head { padding-top: 6px; }
  .bar-in { gap: 12px; flex-wrap: wrap; padding-top: 6px; }
  .tabs { order: 3; width: 100%; }
  .me { font-size: 13px; }
  .phase-figure .num { font-size: 84px; }
}
