/* site.css — shared tokens + base chrome for the midnight library.
   The room is nearly black; the only bright thing on screen is paper. */

:root {
  --bg: #080606;
  --panel: #120e0a;
  --wood: #241710;
  --wood-2: #150e08;
  --ink: #efeae3;
  --dim: #8f8a83;
  --paper: #f3ecdf;
  --paper-2: #eadfc9;
  --page-ink: #241c12;
  --rust: #d1543a;
  --gold: #d9a13b;
  --gilt: #c8a04b;

  --serif-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --serif-text: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* canvas textures installed at runtime by js/textures.js; solid fallbacks */
  --wood-url: none;
  --paper-url: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(200, 160, 75, 0.35); color: var(--ink); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------------------------------------------------------------- header */
.site-head {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: clamp(20px, 4.5vh, 44px) 20px 8px;
}

.site-head .brand {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
}

.site-head .brand a { text-decoration: none; }

.site-head .tagline {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin: 10px 0 0;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--dim);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: rgba(200, 160, 75, 0.4);
}

/* ------------------------------------------------------------- footer */
.site-foot {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 44px 20px 34px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: #5d5850;
}

.site-foot a { color: #7d766c; text-decoration: none; }
.site-foot a:hover { color: var(--gold); }
.site-foot .sep { margin: 0 10px; color: #3a352f; }

/* ------------------------------------------------------------- buttons */
.btn-gold {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #241505;
  background: linear-gradient(180deg, #e2b45a, #c8a04b 55%, #a97f31);
  border: 1px solid #8a6423;
  border-radius: 3px;
  padding: 13px 26px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 235, 190, 0.4) inset, 0 6px 18px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 235, 190, 0.5) inset, 0 10px 24px rgba(0, 0, 0, 0.6);
}

.btn-ghost {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  background: transparent;
  border: 1px solid #3a3029;
  border-radius: 3px;
  padding: 12px 22px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
}

.btn-ghost:hover { color: var(--gold); border-color: #6b5636; }

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gilt);
}

/* ------------------------------------------------------------- misc */
.noscript-note {
  max-width: 520px;
  margin: 60px auto;
  padding: 24px;
  border: 1px solid #3a3029;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  text-align: center;
}

.error-card {
  max-width: 460px;
  margin: 18vh auto 0;
  background: var(--paper);
  color: var(--page-ink);
  padding: 42px 40px;
  border-radius: 2px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
  font-family: var(--serif-text);
}

.error-card h2 { font-family: var(--serif-display); margin: 0 0 10px; font-weight: 600; }
.error-card a { color: #6b4a17; }

/* Reduced motion: kill transitions/animations everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
