/*
  The terminal site (the homepage): one blue phosphor screen, 80 columns wide, lit flat.
  Everything prints one character at a time and sits on the character grid.
  The VT323 font is embedded in index.html so it's ready on the first paint.
*/
:root {
  --bg: #030a18;
  --fg: #b6deff;
  --bright: #f4faff;
  --dim: #5e97dc;
  --invert-bg: #b6deff;
  --invert-fg: #030a18;
  --glow: 0 0 2px rgba(210, 236, 255, .95), 0 0 12px rgba(110, 178, 255, .7);
  --mono: "VT323", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --size: clamp(19px, 1.1vw + 13px, 27px);
  --lead: 1.2;
  /* the names the animated architecture graphic uses, in this screen's colors */
  --sans: var(--mono);
  --text: var(--fg);
  --muted: var(--dim);
  --line: var(--dim);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--size);
  line-height: var(--lead);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(64px + env(safe-area-inset-top, 0px));
  -webkit-font-smoothing: antialiased;
}

/* Scanlines over everything, evenly */
.scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 30;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .14) 3px, rgba(0, 0, 0, 0) 4px);
}

.screen {
  max-width: 80ch;
  margin: 0 auto;
  padding-bottom: calc(2.5em + env(safe-area-inset-bottom, 0px));
  text-transform: uppercase;
  text-shadow: var(--glow);
  min-width: 0;
}

.ln { display: block; min-height: calc(var(--lead) * 1em); white-space: pre-wrap; overflow-wrap: anywhere; }
.gap { min-height: calc(var(--lead) * 1em); }
.dbl { font-size: 2em; line-height: 1.05; color: var(--bright); letter-spacing: .02em; margin-block: .08em; }
.bright { color: var(--bright); }
.dim { color: var(--dim); }
.hang { padding-left: 2ch; text-indent: -2ch; }

/* Lines you can pick: clicking or tapping types the command for you */
.pick {
  all: unset; display: block; box-sizing: border-box; width: 100%; cursor: pointer; white-space: pre-wrap;
  text-shadow: var(--glow); color: inherit;
}
.pick.dim { color: var(--dim); }
.pick:hover, .pick:focus-visible { background: var(--invert-bg); color: var(--invert-fg); text-shadow: none; }
.pick:hover .dim, .pick:focus-visible .dim { color: var(--invert-fg); }
a.pick { text-decoration: none; }

/* Tables: columns made of space, no rules */
.row { display: flex; flex-wrap: wrap; white-space: pre; }
.row > span { display: block; flex: 0 0 auto; white-space: pre-wrap; }
.c-name { width: 39ch; }
.c-date { width: 23ch; }
.c-label { width: 16ch; }
.c-lday { width: 22ch; }
.c-ltype { width: 10ch; }
.c-lboat { width: 27ch; }
.c-wide { flex: 1 1 0 !important; min-width: 0; }
.c-auto { flex: 1 1 0 !important; min-width: 0; padding-right: 2ch; }
.split { display: flex; justify-content: space-between; gap: 2ch; flex-wrap: wrap; }

/* Exhibits: the pages' own pictures, recolored into the phosphor, drawn in top to bottom like a slow modem */
.exhibit { margin: .35em 0 .2em; cursor: pointer; min-height: 2em; }
.exhibit img { display: block; width: 100%; max-width: 100%; height: auto; }
.exhibit img.loading { animation: load 1.6s steps(32, end) both; }
@keyframes load { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

.viewer {
  position: fixed; inset: 0; z-index: 25; overflow: auto; background: var(--bg);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(56px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
  text-transform: uppercase; text-shadow: var(--glow); color: var(--dim); cursor: pointer;
}
.viewer[hidden] { display: none; }
.viewer img { display: block; width: min(100%, 1500px); max-width: 100%; height: auto; margin: .6em auto 0; }

/* The Log book map: its own black glass and colors, framed in the phosphor */
.logmap { margin: .35em 0 .3em; border: 1px solid var(--dim); box-shadow: 0 0 14px rgba(110, 178, 255, .25); }
.loglegend { display: flex; flex-wrap: wrap; gap: 0 2.5ch; color: var(--dim); }
.loglegend span { display: inline-flex; align-items: center; gap: 1ch; }
.loglegend svg { width: .75em; height: .75em; filter: drop-shadow(0 0 2px rgba(110, 178, 255, .6)); }

/* The animated architecture graphic, in this screen's colors and type */
.screen .ia-build {
  --ia-svc: #0c1b38; --ia-help: #0a2242; --ia-util: #1a2140;
  --ia-chip: #030a18; --ia-chip-line: #5e97dc;
  text-shadow: none; line-height: 1.2;
}
.screen .ia-build .ia-item { font-size: 17px; padding: 1px 6px; }
.screen .ia-build .ia-cat-name { font-size: 20px; font-weight: 400; color: var(--bright); }
.screen .ia-build .ia-sub-name, .screen .ia-build .ia-group-name { font-size: 16px; font-weight: 400; letter-spacing: .04em; }
.screen .ia-build .ia-role strong { font-size: 26px; font-weight: 400; color: var(--bright); }
.screen .ia-build .ia-role span { font-size: 18px; }
.screen .ia-build .ia-cat { border-radius: 0; }
.screen .ia-build .ia-item { border-radius: 0; }
.screen .ia-replay { border-radius: 0; font-size: 16px; text-transform: uppercase; }

.prompt { position: relative; display: flex; white-space: pre; min-height: calc(var(--lead) * 1em); }
.prompt[hidden] { display: none; }
.prompt .typed { white-space: pre-wrap; overflow-wrap: anywhere; }
#cmd {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; margin: 0; font-size: 16px;
  background: transparent; color: transparent; caret-color: transparent;
}
.cursor {
  display: inline-block; width: .55em; height: 1em; margin-left: 1px;
  vertical-align: -.12em; background: var(--fg);
  box-shadow: 0 0 10px rgba(120, 185, 255, .8);
  animation: blink 1.05s steps(1) infinite;
}
.printing .cursor { animation: none; }
@keyframes blink { 50% { opacity: 0; } }


/* The view switch, top right: </> is this site, the monitor opens the same page on the presentation site */
.view-toggle {
  position: fixed; z-index: 35;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; border: 1px solid var(--dim); background: var(--bg);
}
.view-toggle[hidden] { display: none; }
.view-toggle a, .view-toggle span { display: grid; place-items: center; padding: 5px 9px; color: var(--dim); text-decoration: none; }
.view-toggle a:hover { color: var(--fg); }
.view-toggle [aria-current] { background: var(--invert-bg); color: var(--invert-fg); }
.view-toggle a:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.view-toggle svg { display: block; width: 20px; height: 20px; filter: drop-shadow(0 0 3px rgba(110, 178, 255, .6)); }
.view-toggle [aria-current] svg { filter: none; }

@media (max-width: 640px) {
  .c-name { width: 100%; }
  .c-date { width: auto; margin-right: 2ch; color: var(--dim); }
  .row .c-co { color: var(--dim); }
  .row.head { display: none; }
  .c-lday { width: 100%; color: var(--dim); }
  .c-ltype, .c-lboat { width: auto; margin-right: 2ch; }
  .row .c-lboat, .row .c-lboat + .c-co { color: var(--dim); }
}

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