@font-face {
  font-family: "Syne Local";
  src: url("fonts/syne-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Local";
  src: url("fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Local";
  src: url("fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --backing: #c5d4cc;
  --paper: #e7f0ea;
  --ink: #1a2822;
  --muted: #4e6358;
  --line: rgba(26, 40, 34, 0.22);
  --head: #ffd84a;
  --punch: #d63b2f;
  --field: #f6fbf7;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--backing);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--backing);
  color: var(--ink);
  font-family: "Atkinson Local", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.4;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

button,
input {
  -webkit-tap-highlight-color: transparent;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--punch);
  outline-offset: 3px;
}

.page {
  position: relative;
  max-width: 44rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.25rem 1.1rem calc(2.5rem + env(safe-area-inset-bottom)) 2.75rem;
  background: var(--paper);
}

.page::before {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 0.75rem;
  width: 1.15rem;
  background: radial-gradient(circle, var(--backing) 5px, #9aafa4 5.6px, transparent 6.6px) center top / 1.15rem 28px repeat-y;
  pointer-events: none;
}

.mast-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
}

h1 {
  margin: 0.1rem 0 0.55rem;
  font-family: "Syne Local", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-weight: 800;
  font-size: clamp(3.1rem, 11vw, 5.4rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
}

#install {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

label {
  display: block;
  margin: 1.15rem 0 0.4rem;
  font-weight: 700;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.composer input {
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(26, 40, 34, 0.35);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}

.composer button,
.actions button,
#clear-done,
.filters button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.composer button {
  min-height: 48px;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.composer button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hint,
.status,
.ios-hint {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hint.over,
.status.is-error {
  color: var(--punch);
}

.tape {
  --gap: 6px;
  --cells: 12;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cells), minmax(0, 1fr));
  gap: var(--gap);
  margin: 1.15rem 0 1.35rem;
}

.cell {
  aspect-ratio: 1;
  background: rgba(26, 40, 34, 0.08);
}

.head {
  position: absolute;
  top: 0;
  left: 0;
  width: calc((100% - (var(--cells) - 1) * var(--gap)) / var(--cells));
  aspect-ratio: 1;
  background: var(--head);
}

.tape.is-running .head {
  animation: sweep 0.45s steps(11, end) 1 forwards;
}

@keyframes sweep {
  to {
    transform: translateX(calc((var(--cells) - 1) * (100% + var(--gap))));
  }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.75rem;
}

.count {
  margin: 0;
  font-weight: 700;
}

.filters {
  display: flex;
  flex-wrap: wrap;
}

.filters button {
  min-height: 44px;
  padding: 0.35rem 0.55rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
}

.filters button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

#clear-done {
  min-height: 44px;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  color: var(--punch);
}

.tasks {
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "strip title"
    "actions actions";
  column-gap: 0.75rem;
  row-gap: 0.45rem;
  align-items: center;
  padding: 0.9rem 0;
  border-top: 1px dashed var(--line);
}

.strip {
  display: flex;
  grid-area: strip;
  gap: 4px;
  align-items: center;
}

.hole {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d5e0da;
  box-shadow: inset 0 0 0 1px #9aafa4;
}

.hole.on {
  background: var(--ink);
  box-shadow: none;
}

.title {
  grid-area: title;
  overflow-wrap: anywhere;
}

.task.is-done .title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1px;
}

.task.is-done .strip {
  opacity: 0.45;
}

.actions {
  display: flex;
  grid-area: actions;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.actions button {
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.actions button[data-act="delete"] {
  border-color: transparent;
  color: var(--punch);
}

.empty {
  margin: 0;
  padding: 1rem 0;
  border-top: 1px dashed var(--line);
  color: var(--muted);
}

.ticker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  margin: 1.3rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.ticker div {
  min-width: 0;
}

.ticker dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.ticker dd {
  margin: 0.12rem 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.program-link {
  color: var(--ink);
}

.legend {
  margin-top: 2rem;
}

.legend h2 {
  margin: 0 0 0.7rem;
  font-family: "Syne Local", "Avenir Next Condensed", sans-serif;
  font-size: clamp(1.2rem, 4.6vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.legend ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend li {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
}

.legend code,
#last-steps,
#program-size {
  font-family: ui-monospace, "SFMono-Regular", "Source Code Pro", monospace;
}

.legend code {
  font-size: 1.15rem;
}

.ios-hint {
  margin-top: 1.2rem;
}

@media (min-width: 700px) {
  .page {
    padding-left: 3.1rem;
  }

  .composer {
    flex-direction: row;
    align-items: stretch;
  }

  .composer input {
    flex: 1;
    width: auto;
  }

  .count {
    margin-right: auto;
  }

  #clear-done {
    margin-left: auto;
  }

  .task {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "strip title actions";
    align-items: center;
  }

  .legend ul {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tape.is-running .head {
    animation: none;
  }
}
