/* A sibling of wordtsar.myvortexcloud.com: same type, same black bars,
   same blinking cursor. Its own signature: the hero is a terminal on the
   Synology called Castle, in amber phosphor, with the book's title typed at
   the prompt. Below it, the book reads on stone-grey paper.
   Every font is served from this site: nothing loads from anyone else. */

@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-serif-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2"); }

:root {
  /* The terminal: always dark */
  --night: #000000;          /* hero, title and status bars */
  --phosphor: #ffb000;       /* amber monitor phosphor: title, cursor, buttons */
  --phosphor-dim: #a87a2c;   /* the prompt */
  --screen-ink: #e9dfcc;     /* other text on the screen */
  --screen-muted: #9c9488;
  --screen-rule: #2a2723;

  /* The page: stone grey, dark in dark mode */
  --stone: #e8e6e1;
  --ink: #1a1917;
  --muted: #56524b;
  --link: #8a4a00;
  --rule: #c8c4bb;

  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "IBM Plex Serif", Charter, "Iowan Old Style", Georgia, serif;

  --measure: 38rem;
  --wide: 70rem;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) {
  :root {
    --stone: #1c1b19;
    --ink: #e8e4dc;
    --muted: #a59f94;
    --link: #ffb000;
    --rule: #3a3732;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; border-radius: 2px; }
.page :focus-visible { outline-color: var(--link); }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.column { max-width: var(--measure); }

/* Title bar: the terminal window's title */
.titlebar {
  background: var(--night);
  color: var(--screen-ink);
  font-family: var(--mono);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--screen-rule);
}
.titlebar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.6rem;
}
.titlebar .name { color: var(--screen-ink); text-decoration: none; font-weight: 600; }
.titlebar nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.titlebar nav a { color: var(--screen-ink); text-decoration: none; }
.titlebar a:hover { color: var(--phosphor); }

/* Hero: the screen */
.hero {
  background: var(--night);
  color: var(--screen-ink);
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(3.25rem, 2.25rem + 4vw, 5.75rem);
}
.prompt {
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1;
  color: var(--phosphor-dim);
}
h1 { margin: 0; font-family: var(--mono); font-weight: 600; }
/* The title always fits on one line: Plex Mono is 0.6em per character, so
   16 letters plus the cursor need about 10.4em of width. */
.word {
  display: block;
  font-family: var(--mono);
  font-size: min(5.5rem, calc((100vw - 44px) / 10.4));
  line-height: 1.05;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--phosphor);
}
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.9em;
  margin-left: 0.06em;
  vertical-align: -0.08em;
  background: var(--phosphor);
  animation: blink 1.1s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.subtitle {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: clamp(1.25rem, 0.95rem + 1.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--screen-ink);
}
.alt-title {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--screen-muted);
  text-wrap: balance;
}
.byline { margin: 0.6rem 0 0; font-size: 1.125rem; color: var(--screen-ink); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 2.5rem;
}
.button {
  display: inline-block;
  background: var(--phosphor);
  color: var(--night);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--phosphor);
  border-radius: 3px;
}
.button[href]:hover { text-decoration: underline; text-underline-offset: 0.2em; }
/* A store button without an address is a placeholder: give the <a> its
   href and it turns into a real button, and the note disappears. */
.store:not([href]) {
  background: transparent;
  color: var(--screen-muted);
  border-color: var(--screen-rule);
  cursor: default;
}
.store:not([href])::after {
  content: "coming soon";
  display: block;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--screen-muted);
}
.actions .plain {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--screen-ink);
}
.actions .plain:hover { color: var(--phosphor); }

/* The page */
.page { padding-block: 3.5rem 0.5rem; }
.page + .page { padding-top: 2.5rem; }
main > .page:last-child { padding-bottom: 4.5rem; }
h2 {
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.page p { margin: 0 0 1.1rem; text-wrap: pretty; }
.page p:last-child { margin-bottom: 0; }
.lede { font-size: 1.3125rem; line-height: 1.55; }
.page .thesis {
  margin-top: 1.75rem;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.45;
  text-wrap: balance;
}

/* Status bar */
.statusbar { background: var(--night); color: var(--screen-ink); font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; }
.statusbar .wrap { display: grid; gap: 0.5rem 2rem; padding-block: 1rem 1.1rem; }
@media (min-width: 52rem) { .statusbar .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .statusbar .wrap > div + div { text-align: right; } }
.statusbar p { margin: 0; text-wrap: balance; }
.statusbar div { display: grid; align-content: start; gap: 0.25rem; }
.statusbar a { color: var(--screen-ink); }
.statusbar a:hover { color: var(--phosphor); }

@media (max-width: 30rem) {
  body { font-size: 1.0625rem; }
  .lede { font-size: 1.1875rem; }
  .actions .plain { margin-left: 0; flex-basis: 100%; margin-top: 0.25rem; }
  .button { flex: 1 1 auto; text-align: center; }
}
