/* =========================
   The home page of zetaSoft, in the terminal style of rs-gen: the same tokens, light "paper"
   and dark "slate", chosen in the bar or following the system (theme-init.js, site.js)
========================= */
:root {
  color-scheme: light;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --page: #f4efe4;
  --surface: #fffdf8;
  --text: #1f2328;
  --muted: #5b5f66;
  --card-border: #e2d9c6;
  --shadow: rgba(60, 40, 0, 0.08);
  --terminal: #fbf8f1;
  --terminal-user: #0d6b63;
  --terminal-path: #6d28d9;
  --link: #1d4ed8;
  --focus: #1d4ed8;
  /* The blue of the logo, on the edge of the window only: too light for a text on paper */
  --brand: #00a4ff;
}

/* Dark "slate": chosen in the bar, or the one of the system when nothing is chosen. The same
   tokens twice: CSS has no way to name a block */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0e15;
  --surface: #11151f;
  --text: #e6edf3;
  --muted: #959ea8;
  --card-border: #2a3142;
  --shadow: rgba(0, 0, 0, 0.4);
  --terminal: #07090e;
  --terminal-user: #2dd4bf;
  --terminal-path: #a78bfa;
  --link: #60a5fa;
  --focus: #58a6ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b0e15;
    --surface: #11151f;
    --text: #e6edf3;
    --muted: #959ea8;
    --card-border: #2a3142;
    --shadow: rgba(0, 0, 0, 0.4);
    --terminal: #07090e;
    --terminal-user: #2dd4bf;
    --terminal-path: #a78bfa;
    --link: #60a5fa;
    --focus: #58a6ff;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
}

/* The bar on top, as the shell of rs-gen */
.bar {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--card-border);
  background: var(--surface);
  font-weight: 700;
}

.bar img {
  border-radius: 6px;
}

/* The language and the theme, at the right of the bar, as in rs-gen; 44 px high on a phone */
.bar-language {
  margin-left: auto;
}

.bar-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}

.bar-button:hover {
  border-color: var(--card-border);
}

.bar-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.bar-button[hidden] {
  display: none;
}

/* The window: the terminal of the page */
.window {
  width: min(640px, calc(100% - 32px));
  margin: 12vh 16px 32px;
  padding: 24px;
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--brand);
  border-radius: 12px;
  background: var(--terminal);
  box-shadow: 0 20px 40px var(--shadow);
}

.line {
  margin: 0;
  color: var(--muted);
}

.line + * {
  margin-top: 4px;
}

.prompt {
  color: var(--terminal-user);
  font-weight: 700;
}

.path {
  color: var(--terminal-path);
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
}

.answer {
  margin: 4px 0 24px;
}

/* Where to go next, one line each; the target is 44 px high */
.links {
  margin: 4px 0 24px;
  padding: 0;
  list-style: none;
}

.links li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 16px;
}

.links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.links a:hover {
  text-decoration: underline;
}

.links a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.what {
  color: var(--muted);
}

/* The last line: the prompt, then the commands typed, as in rs-gen; the target is 32 px high */
.command-line {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.command-line input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
  caret-color: var(--brand);
}

.command-line input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* A command the page does not know */
.not-found {
  color: var(--muted);
}

/* The help: each command, then what it does */
.help strong {
  min-width: 6em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .window {
    margin-top: 24px;
    padding: 16px;
  }

  /* What each link is, under it rather than beside it: the same for every line */
  .links li {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 8px;
  }

  .links a {
    min-height: 32px;
  }
}

/* A touch screen: the field of the commands at 16 px, or iOS zooms on it as it takes the focus and
   the page slides under the finger; the whole window takes the size, so that the prompt and the
   lines stay alike */
@media (pointer: coarse) {
  .window {
    font-size: 16px;
  }
}
