/* DotNib's look: the notebook's paper, ink and font, and nothing that moves.
   Everything is one column, so a phone and a desktop show the same page. */

@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plex-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/plex-600.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --paper: light-dark(#fdfcf8, #151517);
  --panel: light-dark(#f3f1ea, #1d1d20);
  --ink: light-dark(#202124, #dad8d1);
  --faint: light-dark(#76746d, #8d8b85);
  --rule: light-dark(#e2dfd6, #2c2c30);
  --dot: light-dark(#dcd9d0, #26262a);
  --project: light-dark(#0e6e62, #5fc3b2);
  --context: light-dark(#7446ad, #b99ce9);
  --date: light-dark(#c2410c, #f59e5b);
  --late: light-dark(#b42318, #f97066);

  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 5mm 5mm;
}
h1,
h2,
p,
ul {
  margin: 0;
}
h1 {
  font-size: 1.25rem;
  font-weight: 600;
}
h2 {
  font-size: 1rem;
  font-weight: 600;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* The page: one column, as wide as reads well. */
.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem max(1rem, env(safe-area-inset-right)) 2rem
    max(1rem, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.narrow {
  max-width: 24rem;
  padding-top: 4rem;
}
.brand {
  font-size: 1.5rem;
}

/* The lists and Projects, as tabs: three to a row on a phone, one row on a
   desktop. */
.top {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top);
}
.tabs {
  max-width: 44rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
/* Projects, the seventh, takes a row of its own on a phone. */
.tabs a:last-child {
  grid-column: 1 / -1;
}
@media (min-width: 640px) {
  .tabs {
    grid-template-columns: repeat(7, auto);
    justify-content: start;
    padding: 0 0.5rem;
  }
  .tabs a:last-child {
    grid-column: auto;
  }
}
.tabs a {
  display: block;
  padding: 0.75rem 0.75rem;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.tabs a[aria-current="page"] {
  font-weight: 600;
  border-bottom-color: var(--ink);
}
@media (min-width: 640px) {
  .tabs a {
    padding: 0.75rem 0.6rem;
  }
}
.count {
  color: var(--faint);
  font-size: 0.875rem;
}

/* Buttons and fields: big enough for a thumb. */
.button {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  min-height: 44px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.button.primary {
  background: var(--ink);
  color: var(--paper);
}
.button.quiet {
  border-color: var(--faint);
  color: var(--faint);
}
.link {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
input[type="text"],
input[type="password"],
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--faint);
  border-radius: 0;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 500;
}

/* The box to add a task. */
.add {
  display: flex;
  gap: 0.5rem;
}
.add input {
  flex: 1;
}

/* A list of tasks: each line opens its task. */
.tasks {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.tasks li {
  border-bottom: 1px solid var(--rule);
}
.task {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem 0.25rem;
  min-height: 44px;
  text-decoration: none;
  background: var(--paper);
}
.task:hover {
  background: var(--panel);
}
.text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.notes {
  color: var(--faint);
  font-size: 0.875rem;
}

/* A section per project, under the tasks that are in none. */
.group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.group + .group {
  margin-top: 0.75rem;
}
.project-name {
  font-weight: 600;
}
.project-name a {
  text-decoration: none;
}
.project-name a:hover {
  text-decoration: underline;
}

/* Markers in a task's text. */
.sig-project {
  color: var(--project);
}
.sig-context {
  color: var(--context);
}
.sig-due,
.soon {
  color: var(--date);
}
.late {
  color: var(--late);
}

/* A task's buttons wrap onto as many rows as they need. */
.moves {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.facts {
  list-style: none;
  padding: 0;
  color: var(--faint);
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow-wrap: anywhere;
}
p.banner {
  padding: 0.75rem;
}
.error {
  color: var(--late);
}
.empty,
.hint {
  color: var(--faint);
}
.back {
  display: inline-block;
  padding: 0.5rem 0;
}

.foot {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem max(2rem, env(safe-area-inset-bottom));
  display: flex;
  gap: 1.5rem;
  color: var(--faint);
}
.foot form {
  margin: 0;
}

/* A preview's page that shows both widths at once. */
.frames {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  align-items: flex-start;
}
.frames iframe {
  border: 1px solid var(--rule);
  background: var(--paper);
}
