/* Shared by every page (landing, upload, privacy, 404, sample report): fonts, tokens, base,
   header, footer, buttons, form and prose styles. Landing-only sections live in home.css. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 500 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3f5f2;
  --surface: #ffffff;
  --sunken: #e9ede9;
  --ink: #14201b;
  --muted: #55635b;
  --line: #d5ddd7;
  --accent: #0e5a46;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe4;
  --ok: #1b7349;
  --ok-bg: #dff0e5;
  --warn: #9a5600;
  --warn-bg: #f8ecd4;
  --bad: #ae2a20;
  --bad-bg: #f7e1de;
  --grid: rgba(14, 90, 70, 0.07);
  --shadow: 0 1px 2px rgba(20, 32, 27, 0.06), 0 8px 24px rgba(20, 32, 27, 0.06);

  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --frame: 1160px;
  --measure: 64ch;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1311;
    --surface: #151c19;
    --sunken: #111815;
    --ink: #e5ece7;
    --muted: #9aa8a0;
    --line: #27322d;
    --accent: #63c7a2;
    --accent-ink: #05221a;
    --accent-soft: #173229;
    --ok: #63c98f;
    --ok-bg: #15301f;
    --warn: #e2a64b;
    --warn-bg: #33260f;
    --bad: #ef8b80;
    --bad-bg: #3a1b18;
    --grid: rgba(99, 199, 162, 0.06);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0e1311;
  --surface: #151c19;
  --sunken: #111815;
  --ink: #e5ece7;
  --muted: #9aa8a0;
  --line: #27322d;
  --accent: #63c7a2;
  --accent-ink: #05221a;
  --accent-soft: #173229;
  --ok: #63c98f;
  --ok-bg: #15301f;
  --warn: #e2a64b;
  --warn-bg: #33260f;
  --bad: #ef8b80;
  --bad-bg: #3a1b18;
  --grid: rgba(99, 199, 162, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper);
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-stretch: 85%;
  line-height: 1.08;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

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

.wrap {
  max-width: var(--frame);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 750;
  font-stretch: 90%;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}

.brand svg {
  flex: none;
}

.brand-dot {
  fill: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.nav a.btn,
.nav a.btn:hover {
  color: var(--accent-ink);
}

@media (max-width: 760px) {
  .nav a:not(.btn) {
    display: none;
  }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--small {
  padding: 8px 14px;
  font-size: 0.92rem;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  border-color: var(--muted);
}

.btn--invert {
  background: var(--accent-ink);
  color: var(--accent);
  border-color: var(--accent-ink);
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn:hover {
    transition: none;
    transform: none;
  }
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 28px;
}

.site-footer a {
  color: var(--muted);
}

/* ---------------------------------------------------------------- simple pages (upload, privacy, 404) */

.page {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(48px, 7vw, 88px);
}

.page > * {
  max-width: var(--measure);
}

.page h1 {
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem);
  font-weight: 800;
  font-stretch: 78%;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

.page h2 {
  font-size: 1.4rem;
  font-weight: 750;
  margin: 36px 0 10px;
}

.page p {
  margin: 0 0 14px;
}

.page ul,
.page ol {
  margin: 0 0 14px;
  padding-left: 1.3rem;
}

.page li {
  margin-bottom: 6px;
}

.page li::marker {
  color: var(--muted);
}

.note {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

/* ---------------------------------------------------------------- forms (upload) */

form {
  margin-top: 28px;
}

.field {
  margin-bottom: 22px;
}

label,
legend {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

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

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
  padding: 10px 12px;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

fieldset {
  border: 0;
  margin: 0 0 22px;
  padding: 0;
}

.choice {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 400;
  margin-bottom: 4px;
}

.choice input,
.consent input {
  accent-color: var(--accent);
}

.dropzone {
  border: 1.5px dashed var(--muted);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  background: var(--surface);
}

.dropzone.dragging {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}

.dropzone p {
  margin: 4px 0;
}

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.file-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.file-list .name {
  overflow-wrap: anywhere;
}

.file-list .size {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.file-list progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}

.file-list .remove {
  grid-column: 2;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-weight: 400;
}

.consent input {
  flex: none;
}

form .error {
  color: var(--bad);
  font-size: 0.95rem;
  margin: 6px 0 0;
}

form .error:empty {
  display: none;
}

.form-status {
  margin-top: 16px;
}

.success {
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  background: var(--surface);
  border-radius: 8px;
  padding: 20px 20px 6px;
  margin-top: 28px;
}

.success h2 {
  margin-top: 0;
}

.reference {
  font-family: var(--font-mono);
  font-weight: 500;
}

.turnstile {
  min-height: 65px;
  margin-bottom: 22px;
}
