/* Red Hat Mono, the closest open font to SF Mono (Terminal's font in 2019). OFL, see fonts/OFL.txt. */
@font-face {
  font-family: "Red Hat Mono";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/red-hat-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Red Hat Mono";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/red-hat-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #000;
  --ink: #cbc3cb;
  --hover: #fff;
  --dim: #4a464a;
  --faint: #2e2c2e;
}

* { box-sizing: border-box; }

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

body {
  font-family: "Red Hat Mono", Menlo, Consolas, monospace;
  font-weight: 450;
  font-size: clamp(15px, 0.9vw + 9px, 24px);
  line-height: 2;
  letter-spacing: 0.14em;
  -webkit-font-smoothing: antialiased;
  cursor: text;
}

main {
  padding: 30vh clamp(16px, 20vw, 320px) 30vh;
  max-width: 100%;
}

p, .lines div { margin: 0; overflow-wrap: anywhere; }

/* The seed sits three characters in from the "becomes" column, with a blank line under it, as in the terminal. */
.seed {
  position: relative;
  margin-left: 3ch;
  margin-bottom: 2em;
  min-height: 2em;
  text-transform: uppercase;
}
.prompt[hidden] { display: none; }

/* Finished poems stack up; each new one starts after a few blank lines. */
.poem + .poem, .poem + .prompt { margin-top: 6em; }

/* Any word in any poem can be clicked to start a new poem from it. */
.word { cursor: pointer; transition: color 0.2s; }
.word:hover { color: var(--hover); }

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.15em;
  vertical-align: -0.2em;
  background: var(--ink);
  animation: blink 1.06s steps(1) infinite;
}
.cursor[hidden] { display: none; }

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

.seed { transition: opacity 1.2s ease; }
.seed.fading { opacity: 0; }

.hint {
  color: var(--dim);
  margin-left: 1.2em;
  text-transform: lowercase;
}
.hint[hidden] { display: none; }

/* The real input is invisible; what's typed is drawn in #typed. 16px keeps iOS from zooming. */
#input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  font-size: 16px;
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
}

footer {
  position: fixed;
  right: 16px;
  bottom: 12px;
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: var(--dim);
}
footer a { color: inherit; text-decoration: none; }
footer a:hover, footer a:focus-visible { color: var(--ink); }

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