/* Base: papel texturado, tipografia (Garamond para leitura, Mono para interface) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--s0);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

/* grão de papel (SVG turbulence, sem ficheiros externos) */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .4  0 0 0 0 .33  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="dark"] body::before { opacity: .35; mix-blend-mode: screen; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* interface sempre em minúsculas, mono */
.tool, .seg, .pill, .control-label, .section-label, .meta-label, .legend, .filter-chip,
.search input, .search-results, .panel-close, .lb-bar, .about-close, .splash-enter, .splash-about {
  font-family: var(--mono);
  text-transform: lowercase;
  letter-spacing: .01em;
}

/* siglas em versaletes */
abbr.sc, .sc { font-variant-caps: all-small-caps; letter-spacing: .06em; text-decoration: none; }

/* leitura longa (sinopses, texto curatorial) */
.prose { font-family: var(--serif); font-size: 1.2em; line-height: 1.65em; font-weight: 400; hyphens: auto; }
.prose p { margin: 0 0 .8em; }
.prose--small { font-size: 1.05em; }

.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

.loading {
  position: fixed; inset: auto 0 45% 0; margin: 0;
  text-align: center; color: var(--muted); font-size: var(--s-1);
  z-index: 1; transition: opacity .6s;
}
body.is-ready .loading { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
