/* Office desk palette: cool desk, white sheet, blue-black ink, ballpoint blue; red stamp only for errors */
@font-face { font-family: "Atkinson"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/atkinson-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/atkinson-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --desk: #e7ebef; --sheet: #ffffff; --ink: #18202e; --pencil: #5a6474;
  --rule: #cfd6de; --accent: #2442c2; --ok: #1b7a4c; --err: #b8322a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --desk: #12161d; --sheet: #1b212b; --ink: #e6eaf0; --pencil: #a1abb9;
    --rule: #333c4a; --accent: #8198ff; --ok: #6fcf9b; --err: #ff8f86; color-scheme: dark; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--desk); color: var(--ink);
  font: 17px/1.55 "Atkinson", system-ui, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
main, .top, footer { max-width: 840px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 8px 24px; padding-top: 20px; padding-bottom: 4px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 16px; }
.top nav a { color: var(--pencil); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

.hero { padding: 36px 0 20px; max-width: 34em; }
h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 800; margin: 0 0 12px; }
h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; margin: 40px 0 12px; }
.lead { font-size: 19px; color: var(--pencil); margin: 0; }

/* The sheet: a white page resting on a second, offset one */
.sheet { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px;
  margin: 8px 8px 8px 0; }
.sheet::before { content: ""; position: absolute; inset: 0; transform: translate(8px, 8px); z-index: -1;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; }
main { position: relative; z-index: 0; }

.tool { padding: 20px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px dashed var(--rule); border-radius: 3px; padding: 28px 16px 24px; text-align: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .pages { width: 72px; height: 58px; margin-bottom: 4px; }
.drop .pages rect { fill: var(--sheet); stroke: var(--pencil); stroke-width: 1.5; }
.drop .pages path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.drop.over .pages { transform: translateY(-3px); transition: transform .15s; }
.drop strong { font-size: 19px; }
.drop span { color: var(--pencil); font-size: 15px; }

.files { list-style: none; padding: 0; margin: 12px 0 0; }
.files:empty { display: none; }
.files li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.files .size { color: var(--pencil); font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.icon-btn { min-width: 40px; min-height: 40px; border: 1px solid var(--rule); border-radius: 3px;
  background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.icon-btn:hover { border-color: var(--ink); }

.options { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 18px 0 0; }
.options label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 100%; }
.options fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.options legend { font-weight: 700; margin-bottom: 6px; width: 100%; padding: 0; }
.options input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.options input[type=text] { width: 14em; max-width: 100%; }
input[type=text], select { font: inherit; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 3px;
  background: var(--sheet); color: var(--ink); min-height: 44px; }
.count { color: var(--pencil); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.btn { min-height: 48px; padding: 0 26px; border: 0; border-radius: 3px; background: var(--accent); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer; }
@media (prefers-color-scheme: dark) { .btn { color: #0d1430; } }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { background: var(--rule); color: var(--pencil); cursor: not-allowed; }
.status { margin: 12px 0 0; min-height: 1.55em; font-weight: 600; }
.status:empty { margin: 0; min-height: 0; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }
.local-note { margin: 16px 0 0; font-size: 15px; color: var(--pencil); }
.local-note::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px;
  border-radius: 50%; background: var(--ok); vertical-align: 1px; }

.info { max-width: 40em; }
.info ol { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.info ol li { counter-increment: step; position: relative; padding: 0 0 12px 44px; }
.info ol li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px;
  border: 2px solid var(--accent); border-radius: 50%; color: var(--accent); font-weight: 800;
  text-align: center; line-height: 26px; font-size: 15px; }
.info ul { padding-left: 1.2em; }
.info ul li { margin-bottom: 6px; }
.info details { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.info details:first-of-type { border-top: 1px solid var(--rule); }
.info summary { cursor: pointer; font-weight: 700; }
.info details p { margin: 8px 0 0; color: var(--pencil); }
.related { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* Home: tools as a ruled index, like the contents of a folder */
.index { list-style: none; padding: 4px 20px; margin-top: 8px; }
.index li + li { border-top: 1px solid var(--rule); }
.index a { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px;
  padding: 16px 0; text-decoration: none; color: var(--ink); }
.index strong { font-size: 21px; letter-spacing: -0.01em; }
.index span { color: var(--pencil); }
.index a:hover strong { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.index + .local-note { margin-left: 2px; }
.prose { max-width: 38em; padding: 32px 0; }

footer { margin-top: 56px; padding-top: 18px; padding-bottom: 36px; border-top: 1px solid var(--rule);
  color: var(--pencil); font-size: 15px; }
footer .langs, footer .legal { display: flex; flex-wrap: wrap; gap: 4px 18px; }
footer a { color: var(--pencil); }
.small { font-size: 14px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Page previews for organising a PDF */
.thumbs { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.thumbs li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px;
  border: 1px solid var(--rule); border-radius: 3px; }
.thumb { width: 150px; height: 150px; display: grid; place-items: center; }
.thumb canvas { max-width: 140px; max-height: 140px; box-shadow: 0 0 0 1px var(--rule); background: #fff; transition: transform .15s; }
.thumbs .label { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.thumb-tools { display: flex; gap: 4px; }
.thumb-tools .icon-btn { min-width: 30px; min-height: 36px; padding: 0; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.thumbs li.gone { border-style: dashed; }
.thumbs li.gone .thumb, .thumbs li.gone .label { opacity: .35; }
.thumbs li.gone .label { text-decoration: line-through; }

.text-btn { min-height: 36px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 3px; background: transparent;
  color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.hint { margin: 10px 0 0; color: var(--pencil); font-size: 15px; }
.lang-pick { display: flex; gap: 8px 12px; flex-wrap: wrap; margin: 24px 0 0; }
.lang-pick a { padding: 8px 14px; border: 1px solid var(--rule); border-radius: 3px; background: var(--sheet);
  color: var(--ink); text-decoration: none; font-weight: 700; }
.lang-pick a:hover { border-color: var(--accent); }
.all-tools { display: none; }
footer a { display: inline-block; padding: 8px 0; }

/* Phones: the eight tool links would take three lines; one link to the list instead */
@media (max-width: 640px) {
  .top nav { display: none; }
  .all-tools { display: inline-block; padding: 10px 0; font-weight: 700; }
  .hero { padding-top: 20px; }
  .tool { padding: 14px; }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .thumbs li { padding: 8px 4px; min-width: 0; }
  .thumb-tools { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .thumb-tools .icon-btn { min-width: 34px; min-height: 40px; }
  .thumb { width: 116px; height: 116px; }
  .thumb canvas { max-width: 110px; max-height: 110px; }
}
