/* Unsus clean page. Tokens follow NO SUS homepage/DESIGN.md: ink and paper themes,
   two-tone headlines, the grey square stop, signal red only for something live (here:
   hidden data found in a file). Tool pages follow the visitor's OS theme. */

@font-face { font-family: Outfit; src: url(fonts/Outfit-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: Outfit; src: url(fonts/Outfit-Bold.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/Inter-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/Inter-Medium.woff) format("woff"); font-weight: 500; font-display: swap; }

:root {
  --bg: #0A0A0A;
  --fg: #F5F5F5;
  --card: #151515;
  --muted: #1C1C1C;
  --muted-fg: #A3A3A3;
  --border: #262626;
  --dim: #808080;
  --stop: #808080;
  --signal: #FF453A;
  /* Borders of things you can press: 3:1 against the page (WCAG 1.4.11). */
  --control-line: #5E5E5E;
  --radius-card: 16px;
  --radius-control: 12px;
  --radius-pill: 999px;
  --gutter: clamp(20px, 5vw, 48px);
  --display: Outfit, ui-sans-serif, system-ui, sans-serif;
  --sans: Inter, ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F5F5F3;
    --fg: #111111;
    --card: #FFFFFF;
    --muted: #EBEBE8;
    --muted-fg: #5C5C5C;
    --border: #DCDCD8;
    --signal: #D71921;
    --control-line: #8C8C8C;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.55 var(--sans);
  font-feature-settings: "calt", "kern";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }

/* The square stop: the wordmark's full stop, also the end of the headline. */
.stop {
  display: inline-block;
  width: 0.21em;
  height: 0.21em;
  margin-left: 0.08em;
  background: var(--stop);
  vertical-align: baseline;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
}
.mark { font: 700 22px/1 var(--display); text-decoration: none; letter-spacing: -0.01em; }
.by { color: var(--muted-fg); font-size: 15px; text-decoration: none; }
.by:hover { color: var(--fg); }

.hero {
  font: 700 clamp(44px, 9vw, 112px)/0.98 var(--display);
  letter-spacing: -0.035em;
  margin: clamp(32px, 9vh, 104px) 0 clamp(32px, 6vh, 64px);
  max-width: 15ch;
  text-wrap: balance;
}
.hero .dim { color: var(--dim); }

/* The drop field is the page's one tool, so it is the hero's second half. */
.drop {
  position: relative;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 18px;
  min-height: 248px;
  padding: clamp(28px, 5vw, 48px);
  border: 1.2px solid var(--control-line);
  border-radius: var(--radius-card);
  background: var(--card);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.drop:hover { border-color: var(--dim); }
.drop.over { border-color: var(--fg); background: var(--muted); }
.drop:has(input:focus-visible) { outline: 2px solid var(--fg); outline-offset: 3px; }
@supports not selector(:has(*)) {
  .drop:focus-within { outline: 2px solid var(--fg); outline-offset: 3px; }
}
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-title { font: 600 clamp(24px, 3.4vw, 34px)/1.15 var(--display); letter-spacing: -0.015em; }
.drop-note { color: var(--muted-fg); font-size: 15px; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1.2px solid transparent;
  font: 500 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.pill-primary { background: var(--fg); color: var(--bg); }
.pill-primary:hover { opacity: 0.88; }
.pill-ghost { background: transparent; color: var(--fg); border-color: var(--control-line); }
.pill-ghost:hover { border-color: var(--dim); }
.pill:disabled { opacity: 0.5; cursor: default; }
.pill-sm { padding: 0 18px; font-size: 15px; }

.formats { color: var(--muted-fg); font-size: 15px; max-width: 64ch; margin: 18px 0 0; }

.results { margin-top: clamp(40px, 7vh, 72px); }
.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
}
.results-sum { margin: 0; font: 600 22px/1.25 var(--display); }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.files { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.file { padding: 22px 0; border-bottom: 1px solid var(--border); }
.file-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.file-name {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 260px;
}
.file-size { margin-left: 8px; color: var(--muted-fg); font-weight: 400; font-size: 15px; white-space: nowrap; }
.file-actions { display: flex; gap: 10px; }
.file-state { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 0; color: var(--muted-fg); }

/* Status square: filled grey = clean copy ready, hollow = left as it is, red = hidden data
   is being taken out right now. */
.sq { flex: none; width: 10px; height: 10px; background: var(--stop); transform: translateY(-1px); }
.file[data-state="asis"] .sq,
.file[data-state="waiting"] .sq { background: transparent; box-shadow: inset 0 0 0 1.5px var(--dim); }
.file[data-state="working"] .sq { background: var(--signal); }
.file[data-state="error"] .sq { background: transparent; box-shadow: inset 0 0 0 1.5px var(--signal); }
.file[data-state="clean"] .state-text { color: var(--fg); }

.found { color: var(--signal); font-variant-numeric: tabular-nums; }

.file-parts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 24px;
  margin: 14px 0 0 20px;
  max-width: 560px;
  font-size: 15px;
}
.file-parts:empty { display: none; }
.file-parts dt { color: var(--muted-fg); }
.file-parts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted-fg); }
.file-notes { list-style: none; margin: 10px 0 0 20px; padding: 0; max-width: 60ch; font-size: 15px; color: var(--muted-fg); }
.file-notes:empty { display: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 64px;
  padding-bottom: 36px;
  color: var(--muted-fg);
  font-size: 14px;
}
.foot p { margin: 0; max-width: 60ch; }
.foot a { text-decoration: none; font: 700 15px/1 var(--display); color: var(--fg); }

@media (max-width: 560px) {
  .file-parts, .file-notes { margin-left: 0; }
  .results-bar { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .drop, .pill { transition: none; }
}
