/* MEETWITH.DOC: WordPerfect 5.1 screen, matching SETH.DOC */
@font-face {
  font-family: "VT323";
  src: url("/static/vt323.woff2") format("woff2");
  font-display: swap;
}

:root {
  --wp-blue: #0000aa;
  --wp-gray: #aaaaaa;
  --wp-white: #ffffff;
  --wp-cyan: #00aaaa;
  --wp-yellow: #ffff55;
  --wp-red: #ff5555;
  --wp-dim: #5555ff;
  --cell: 1.25rem;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--wp-blue);
  color: var(--wp-gray);
  font: 22px/1.25 "VT323", "Lucida Console", "Courier New", monospace;
  -webkit-font-smoothing: none;
}

.screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.bar {
  display: flex;
  justify-content: space-between;
  gap: 1ch;
  padding: 0 1ch;
  white-space: nowrap;
  overflow: hidden;
}
.bar.top { background: var(--wp-gray); color: var(--wp-blue); }
.bar.top a { color: var(--wp-blue); }
.bar.status { color: var(--wp-gray); position: sticky; bottom: 0; background: var(--wp-blue); }
#statusLeft { overflow: hidden; text-overflow: ellipsis; }
.bar.status .keys { white-space: pre; }
.bar.status .keys b { color: var(--wp-yellow); font-weight: normal; }
@media (max-width: 640px) { .bar.status .keys { display: none; } }

/* ---- SETH.DOC boot: C:\> WP MEETWITH.DOC, then the WordPerfect 5.1 box ---- */
#boot, #wpopen, #retrieve { display: none; }
html.boot #boot {
  display: block; position: fixed; inset: 0; z-index: 60; background: #000; color: var(--wp-gray); cursor: pointer;
  padding: max(1.5em, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 2em max(16px, env(safe-area-inset-left, 0px));
}
html.boot, html.boot body, html.retrieve, html.retrieve body { overflow: hidden; }
#boot .in { max-width: 76ch; margin: 0 auto; }
#boot p { margin: 0; }
html.boot.opened #boot { display: none; }
html.boot.opened #wpopen {
  display: flex; position: fixed; inset: 0; z-index: 60; align-items: center; justify-content: center; padding: 16px; cursor: pointer;
}
#wpopen .box {
  background: #fff; color: #000; border: 3px double #000; box-shadow: 1ch .5em 0 rgba(0, 0, 0, .85);
  width: min(50ch, 100%); padding: 1.25em 2ch; text-align: center;
}
#wpopen .v, #wpopen .c, #wpopen .n { margin-bottom: 1.25em; }
#wpopen .c { white-space: pre-line; }
#wpopen .pb {
  display: flex; gap: 3px; width: min(30ch, 100%); height: 1.1em; margin: 0 auto .8em; padding: 3px;
  border: 2px solid; border-color: #808080 #fff #fff #808080; background: #fff; outline: 1px solid #000;
}
#wpopen .pb i { flex: 1 1 0; }
#wpopen .pb i.on { background: var(--wp-blue); }
#wpopen .w { min-height: 1.25em; }
.bc {
  display: inline-block; width: .55em; height: 1em; background: currentColor; vertical-align: -.15em;
  animation: blink 1.06s steps(1) infinite;
}

/* ---- Retrieve: arriving from SETH.DOC, WordPerfect opens the next document ---- */
html.retrieve #retrieve {
  display: flex; align-items: flex-end; position: fixed; inset: 0; z-index: 60; background: var(--wp-blue); color: var(--wp-gray); cursor: pointer;
}
#retrieve .line { padding: 0 1ch; white-space: pre; overflow: hidden; }

main {
  flex: 1;
  width: 100%;
  max-width: 82ch;
  margin: 0 auto;
  padding: 1.5rem 2ch 3rem;
  outline: none;
}

h1 {
  color: var(--wp-white);
  font-size: 2.6rem;
  font-weight: normal;
  line-height: 1;
  margin: 0 0 .5rem;
}
h2 {
  color: var(--wp-white);
  font-size: 1em;
  font-weight: normal;
  margin: 0 0 .25rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
p { margin: 0 0 .75rem; max-width: 70ch; }
.lede { margin-bottom: 1.5rem; }
.note { color: var(--wp-dim); filter: brightness(1.5); }
a { color: var(--wp-white); }

.block { margin-bottom: 1.5rem; }

/* Reverse-video choices: the WordPerfect selection bar */
button, .key, .list button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0 1ch;
  cursor: pointer;
  border-radius: 0;
}
.choices { display: flex; flex-wrap: wrap; gap: 0 2ch; }
.choices button { padding: 0 1ch; }
.choices button[aria-checked="true"],
.list button[aria-selected="true"] {
  background: var(--wp-cyan);
  color: var(--wp-blue);
}
button:hover:not(:disabled), .key:hover { color: var(--wp-white); }
.choices button[aria-checked="true"]:hover,
.list button[aria-selected="true"]:hover { color: var(--wp-blue); }
:focus-visible { outline: 2px solid var(--wp-yellow); outline-offset: 1px; }

.panes {
  display: grid;
  grid-template-columns: 22ch minmax(0, 1fr);
  gap: 0 3ch;
  margin-bottom: 1.5rem;
  border-top: 1px dashed var(--wp-gray);
  border-bottom: 1px dashed var(--wp-gray);
  padding: .75rem 0;
}
.pane { min-width: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li button {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 1ch;
}
.list li button:disabled { color: var(--wp-dim); cursor: default; }
.list .count { opacity: .8; }
.list.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11ch, 1fr));
  gap: 0 1ch;
}
#dayPane .list { max-height: 15.5em; overflow-y: auto; scrollbar-color: var(--wp-gray) var(--wp-blue); }

.picked { color: var(--wp-yellow); }

.field { display: block; margin: 0 0 .75rem; border: 0; padding: 0; }
.field > span, legend { display: block; color: var(--wp-white); padding: 0; }
input, textarea {
  font: inherit;
  color: var(--wp-white);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--wp-gray);
  width: 100%;
  max-width: 48ch;
  padding: 0;
  border-radius: 0;
}
textarea { border: 1px solid var(--wp-gray); padding: .2rem .5ch; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--wp-yellow); }
.radio { display: block; cursor: pointer; }
.radio input { width: auto; accent-color: var(--wp-cyan); margin-right: 1ch; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { margin: 1rem 0; min-height: 0; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem 3ch; margin-top: 1rem; }
.key { color: var(--wp-white); text-decoration: none; padding: 0; display: inline-block; }
kbd {
  font: inherit;
  background: var(--wp-gray);
  color: var(--wp-blue);
  padding: 0 .5ch;
  margin-right: .5ch;
}
.key.ghost { color: var(--wp-gray); }
.key:disabled { opacity: .5; cursor: wait; }

.error { color: var(--wp-yellow); }
.error::before { content: "ERROR: "; color: var(--wp-red); }

/* Blinking WordPerfect cursor, once, on the heading */
h1::after {
  content: "";
  display: inline-block;
  width: .55em;
  height: 1em;
  background: var(--wp-white);
  margin-left: .15em;
  vertical-align: -.15em;
  animation: blink 1.06s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 640px) {
  body { font-size: 21px; }
  main { padding: 1rem 1.5ch 3rem; }
  h1 { font-size: 2.1rem; }
  .panes { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  #dayPane .list {
    max-height: none;
    display: flex;
    overflow-x: auto;
    gap: 0 1ch;
    padding-bottom: .4rem;
  }
  #dayPane .list li button { flex-direction: column; align-items: flex-start; gap: 0; white-space: nowrap; line-height: 1.1; padding: .15rem 1ch; }
  .list.grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  h1::after, .bc { animation: none; }
}

[hidden] { display: none !important; }

.exitline { margin: 2em 0 0; }
.bar.status .exitkey { color: inherit; text-decoration: none; }
.bar.status .exitkey:hover { color: var(--wp-white); }

/* Clip art, received like the figures on sethdallob.com */
figure.gif { display: inline-grid; max-width: 100%; margin: 0 0 1.25em; }
figure.gif canvas { display: block; width: 384px; max-width: 100%; height: auto; aspect-ratio: 8 / 5; image-rendering: pixelated; image-rendering: crisp-edges; background: #000; border: 1px solid var(--wp-dim); }
figure.gif figcaption { font-size: .85em; color: var(--wp-gray); max-width: 384px; margin-top: .25em; }
figure.gif .rx { color: var(--wp-yellow); }
