/*
 * The viewer's chrome — deliberately not the report's.
 *
 * The report renders in lockrot's own teal on paper. This page is slate and ochre, with the
 * document sunk into a stage that has a visible edge, so that "lockrot says this" and "the
 * document you were sent says this" never read as one surface. That separation is a security
 * property, not a style choice: the one thing a viewer cannot escape is that it draws a stranger's
 * text under a domain people trust, and the least it can do is never lend it the house style.
 */

:root {
  color-scheme: light;
  --bg: #EEF0F2;
  --surface: #FFFFFF;
  --surface-2: #F6F7F9;
  --border: #D6DBE0;
  --border-strong: #AEB7C0;
  --ink: #14181C;
  --ink-2: #3D464E;
  --muted: #6A757F;
  --accent: #2F4858;
  --accent-ink: #1B2C38;
  --flag: #8A5A00;
  --flag-soft: #FBF1DC;
  --flag-border: #E3C88A;
  --bad: #9B2C1E;
  --bad-soft: #FBE7E3;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --stage: 0 1px 2px rgba(20, 24, 28, .05), 0 18px 40px -24px rgba(20, 24, 28, .35);
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0E1216;
    --surface: #161B21;
    --surface-2: #1D242B;
    --border: #2A333B;
    --border-strong: #3E4A54;
    --ink: #E7ECF0;
    --ink-2: #C2CBD3;
    --muted: #8B959E;
    --accent: #9FC0D4;
    --accent-ink: #C8DDEB;
    --flag: #E0B45F;
    --flag-soft: #2A2214;
    --flag-border: #4C3D1D;
    --bad: #F0897A;
    --bad-soft: #2C1714;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

code { font-family: var(--mono); font-size: .9em; }

/* ---------- chrome ---------- */

.chrome {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

footer.chrome {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  margin-top: 64px;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px var(--gutter);
}

.mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.wordmark {
  margin: 0;
  font-weight: 650;
  letter-spacing: -.01em;
}

.wordmark span {
  font-weight: 400;
  color: var(--muted);
}

.wordmark a { color: inherit; text-decoration: none; }
.wordmark a:hover { text-decoration: underline; }

.quiet {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.quiet:hover { color: var(--ink); text-decoration: underline; }

.small { margin: 0; font-size: 13px; color: var(--muted); max-width: 70ch; }

/* ---------- the opening screen ---------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.intro { padding-block: clamp(32px, 6vw, 64px); }

h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.lede { margin: 0 0 20px; max-width: 62ch; font-size: 18px; color: var(--ink-2); }

.privacy {
  margin: 0 0 32px;
  max-width: 70ch;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  font-size: 14.5px;
  color: var(--ink-2);
}

.inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.drop, .paste {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.drop {
  border-style: dashed;
  border-color: var(--border-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 4px;
  transition: background-color .15s ease, border-color .15s ease;
}

.drop.over { background: var(--surface-2); border-color: var(--accent); }

.drop-title { margin: 0; font-weight: 600; }
.drop-or { margin: 0; color: var(--muted); font-size: 13px; }
.drop p:last-child { margin: 8px 0 0; }

.paste label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font: 13px/1.5 var(--mono);
}

textarea:focus-visible, input[type="text"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.paste p { margin: 12px 0 0; }

.button {
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.button:hover { background: var(--surface-2); border-color: var(--accent); }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

.button.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

@media (prefers-color-scheme: dark) {
  .button.primary { color: #0E1216; }
}

.problem {
  margin: 20px 0 0;
  max-width: 70ch;
  padding: 12px 14px;
  border: 1px solid var(--bad);
  border-radius: 8px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 14.5px;
}

/* ---------- the question a link raises ---------- */

.ask {
  max-width: 62ch;
  margin-block: clamp(32px, 6vw, 64px);
  padding: 24px;
  border: 1px solid var(--flag-border);
  border-radius: 10px;
  background: var(--flag-soft);
}

.ask h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -.01em; }
.ask p { margin: 0 0 12px; }
.ask-note { color: var(--ink-2); font-size: 14.5px; }
.host { font-family: var(--mono); }

.ask-url {
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.ask p:last-child { margin-bottom: 0; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- the document, and the band that disowns it ---------- */

.report { padding-block: 24px 0; }

.origin {
  border: 1px solid var(--flag-border);
  border-radius: 10px 10px 0 0;
  border-bottom: 0;
  background: var(--flag-soft);
  padding: 16px 20px;
}

.origin-what { margin: 0 0 6px; font-size: 14.5px; color: var(--ink-2); max-width: 80ch; }
.origin-what strong { color: var(--flag); }

.origin-where {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 80ch;
}

.origin-act { margin: 14px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }

.share {
  border: 1px solid var(--flag-border);
  border-top: 1px dashed var(--flag-border);
  border-bottom: 0;
  background: var(--surface-2);
  padding: 14px 20px;
}

.share-warn { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); max-width: 80ch; }

.share-label {
  display: block;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font: 12.5px/1.4 var(--mono);
}

/* The stage has a real edge: what is inside it is not this page speaking. */
.stage {
  border: 1px solid var(--border-strong);
  border-radius: 0 0 10px 10px;
  background: var(--surface);
  box-shadow: var(--stage);
  overflow: hidden;
}

iframe {
  display: block;
  width: 100%;
  height: min(82vh, 1100px);
  min-height: 520px;
  border: 0;
}

@media (max-width: 600px) {
  iframe { height: 78vh; min-height: 420px; }
}

/* ---------- the invitation, after the document and not before it ---------- */

.after {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.after h2 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -.01em;
}

.after p { margin: 0 0 14px; max-width: 72ch; color: var(--ink-2); }

.after-act {
  margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.after-act .button { text-decoration: none; display: inline-block; }
