/* Shared styling for the plyphon web demo: the landing page and every example page.
   A dark, minimal theme - dark background, light text, a thin progress bar - after `gantz`. */

:root {
  --bg: #1b1b1b;
  --fg: #f0f0f0;
  --muted: #8a8a8a;
  --line: #333;
  --accent: #9ecbff;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background: #2a2a2a;
  padding: 0 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

/* The wordmark - widely letter-spaced, as on the loading screen. */
.title {
  font-size: 1.4rem;
  letter-spacing: 0.45em;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.lede {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Landing page: grouped lists of example links. */
h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
  margin: 2rem 0 0.75rem;
}

ul.examples {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.examples li {
  margin: 0.55rem 0;
}

ul.examples a {
  font-weight: 600;
}

ul.examples .desc {
  color: var(--muted);
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2.5rem;
}

/* Example page: a centred card revealed once the wasm has loaded. */
main.demo {
  text-align: center;
  padding-top: 14vh;
}

main.demo .hint {
  color: var(--muted);
}

main.demo .back {
  display: inline-block;
  margin-top: 2.5rem;
  color: var(--muted);
}

/* Keep the example page's content hidden behind the loading screen until the wasm is ready. */
body.loading main.demo {
  visibility: hidden;
}

/* The loading screen (after `gantz`): a centred wordmark over a thin progress bar. */
#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

#loading-title {
  font-size: 18px;
  letter-spacing: 0.5em;
  margin: 0 0 12px;
}

#loading-track {
  width: 12rem;
  height: 2px;
  background: var(--line);
}

#loading-bar {
  width: 0%;
  height: 100%;
  background: var(--fg);
  transition: width 0.2s ease;
}
