/* Low-tech style: browser default typeface, one weight, size for hierarchy.
   Colors match the four tones of the dithered images. */
html { background: #f2efe4; color: #14321b; }
body { margin: 0; }
h1, h2, h3 { font-weight: normal; margin: 0; }
a { color: #2f6b35; }
a:hover { color: #14321b; }
:focus-visible { outline: 2px solid #2f6b35; outline-offset: 3px; }

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
h1 { font-size: 40px; letter-spacing: 0.02em; }
.top form { margin: 0; }
.link {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: #2f6b35;
  text-decoration: underline;
  cursor: pointer;
}
.link:hover { color: #14321b; }
.note, .lead { margin: 0; font-size: 21px; line-height: 1.55; }
.note { font-style: italic; white-space: pre-line; }
.small { margin: 0; font-size: 15px; color: #2f6b35; }

/* One directory */
.dir { position: relative; display: flex; flex-direction: column; gap: 10px; }
.dir details { margin: 0; }
.dir summary { display: block; list-style: none; cursor: pointer; }
.dir summary::-webkit-details-marker { display: none; }
.dir img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
/* Original cover: a hidden checkbox (toggled by the label) swaps the
   dithered image for the original, in place. No JS, no :has needed. */
.orig-toggle { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.dir img.original { display: none; image-rendering: auto; }
.orig-toggle:checked ~ details img.dithered { display: none; }
.orig-toggle:checked ~ details img.original { display: block; }
.orig .hide, .orig-toggle:checked ~ .under .orig .show { display: none; }
.orig-toggle:checked ~ .under .orig .hide { display: inline; }
.orig-toggle:focus-visible ~ .under .orig { outline: 2px solid #2f6b35; outline-offset: 3px; }
.under {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 44px;
  font-size: 15px;
  color: #2f6b35;
}
.hint, .hint .opened { display: none; }
.orig { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #2f6b35; text-decoration: underline; cursor: pointer; }
.orig:hover { color: #14321b; }
.orig svg { width: 16px; height: 16px; flex: none; fill: currentColor; }
.dir h2 { margin-top: 8px; font-size: 28px; overflow-wrap: anywhere; }
.meta { margin: 0; font-size: 17px; color: #2f6b35; }
.btn {
  align-self: flex-start;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid #2f6b35;
  background: none;
  color: #14321b;
  font: inherit;
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #2f6b35; color: #f2efe4; }
.btn.primary { background: #2f6b35; color: #f2efe4; padding: 0 28px; }
.btn.primary:hover { background: #14321b; border-color: #14321b; }

/* File list: shown when the image is clicked (<details> + :has, no JS).
   Browsers without :has always show it. */
.files { margin-top: 28px; }
.files h3 { font-size: 20px; margin-bottom: 12px; }
.files ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid #7fb36a; }
.files li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  border-bottom: 1px solid #7fb36a;
  font-size: 17px;
}
.files .name { overflow-wrap: anywhere; }
.files .right { display: flex; gap: 24px; align-items: center; white-space: nowrap; }
.size { color: #2f6b35; }

@supports selector(:has(a)) {
  .hint { display: inline; }
  .files { display: none; }
  .dir:has(details[open]) .files { display: block; }
  .dir:has(details[open]) .hint .closed { display: none; }
  .dir:has(details[open]) .hint .opened { display: inline; }
}

/* Login */
.login { display: flex; flex-direction: column; gap: 22px; max-width: 360px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 17px; }
.field input {
  box-sizing: border-box;
  height: 48px;
  padding: 0 12px;
  border: 1.5px solid #2f6b35;
  border-radius: 0;
  background: #f2efe4;
  color: #14321b;
  font: inherit;
  font-size: 18px;
}
.login .btn { margin-top: 6px; }
.error { margin: 0; font-size: 17px; color: #7a1f12; }
