/*
 * Librarium Militaris — foundations.
 *
 * Design tokens, reset, base typography and the atoms shared by every region.
 * Region-specific rules live in layout.css (page chrome) and cards.css (the
 * battle report cards). Selector scopes are kept disjoint so the load order
 * Propshaft picks never matters.
 */

:root {
  --grim-900: #0a0a0c;
  --grim-800: #151518;
  --grim-700: #27272a;
  --grim-700-50: rgba(39, 39, 42, 0.5);
  --text: #d4cbb8;
  --accent: #e5a93d;
  --accent-20: rgba(229, 169, 61, 0.2);
  --accent-50: rgba(229, 169, 61, 0.5);
  --accent-90: rgba(229, 169, 61, 0.9);
  --accent-hover: #facc15;
  --danger: #991b1b;

  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Oswald", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-imperial: "Cinzel", ui-serif, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1600px;
  --gutter: 1rem;
}

@media (min-width: 768px) {
  :root { --gutter: 1.5rem; }
}

/* ---------------------------------------------------------------- reset -- */

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--grim-700);
}

* {
  margin: 0;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  min-height: 100vh;
  position: relative;
  /* `clip` rather than `hidden`: it stops sideways overflow without turning the
     body into a scroll container, which would break the sticky control bar. */
  overflow-x: clip;
  background-color: var(--grim-900);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

img, svg, video, canvas {
  display: block;
  vertical-align: middle;
}

img, video {
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  padding: 0;
}

button {
  cursor: pointer;
  text-transform: none;
  -webkit-appearance: button;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background-color: var(--accent);
  color: #000;
}

/* -------------------------------------------------------------- scrollbar -- */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--grim-900);
  border-left: 1px solid var(--grim-700);
}

::-webkit-scrollbar-thumb {
  background: var(--zinc-700);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ------------------------------------------------------------------ atoms -- */

/* Film-grain veil over the whole page. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
}

/* Recessed metal plate used for the masthead, footer and load-more button. */
.panel {
  border: 1px solid var(--grim-700);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

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

.is-hidden {
  display: none !important;
}

/* Custom elements are inline by default. */
turbo-frame {
  display: block;
}

/* Holds the hidden inputs the search box and sort select submit alongside. */
#archive-filters {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@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;
  }
}
