/* Amber CRT theme shared by the shell, the digit pages and the plain
   fallback pages. No webfonts: the monospace stack below resolves to fonts
   already installed on the visitor's device, so the site requests nothing
   from anywhere but this host. */

:root {
  --amber: #ffb000;
  --amber-bright: #ffd27a;
  --amber-dim: #a8760a;
  --bg: #0b0700;
  --bg-raised: #16100a;
  --scanline: rgba(0, 0, 0, 0.28);
  --mono: ui-monospace, "DejaVu Sans Mono", "Liberation Mono", Menlo, Consolas,
    monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
  /* Room for the fixed footer on every page. */
  padding-bottom: 3.5rem;
}

a {
  color: var(--amber-bright);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus {
  background: var(--amber);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  color: var(--amber-bright);
  line-height: 1.25;
  margin: 1.6em 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: 1.4rem;
  margin-top: 0;
}

h2 {
  font-size: 1.1rem;
}

h3 {
  font-size: 1rem;
}

p,
ul,
ol,
dl {
  margin: 0.7em 0;
}

ul,
ol {
  padding-left: 1.4em;
}

hr {
  border: 0;
  border-top: 1px solid var(--amber-dim);
  margin: 1.6em 0;
}

code,
pre {
  font-family: var(--mono);
}

/* ---- layout ------------------------------------------------------- */

/* Keeps a real heading in the document without breaking the terminal look. */
.visually-hidden {
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.page {
  margin: 0 auto;
  max-width: 46rem;
  padding: 1.5rem 1.25rem 2rem;
}

.lede {
  color: var(--amber-bright);
}

.placeholder {
  background: var(--bg-raised);
  border: 1px dashed var(--amber-dim);
  color: var(--amber-dim);
  padding: 0 0.25em;
}

.langswitch {
  color: var(--amber-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ---- fixed footer, on every page ---------------------------------- */

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--amber-dim);
  bottom: 0;
  color: var(--amber-dim);
  font-size: 0.8rem;
  left: 0;
  padding: 0.5rem 0.9rem;
  position: fixed;
  right: 0;
  text-align: center;
  z-index: 20;
}

.site-footer a {
  color: var(--amber);
}

.site-footer .sep {
  padding: 0 0.4em;
}

/* ---- terminal ----------------------------------------------------- */

.screen {
  margin: 0 auto;
  max-width: 60rem;
  padding: 1rem 0.75rem 0;
}

#terminal {
  background: var(--bg);
  border: 1px solid var(--amber-dim);
  min-height: 60vh;
  padding: 0.5rem;
  position: relative;
}

/* Scanlines sit above the terminal without stealing clicks or focus. */
#terminal::after {
  background: repeating-linear-gradient(
    to bottom,
    var(--scanline) 0,
    var(--scanline) 1px,
    transparent 1px,
    transparent 3px
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.xterm {
  padding: 0.25rem;
}

/* Tappable command menu: the on-screen keyboard is not the only way in. */
.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem auto 0;
  max-width: 60rem;
  padding: 0 0.75rem;
}

.menu button {
  background: var(--bg-raised);
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
}

.menu button:hover,
.menu button:focus-visible {
  background: var(--amber);
  color: var(--bg);
}

.menu .hint {
  color: var(--amber-dim);
  font-size: 0.8rem;
  width: 100%;
}

/* ---- digit pages (/pi/, /e/) -------------------------------------- */

.counter {
  color: var(--amber-dim);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.digits {
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  line-height: 1.7;
  overflow-wrap: anywhere;
  padding: 0.9rem;
  white-space: pre-wrap;
}

.digits .mark {
  color: var(--amber-bright);
}

#sentinel {
  height: 1px;
}

.status {
  color: var(--amber-dim);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

@media print {
  body,
  html {
    background: #fff;
    color: #000;
  }
  a,
  h1,
  h2,
  h3 {
    color: #000;
  }
  .site-footer {
    position: static;
  }
  #terminal::after {
    display: none;
  }
}
