/* Cool office-paper page; the one loud element is the highlighter on the pasted text. */
:root {
  --paper: #f6f8fa;
  --sheet: #ffffff;
  --ink: #18263a;
  --muted: #4d5b6d;
  --rule: #d5dce4;
  --marker: #ffe24a;
  --marker-ink: #18263a;
  --high: #b3122a;
  --medium: #9a4a00;
  --low: #3d5a80;
  --none: #1d6b5c;
  --focus: #2457c5;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131a24; --sheet: #1a2330; --ink: #e6ebf1; --muted: #a5b1c0; --rule: #2e3a4a;
    --marker: #6b5a00; --marker-ink: #fff6c2;
    --high: #ff7a8a; --medium: #ffb35c; --low: #9cb8e0; --none: #6fd3bd; --focus: #8fb2ff;
  }
}
:root[data-theme="dark"] {
  --paper: #131a24; --sheet: #1a2330; --ink: #e6ebf1; --muted: #a5b1c0; --rule: #2e3a4a;
  --marker: #6b5a00; --marker-ink: #fff6c2;
  --high: #ff7a8a; --medium: #ffb35c; --low: #9cb8e0; --none: #6fd3bd; --focus: #8fb2ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
main { max-width: 44rem; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.brand { margin: 0; display: flex; align-items: center; gap: .55rem; font: 400 1.75rem/1 var(--display); }
.mark { width: 28px; height: 28px; flex: none; }
.langs { display: flex; gap: .4rem; }
.note { color: var(--muted); font-size: .9rem; max-width: 36rem; margin: -1rem 0 1.5rem; }
.lang { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font: inherit; font-weight: 600; background: none; color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: .35rem .7rem; min-height: 44px; min-width: 44px; cursor: pointer; }

h1 { font-family: var(--display); font-size: clamp(2.5rem, 9vw, 3.75rem); line-height: 1.02; letter-spacing: -0.01em; font-weight: 400; margin: 0 0 .75rem; text-wrap: balance; }
.lede { color: var(--muted); max-width: 36rem; margin: 0 0 2rem; }
h2 { font: 400 1.875rem/1.1 var(--display); margin: 0 0 .75rem; }

.check { margin-bottom: 2.5rem; }
.label { display: block; font-weight: 600; margin-bottom: .4rem; }
textarea {
  width: 100%; min-height: 12rem; resize: vertical; padding: .9rem 1rem;
  font: 1.0625rem/1.6 var(--serif); color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 8px;
}
textarea[aria-invalid] { border-color: var(--high); }
.err { color: var(--high); font-weight: 600; margin: .4rem 0 0; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.primary:hover { background: var(--focus); }
.link:hover, a:hover { text-decoration-thickness: 2px; }
.lang:hover { border-color: var(--ink); }
.lang[aria-current="true"] { background: var(--ink); color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: .9rem; }
.primary { font: inherit; font-weight: 600; color: var(--sheet); background: var(--ink); border: 0; border-radius: 8px; padding: .7rem 1.6rem; min-height: 44px; cursor: pointer; }
.primary:active { transform: translateY(1px); }
.examples { color: var(--muted); font-size: .95rem; display: inline-flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.link { font: inherit; color: var(--ink); background: none; border: 0; padding: .4rem 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.result { margin-bottom: 3rem; scroll-margin-top: 1rem; }
.result:focus { outline: none; }
.verdict { font: 400 clamp(3rem, 12vw, 5rem)/1 var(--display); letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.result[data-level="high"] .verdict { color: var(--high); }
.result[data-level="medium"] .verdict { color: var(--medium); }
.result[data-level="low"] .verdict { color: var(--low); }
.result[data-level="none"] .verdict { color: var(--none); }
.result[data-level="unsupported"] .verdict { color: var(--muted); }
.verdict-note { margin: .6rem 0 1.5rem; max-width: 36rem; }

.marked {
  font: 1.0625rem/1.75 var(--serif); background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px;
  padding: 1rem 1.1rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 1.5rem;
}
.marked mark {
  color: var(--marker-ink); padding: .05em .1em; border-radius: .15em;
  background: linear-gradient(100deg, var(--marker), var(--marker)) no-repeat 0 0 / 100% 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.ref { font: 700 .7rem/1 var(--sans); color: var(--muted); margin: 0 .1em 0 .05em; }

.findings { list-style: none; counter-reset: f; margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.findings li { counter-increment: f; display: grid; gap: .3rem 1.5rem; padding: 1rem 0; border-top: 1px solid var(--rule); }
.findings h3 { font-size: 1.05rem; margin: 0; }
.findings h3::before { content: counter(f) ". "; color: var(--muted); }
.findings li.strong h3 { color: var(--high); }
.findings p { margin: 0; }
.findings .src { font-size: .875rem; color: var(--muted); }
@media (min-width: 42rem) {
  .findings li { grid-template-columns: 11rem 1fr 11rem; }
  .findings .src { align-self: start; }
}

.todo, .checklist { border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-bottom: 2rem; }
.todo ul { padding-left: 1.2rem; margin: 0; }
.todo li { margin-bottom: .6rem; }
.boxes { list-style: none; padding: 0; margin: 0; }
.boxes li { margin-bottom: .35rem; }
.boxes label { display: flex; gap: .65rem; align-items: flex-start; min-height: 44px; padding: .4rem 0; cursor: pointer; }
.boxes input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; flex: none; accent-color: var(--none); }

.fine { border-top: 1px solid var(--rule); padding-top: 1.25rem; color: var(--muted); font-size: .9rem; }

/* The single motion moment: the highlighter sweeps across each mark once when a result appears. */
@media (prefers-reduced-motion: no-preference) {
  .marked mark { animation: sweep .45s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes sweep { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
}
