:root {
  --canvas: #0f1110;
  --lift: #171a18;
  --bone: #e8e6e1;
  --muted: #9a968e;
  --accent: #b8f53a;
  --accent-ink: #0f1110;
  --rule: rgba(232, 230, 225, 0.12);
  --warn: #ffb454;
  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --pad: clamp(1rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--bone);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: clip;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
  z-index: 40;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem var(--pad) 1rem;
  border-bottom: 1px solid var(--rule);
  background: radial-gradient(80% 80% at 0% 0%, rgba(184, 245, 58, 0.07), transparent 50%);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: clamp(1.4rem, 5vw, 1.85rem);
  text-transform: lowercase;
}

.tag {
  color: var(--muted);
  max-width: 42ch;
  margin-top: 0.45rem;
  font-size: 0.98rem;
  font-weight: 500;
}

.home {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding-top: 0.35rem;
  white-space: nowrap;
}

.home:hover { color: var(--accent); }

main {
  padding: 1.25rem var(--pad) 2rem;
  max-width: 72rem;
}

.panel {
  margin-bottom: 1.25rem;
}

label, legend, h2 {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 11rem;
  background: var(--lift);
  color: var(--bone);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.9rem 1rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.55;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggles {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 1rem 0 1.1rem;
}

.toggles label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  color: var(--bone);
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

.toggles input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

button {
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.9rem;
  border: 0;
  border-radius: 2px;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
}

button:hover { background: #d4ff6a; }

button.ghost {
  background: transparent;
  color: var(--bone);
  border: 1px solid var(--rule);
}

button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.stats {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 0.25rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.box {
  background: var(--lift);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.9rem 1rem;
  min-height: 12rem;
  max-height: 28rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--bone);
}

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

.hit {
  display: block;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}

.hit:last-child { border-bottom: 0; }

.hit b {
  color: var(--warn);
  font-weight: 500;
}

.kind {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

footer {
  padding: 1rem var(--pad) 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--rule);
}

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

footer a:hover { color: var(--accent); }

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .row button { flex: 1 1 auto; }
  .stats { width: 100%; margin: 0.25rem 0 0; }
}
