/*
 * Mermera early access. txp labs register (Mermera's brand README): the
 * wordmark set as code in the system mono stack, ink on light, green on
 * dark. Green #39FF14 is a dark-ground color only. System fonts, nothing
 * loaded from anywhere else. Contrast checked to WCAG AA for every pair below.
 */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f5f5f4;
  --ink: #0a0a0a;          /* 19.8:1 on --bg */
  --muted: #595959;        /* 7.0:1 on --bg, 6.4:1 on --surface */
  --line: #8a8a8a;         /* 3.4:1 on --bg: non-text contrast for inputs */
  --accent: #0a0a0a;       /* links and buttons on light: ink */
  --on-accent: #ffffff;
  --focus: #0f766e;        /* 5.5:1 on --bg */
  --error: #b42318;        /* 6.0:1 on --bg */
  --danger: #b42318;
  --on-danger: #ffffff;
  --mono: 'SF Mono', 'Fira Code', Consolas, 'Liberation Mono', monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a0a0a;
    --surface: #161616;
    --ink: #ededed;        /* 16.6:1 on --bg */
    --muted: #a3a3a3;      /* 8.2:1 on --bg, 7.5:1 on --surface */
    --line: #7a7a7a;       /* 4.4:1 on --bg */
    --accent: #39ff14;     /* 14.9:1 on --bg */
    --on-accent: #0a0a0a;  /* near-black on green, never white */
    --focus: #39ff14;
    --error: #ff8a80;      /* 8.6:1 on --bg */
    --danger: #ff8a80;
    --on-danger: #0a0a0a;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 40rem; padding-top: 2rem; padding-bottom: 3rem; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--bg);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: 1rem; }

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.08em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
@media (prefers-color-scheme: dark) { .wordmark { color: #39ff14; } }

.badge {
  font-family: var(--mono);
  font-size: 0.875rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.125rem 0.75rem;
  color: var(--muted);
}

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1rem; letter-spacing: -0.02em; }
h2 { font-size: 1.625rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 0 0 0.25rem; }

section { padding: 2.5rem 0; border-bottom: 1px solid var(--surface); }
section:last-child { border-bottom: 0; }

.hero { padding-top: 3.5rem; }
.lede { font-size: 1.25rem; max-width: 46rem; }

.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .features { grid-template-columns: repeat(3, 1fr); } }
.features li { background: var(--surface); padding: 1.25rem; border-left: 4px solid var(--ink); }
.features p { margin: 0; color: var(--ink); }

.scanner p, .signup > p { max-width: 46rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { text-decoration: underline; }
.button[disabled] { cursor: progress; opacity: 0.8; }
.button.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }

form { max-width: 40rem; }
.field { margin: 0 0 1.25rem; }
.grid { display: grid; gap: 0 1rem; }
@media (min-width: 40rem) { .grid { grid-template-columns: 1fr 1fr; } }

label, legend { display: block; font-weight: 600; margin-bottom: 0.25rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.req { font-weight: 400; color: var(--muted); }

input[type='text'], input[type='email'], textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
textarea { resize: vertical; }
input[aria-invalid='true'], textarea[aria-invalid='true'] { border: 2px solid var(--error); }

.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}
.check input { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--ink); }
@media (prefers-color-scheme: dark) { .check input { accent-color: #39ff14; } }
.consent { align-items: flex-start; padding-top: 0.625rem; }
.consent input { margin-top: 0.2rem; }

.hint, .small { color: var(--muted); font-size: 0.9375rem; margin: 0.25rem 0 0; }
.small { margin: 0 0 1rem; }
.error { color: var(--error); font-weight: 600; margin: 0.25rem 0 0; }
.error::before { content: 'Error: '; }

.status { min-height: 1.6em; margin-top: 1rem; font-weight: 600; }
.status.is-error { color: var(--error); }

/* The honeypot: off-screen, not display:none (some bots skip hidden fields). */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.privacy ul { padding-left: 1.25rem; max-width: 46rem; }
.privacy li { margin-bottom: 0.5rem; }

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

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
