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

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #071708;
  --fg: #b7e8bf;
  --muted: #5a8a64;
  --dim: #2a4a32;
  --line: #1c3022;
  --ok: #9ae89a;
  --err: #e8a0a0;
  --glow: rgba(134, 232, 191, 0.18);
  font-family: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "Menlo", "Consolas", "Courier New", monospace;
  font-variant-ligatures: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
}

body {
  min-height: 100vh;
}

::selection {
  background: #1e4a2c;
  color: #e8ffe9;
}

#web {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.14) 2px,
    rgba(0, 0, 0, 0.14) 3px
  );
  opacity: 0.18;
}

main {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
}

.spider-wrap {
  width: min(11rem, 42vw);
  margin: 0.5rem 0 1.25rem;
  filter: drop-shadow(0 0 18px var(--glow));
}

#spider {
  display: block;
  width: 100%;
  height: auto;
}

#spider .sclera {
  fill: #f4fff6;
}

#spider .pupil {
  fill: #050705;
}

#spider .mouth {
  fill: none;
  stroke: #f4fff6;
  stroke-width: 2;
  stroke-linecap: round;
}

header {
  width: 100%;
  margin-bottom: 1.25rem;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px var(--glow);
}

.cursor {
  display: inline-block;
  width: 0.65ch;
  height: 1.05em;
  margin-left: 0.15ch;
  background: var(--fg);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

.role,
.copy,
.mail h2,
label span,
.captcha-preview > span,
.actions > span {
  color: var(--muted);
}

.role {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.copy {
  width: 100%;
  margin: 0 0 2.25rem;
  line-height: 1.7;
}

.mail {
  width: 100%;
}

.mail h2 {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  font-weight: 400;
}

.mail h2::before {
  content: "$ ";
  color: var(--dim);
}

form {
  display: grid;
  gap: 0.7rem;
}

label,
.captcha-preview,
.captcha-field,
.actions {
  display: grid;
  grid-template-columns: 12ch 1fr;
  gap: 0.75rem;
  align-items: center;
}

label.msg {
  align-items: start;
}

label span,
.captcha-preview > span,
.actions > span {
  padding-top: 0;
  font-size: 0.9rem;
}

label > span:first-child:not(:empty)::before {
  content: "$ ";
  color: var(--dim);
}

.captcha-input {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}

.captcha-input input {
  flex: 1;
  width: auto;
}

input,
textarea,
button {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--dim);
  border-radius: 0;
  padding: 0.4rem 0;
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 5.5rem;
  border: 1px solid var(--dim);
  padding: 0.45rem 0.5rem;
  line-height: 1.5;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

.captcha-preview {
  align-items: start;
}

#captcha-img {
  display: block;
  width: min(280px, 100%);
  height: auto;
  border: 1px solid var(--dim);
  background: #050805;
  image-rendering: auto;
}

button {
  cursor: pointer;
  width: auto;
  border-bottom-color: var(--fg);
  padding: 0.35rem 0;
  color: var(--fg);
}

button:hover {
  text-shadow: 0 0 8px var(--glow);
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

#captcha-again {
  border-bottom-color: var(--muted);
  color: var(--muted);
  align-self: flex-end;
}

#status {
  min-height: 1.4em;
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

#status.ok {
  color: var(--ok);
}

#status.err {
  color: var(--err);
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 520px) {
  main {
    padding-top: 2rem;
  }

  label,
  .captcha-preview,
  .captcha-field,
  .actions {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  label span,
  .captcha-preview > span,
  .actions > span {
    padding-top: 0;
  }

  label span:empty,
  .captcha-preview > span:empty,
  .actions > span:empty {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .scan {
    animation: none;
  }

  .scan {
    opacity: 0.12;
  }
}
