/* Wiktrix: black screen, phosphor green, nothing else. */

@font-face {
  font-family: "Share Tech Mono";
  src: url("../fonts/share-tech-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #000;
  --green: #00ff41;      /* the trail */
  --mid: #008f11;        /* the fading trail */
  --dark: #003b00;       /* almost gone */
  --head: #e6ffe6;       /* the falling head glyph */
  --glow: 0 0 6px rgba(0, 255, 65, .55), 0 0 22px rgba(0, 255, 65, .18);
  --text-glow: 0 0 6px rgba(0, 255, 65, .6);
  --mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--black);
  color: var(--green);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); }
a:hover,
a:focus-visible { color: var(--head); text-shadow: var(--text-glow); }

:focus-visible { outline: 1px solid var(--head); outline-offset: 3px; }

/* The rain sits under everything; on the entry page it's only a backdrop. */

#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: .35;
  transition: opacity 1.4s ease;
}

body.entered #rain { opacity: 1; }
body.entered.over-edit #rain { cursor: pointer; }
body.entered.idle #rain { cursor: none; }

/* Repo links, top right */

.repos {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 2;
  display: flex;
  gap: 22px;
}

.repos a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, .8);
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  opacity: .8;
  transition: opacity .2s, color .2s;
}

.repos a:hover,
.repos a:focus-visible { opacity: 1; }

.repos svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: currentColor;
  filter: drop-shadow(0 0 4px rgba(0, 255, 65, .5));
}

.repos small {
  display: block;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mid);
}

/* Entry page */

.gate {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
  padding: 72px 20px 24px;
  overflow-y: auto;
}

.gate,
.repos {
  transition: opacity .8s ease, visibility 0s linear 0s;
}

body.entered .gate,
body.entered .repos {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .8s ease, visibility 0s linear .8s;
}

.panel {
  max-width: 36rem;
  padding: 30px 34px 26px;
  border: 1px solid var(--green);
  background: rgba(0, 0, 0, .86);
  box-shadow: var(--glow), inset 0 0 18px rgba(0, 255, 65, .08);
  font-size: 15px;
  line-height: 1.6;
}

.panel h1 {
  margin: 0 0 18px;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: .55em;
  color: var(--head);
  text-shadow: 0 0 8px var(--green), 0 0 24px rgba(0, 255, 65, .5);
}

.panel p { margin: 0 0 12px; }

.legend {
  margin: 0 0 16px;
  padding: 0 0 0 1.6em;
}

.legend li::marker { color: var(--mid); }

.dim { color: var(--mid); }

.panel .credit {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--dark);
  font-size: 13px;
  color: var(--mid);
}

.enter {
  padding: 16px 36px;
  border: 1px solid var(--green);
  border-radius: 0;
  background: var(--black);
  color: var(--green);
  font: inherit;
  font-size: 18px;
  letter-spacing: .32em;
  cursor: pointer;
  box-shadow: var(--glow);
  text-shadow: var(--text-glow);
  transition: background .2s, color .2s, box-shadow .2s;
}

.enter:hover,
.enter:focus-visible {
  outline: none;
  background: rgba(0, 255, 65, .1);
  color: var(--head);
  box-shadow: 0 0 10px rgba(0, 255, 65, .8), 0 0 36px rgba(0, 255, 65, .35), inset 0 0 12px rgba(0, 255, 65, .25);
}

.enter:active { background: rgba(0, 255, 65, .2); }

.hint {
  margin: -12px 0 0;
  padding: 4px 10px;
  background: var(--black);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--mid);
}

/* Status line in the rain: typed out, with a blinking block cursor */

.signal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 3;
  margin: 0;
  padding: 10px 16px;
  transform: translate(-50%, -50%);
  background: var(--black);
  color: var(--green);
  font-size: clamp(15px, 2vw, 22px);
  letter-spacing: .22em;
  white-space: nowrap;
  text-shadow: var(--text-glow);
}

.signal[hidden] { display: none; }

.signal::after {
  content: "";
  display: inline-block;
  width: .6em;
  height: 1em;
  margin-left: .15em;
  vertical-align: -.12em;
  background: var(--green);
  box-shadow: var(--text-glow);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 720px) {
  .repos { top: 12px; right: 12px; gap: 10px; }
  .repos span { display: none; }
  .repos svg { width: 26px; height: 26px; }
  .panel { padding: 24px 22px 20px; font-size: 14px; }
  .panel h1 { font-size: 26px; letter-spacing: .4em; }
  .enter { padding: 14px 22px; font-size: 15px; letter-spacing: .22em; }
}

@media (prefers-reduced-motion: reduce) {
  .signal::after { animation: none; }
  #rain, .gate, .repos { transition-duration: 0s; }
}
