/* Self-hosted variable fonts — no third party sees a visitor load a page. */
@font-face {
  font-family: 'Cinzel';
  src: url('/fonts/Cinzel.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/CormorantGaramond-VariableFont_wght.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/CormorantGaramond-Italic-VariableFont_wght.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

/* bene vixit — paper terminal.
   privacy = light: warm paper, dark ink. not another green-on-black cave. */

:root {
  --paper: #f3ede2; /* undyed linen, not cream */
  --ink: #2c2822; /* espresso — never black; black is a screen, this is print */
  --ink-body: #4a4438; /* running text sits a step softer than headings */
  --ink-soft: #6b6459;
  --accent: #9a7f52; /* patina, not coin */
  --line: #e2d8c5;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  color: var(--ink-body);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.6;
  /* Oldstyle figures: digits sit on the baseline with ascenders and
     descenders, the way a book sets them — not the way a screen renders them. */
  font-feature-settings: 'onum' 1, 'liga' 1;
}

/* Background on html ONLY: a body background paints OVER negative-z children,
   which would hide the watermark behind solid paper.
   The grain layer is a tiling SVG noise at ~4% — imperceptible consciously,
   but the eye registers "material" instead of a flat hex fill. */
html {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

#terminal, #site-footer, .page {
  position: relative;
  z-index: 1;
}

#terminal {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 6rem;
  min-height: 100%;
  overflow-y: auto;
}

/* The key, always present behind everything — rendered in ink via mask so it
   follows the palette in both light and dark. The custom properties are read
   by dissolve.js so transition particles land exactly on this element. */
:root { --wm-height: 72; --wm-opacity: 0.07; }
.bv-watermark {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--ink);
  opacity: var(--wm-opacity);
  -webkit-mask: url('/art/key.svg') no-repeat center / auto calc(var(--wm-height) * 1%);
  mask: url('/art/key.svg') no-repeat center / auto calc(var(--wm-height) * 1%);
}
/* During a transition the particle copy performs; the real element waits. */
.bv-transit .bv-watermark { visibility: hidden; }


.line { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }

/* The printer's ornament: the key at 18px between hairlines, at the chapter
   head above the epigraph — the clear band before the watermark begins. One
   mark, used with discipline; restraint is the flourish. */
.bv-fleuron {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto 1.75rem;
}
.bv-fleuron::before,
.bv-fleuron::after {
  content: '';
  width: 3rem;
  height: 1px;
  background: var(--line);
}
.bv-fleuron span {
  width: 18px;
  height: 18px;
  background-color: var(--ink);
  opacity: 0.55;
  /* key_mark.svg is the key with strokes weighted for 18px — the watermark's
     hairline strokes vanish at fleuron size. */
  -webkit-mask: url('/art/key_mark.svg') no-repeat center / contain;
  mask: url('/art/key_mark.svg') no-repeat center / contain;
}

/* The motto, given its due */
.quote {
  margin: 0 0 0.75rem;
  font-size: 1.7rem;
  line-height: 1.5;
}
.quote em { font-style: italic; }
.quote .attrib {
  font-size: 0.8rem;
  font-style: normal;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}
.line.keeper { color: var(--ink); }
.line.visitor { color: var(--ink-soft); }
.line.system { color: var(--accent); font-style: italic; }

.copyable { cursor: pointer; text-decoration: underline dotted var(--accent); }
.copyable.copied { color: var(--accent); }

#input-line { white-space: pre-wrap; word-break: break-word; }
/* Not a blinking DOS block — a thin caret with a slow breath, someone
   composing a letter rather than a machine awaiting input. */
.cursor {
  display: inline-block;
  width: 1.5px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.18em;
  background: var(--accent);
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }

#hidden-input {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
}

#turnstile-slot {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
}

a { color: var(--accent); }

/* Ghost footer — barely there until you look for it (ported from renderself). */
#site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 10px 20px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  opacity: 0.25;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
#site-footer:hover { opacity: 0.7; }
#site-footer nav { display: flex; gap: 16px; justify-content: center; }
#site-footer nav a { color: var(--ink); text-decoration: none; }
#site-footer nav a:hover { text-decoration: underline; }
#site-footer p { margin-top: 2px; }

/* Static pages (terms, privacy) */
.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 6rem;
}
/* Inscriptional capitals want air between them — carved, not typed. */
.page h1 { font-family: 'Cinzel', serif; font-size: 1.2rem; margin-bottom: 1.5rem; letter-spacing: 0.14em; }
.page h2 { font-size: 0.95rem; margin: 1.5rem 0 0.5rem; color: var(--accent); }
.page p, .page li { margin-bottom: 0.75rem; color: var(--ink-body); }
.page ul { padding-left: 1.25rem; }
.page .back { display: inline-block; margin-bottom: 2rem; }

@media (prefers-color-scheme: dark) {
  /* Even the dark theme stays warm — dusk, not a basement. */
  :root {
    --paper: #201d17;
    --ink: #ece6da;
    --ink-body: #cfc7b8;
    --ink-soft: #a89f8f;
    --accent: #b9a26e; /* the patina holds at dusk too — no coin */
    --line: #3a342a;
    color-scheme: dark;
  }
}
