/* ── Custom font (remove this block to revert to Latin Modern Roman) ── */
@font-face {
  font-family: "Berkeley Mono";
  src: url("/fonts/BerkeleyMonoTrial-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

#wrapper {
  font-family: "Berkeley Mono", "Latin Modern Roman", "Times New Roman", serif !important;
}

#wrapper code, #wrapper pre, #wrapper .highlight {
  font-family: "Berkeley Mono", "Latin Modern Mono", Courier, monospace !important;
}
/* ── End custom font ─────────────────────────────────────────────────── */

/* ── Page background (behind the card) ──────────────────────────────── */
html {
  min-height: 100%;
  background-color: #c0aa8b; /* darker Gruvbox-inspired tan */
}

body {
  background-color: #c0aa8b;
  min-height: 100vh;
}

body.darkmode {
  background-color: #282828; /* match card — no black bars in dark mode */
}

/* ── ASCII braille background layer ─────────────────────────────────── */
#ascii-bg {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: pre;
  font-family: "Courier New", Courier, monospace;
  /* 236 chars wide: size so full width ≈ viewport width.
     Each monospace ch ≈ 0.6 em, so 236 × 0.6 em = viewport.
     font-size ≈ 100vw / (236 × 0.6) ≈ 0.71vw                       */
  font-size: clamp(0.3rem, 0.65vw, 0.9rem);
  line-height: 1.15;
  padding-top: 20ch;
  color: #907f68;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

body.darkmode #ascii-bg {
  color: #a8957d;
  opacity: 0.12;
}

/* ── Content card ────────────────────────────────────────────────────── */
#wrapper {
  position: relative;
  z-index: 1;
  background-color: var(--bg);
  border-radius: 0.75rem;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.22);
  max-width: 860px;
  margin: 2rem auto;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

/* Dark mode: no shadow contrast; use a faint outline ring instead */
body.darkmode #wrapper {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ── Dark mode toggle: re-anchor to card edge ────────────────────────── */
.dark-mode-toggle {
  right: 1.5rem;
}

/* ── Mobile: collapse card to full-bleed ─────────────────────────────── */
@media screen and (max-width: 768px) {
  html,
  body {
    background-color: var(--bg);
  }

  #wrapper {
    border-radius: 0;
    margin: 0;
    padding-left: 1rem;
    padding-right: 1rem;
    box-shadow: none;
  }

  #ascii-bg {
    display: none;
  }
}
