:root {
  --bg: #0b0b0a;
  --fg: #eeede6;
  --muted: #8a887e;
  --noise: #3b3a35;
  --lit: #8f8c80;
  --mark: #f2e15b;
  --ink: #0b0b0a;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(14px, 3vw, 40px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
}

body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--mark); color: var(--ink); }

/* ---- the wall ---- */

main {
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vh, 32px) var(--gutter) clamp(8px, 1.6vh, 16px);
}

#wall { display: block; }

/* ---- footer ---- */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding: 0 var(--gutter) clamp(12px, 2.4vh, 22px);
  color: var(--muted);
}

footer .left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
}

footer button {
  all: unset;
  cursor: pointer;
}

footer button:focus-visible { outline: 1px solid var(--mark); outline-offset: 4px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  letter-spacing: 0.04em;
}

/* ---- still background ---- */

.toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  transition: color 0.2s;
}

.toggle:hover, .toggle[aria-pressed="true"] { color: var(--fg); }

.switch {
  position: relative;
  width: 22px;
  height: 12px;
  border-radius: 6px;
  border: 1px solid currentColor;
  transition: background 0.2s, border-color 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.25s cubic-bezier(0.65, 0, 0.35, 1), background 0.2s;
}

.toggle[aria-pressed="true"] .switch { background: var(--mark); border-color: var(--mark); }
.toggle[aria-pressed="true"] .switch::after { transform: translateX(10px); background: var(--ink); }

.tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 260px;
  padding: 8px 10px;
  border: 1px solid #2a2926;
  border-radius: 4px;
  background: #141412;
  color: var(--fg);
  line-height: 1.45;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}

.toggle:hover .tip, .toggle:focus-visible .tip { opacity: 1; transform: none; transition-delay: 0.3s; }

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

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mark);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(242 225 91 / 0.55); }
  70%, 100% { box-shadow: 0 0 0 7px rgb(242 225 91 / 0); }
}

/* ---- where this page is in the library ---- */

.loc { line-height: 1.25em; }

.loc button {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.loc button:focus-visible { outline: 1px solid var(--mark); outline-offset: 4px; }
.loc b { font-weight: 400; color: var(--fg); transition: color 0.2s; }
.loc button:hover b, .loc button:focus-visible b { color: var(--mark); }
.loc .open { color: var(--muted); transition: color 0.2s; }
.loc button:hover .open { color: var(--mark); }

.slot {
  display: inline-block;
  height: 1.25em;
  line-height: 1.25em;
  overflow: hidden;
  vertical-align: top;
}

.reel {
  display: flex;
  flex-direction: column;
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.1, 1);
}

.reel.go { transform: translateY(-50%); }

@media (max-width: 640px) {
  .loc button { gap: 2px 12px; }
  footer { font-size: 11px; }
}
