:root {
  --bg: #f7f7f4;
  --fg: #1c1c1a;
  --dim: #9b9b95;
  --faint: #d9d9d3;
  --denied: #a33a2e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0b;
    --fg: #d4d4ce;
    --dim: #5f5f5a;
    --faint: #222220;
    --denied: #c25a4c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  min-height: 100vh;
  font: 15px/1.7 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; outline: none; }
::selection { background: var(--fg); color: var(--bg); }

/* gate */
.gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0 16px;
}
.gate input {
  width: min(14rem, 100%);
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--faint);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  letter-spacing: 0.3em;
  text-align: center;
  caret-color: var(--fg);
  outline: none;
  transition: border-color 0.2s, opacity 0.2s;
}
.gate input:focus { border-bottom-color: var(--dim); }
.gate input:disabled { opacity: 0.35; }
.gate input.denied { border-bottom-color: var(--denied); animation: shake 0.3s; }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .gate input.denied { animation: none; }
}

/* unlocked */
.view {
  max-width: 40rem;
  margin: 0 auto;
  padding: 10vh 16px 6rem;
}
.bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
  color: var(--dim);
}
.crumbs { overflow-wrap: anywhere; }
.crumbs .sep { margin: 0 0.4em; }
.crumbs .here { color: var(--fg); }
.bar button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.bar button:hover, .bar button:focus-visible { color: var(--fg); outline: none; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.list a { display: block; padding: 2px 0; }
.list .n { color: var(--dim); }
.empty { color: var(--dim); }

.entry { overflow-wrap: break-word; }
.entry > :first-child { margin-top: 0; }
.entry h1, .entry h2, .entry h3, .entry h4 { font-size: 1em; font-weight: 700; margin: 2em 0 0.5em; }
.entry h1::before { content: "# "; color: var(--dim); }
.entry h2::before { content: "## "; color: var(--dim); }
.entry h3::before { content: "### "; color: var(--dim); }
.entry p, .entry ul, .entry ol, .entry pre, .entry blockquote { margin: 0 0 1.2em; }
.entry ul, .entry ol { padding-left: 1.5em; }
.entry blockquote { padding-left: 1em; border-left: 1px solid var(--faint); color: var(--dim); }
.entry code { font: inherit; background: var(--faint); padding: 0 0.25em; }
.entry pre { overflow-x: auto; padding: 0.8em 1em; background: var(--faint); }
.entry pre code { background: none; padding: 0; }
.entry hr { border: 0; border-top: 1px solid var(--faint); margin: 2em 0; }
.entry img { max-width: 100%; height: auto; }
.entry a { text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--faint);
  color: var(--dim);
}
.pager a:hover, .pager a:focus-visible { color: var(--fg); }
