@font-face {
  font-family: "Martian Mono";
  src: url(/martian-mono.woff2) format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --void: #000;
  --bone: #e9e7e2;
  --ash: #8f8d88;
  --line: #3a3936;
  --tungsten: #ffd9a0;
  /* Where the wordmark sits in the code: full content width, under the header. */
  --lw: calc(100vw - 2 * max(1.25rem, 6vw));
  --lt: 5.5rem;
  /* The flashlight. app.js moves it; without JS it rests on the wordmark. */
  --x: 50vw;
  --y: 40vh;
  --r: 16rem;
  color-scheme: dark;
}

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

body {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--void);
  color: var(--bone);
  font: 400 15px/1.6 "Martian Mono", ui-monospace, Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--tungsten); color: var(--void); }

/* Light falling on the wall, and the layer it reveals. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle var(--r) at var(--x) var(--y), rgb(255 217 160 / .07), transparent 75%);
}
.dark {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--tungsten);
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 15%, transparent 72%);
  mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 15%, transparent 72%);
}
.code {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1.5rem 2rem;
  overflow: hidden;
  column-width: 24rem;
  column-gap: 2.5rem;
  column-fill: auto;
  color: rgb(255 217 160 / .34);
  font: 400 11px/1.85 "Martian Mono", ui-monospace, Menlo, monospace;
  font-stretch: 87.5%;
  white-space: pre;
}
.code .n { color: var(--tungsten); }
.code .f { break-inside: avoid-column; }
/* The code clears a margin around each letter of the wordmark (wordmark-clear.svg is its outline, padded). */
.dark:not(.glow) .code {
  -webkit-mask: linear-gradient(#000 0 0), url(/wordmark-clear.svg) 50% var(--lt) / var(--lw) auto no-repeat;
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0), url(/wordmark-clear.svg) 50% var(--lt) / var(--lw) auto no-repeat;
  mask-composite: exclude;
}
/* The wordmark, in the clearing. It catches a little more of the light than the code does. */
.glow { --r: 30rem; }
.logo { position: absolute; left: 50%; top: var(--lt); width: var(--lw); translate: -50% 0; }

header, main, footer { position: relative; padding-inline: max(1.25rem, 6vw); }

header { padding-top: 1.75rem; }
.mark { display: block; width: 20px; height: 40px; color: var(--tungsten); }

main {
  align-self: end;
  max-width: 48rem;
  padding-bottom: 8vh;
}
h1 {
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.75rem);
  font-weight: 500;
  font-stretch: 112.5%;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.lede {
  max-width: 46ch;
  margin-top: 1rem;
  color: var(--ash);
  font-size: .875rem;
  font-stretch: 87.5%;
}

/* On short screens the copy overlaps the wordmark: each letter clears a black margin, like the code does around the logo. */
h1, .lede { -webkit-text-stroke: .3em var(--void); paint-order: stroke fill; }

form { margin-top: 2.5rem; max-width: 34rem; }
form[hidden] { display: none; }
label {
  display: block;
  color: var(--ash);
  font-size: .75rem;
  font-stretch: 87.5%;
}
.row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; }
input {
  flex: 1 1 15rem;
  min-width: 0;
  padding: .6rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font: inherit;
  caret-color: var(--tungsten);
}
input::placeholder { color: #5f5d59; }
input:focus { outline: none; border-bottom-color: var(--tungsten); box-shadow: 0 1px 0 var(--tungsten); }
button {
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 2px;
  background: var(--tungsten);
  color: var(--void);
  font: inherit;
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
}
button:hover { background: var(--bone); }
button:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 3px; }
button:disabled { opacity: .5; cursor: progress; }

#status { min-height: 1.6em; margin-top: 1rem; max-width: 46ch; color: var(--ash); font-size: .8125rem; }
#status.ok { color: var(--bone); }
#status.err { color: var(--tungsten); }

footer {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 2.5rem;
  padding-block: 1.25rem;
  color: var(--ash);
  font-size: .75rem;
  font-stretch: 87.5%;
}
footer code { font: inherit; color: var(--bone); }

@media (max-width: 40rem) {
  .code { padding: 1rem; font-size: 10.5px; }
  button { flex: 1 1 100%; }
}
