/*
 * shared-base.css
 *
 * Shared foundation styles for all play worlds.
 * This file defines global tokens, resets, and utilities that should not
 * encode world-specific layout decisions.
 */

:root {
  /* ===== 1.1 Inks (Semantic Output Channels) ===== */
  --ink-absolute: #000;
  --ink-none: transparent;

  /* Newsprint inks */
  --ink-newsprint-black: var(--ink-absolute);
  --ink-newsprint-gray: #2b2b2b;
  --ink-newsprint-faded: #4a4a4a;
  --ink-red: #c41e3a;

  /* Functional inks */
  --ink-accent: #1a1a1a;
  --ink-warning: #1a1a1a;
  --ink-error: #1a1a1a;
  --ink-success: #1a1a1a;

  /* ===== 1.2 Paper & Surfaces ===== */
  --paper: #f2efe9;
  --paper-muted: #ebe5d6;
  --surface-backdrop: #2a2a2a;

  /* ===== 1.3 Lines, Borders, Hairlines ===== */
  --rule: #2c2c2c;
  --rule-muted: #3a3a3a;
  --rule-faint: #5a5a5a;

  /* ===== 1.4 Shadows & Overlays ===== */
  --shadow-soft: rgb(0 0 0 / 10%);
  --shadow-medium: rgb(43 43 43 / 15%);
  --overlay-paper: rgb(214 209 199 / 20%);

  /* ===== 1.5 Typography Roles ===== */
  --font-masthead: 'IM Fell English SC', serif;
  --font-headline: 'Libre Baskerville', serif;
  --font-body: 'Crimson Text', serif;
  --font-record:
    'Courier Prime', ui-monospace, sfmono-regular, menlo, monaco, consolas, 'Liberation Mono',
    monospace;
  --font-data:
    'Courier Prime', ui-monospace, sfmono-regular, menlo, monaco, consolas, 'Liberation Mono',
    monospace;
  --font-console:
    'Courier Prime', ui-monospace, sfmono-regular, menlo, monaco, consolas, 'Liberation Mono',
    monospace;
  --font-symbols: 'IM Fell English', serif;
  --font-accent:
    'Special Elite', ui-monospace, sfmono-regular, menlo, monaco, consolas, 'Liberation Mono',
    monospace;

  /* ===== 1.6 Font Sizes & Rhythm ===== */
  --text-size: 16px;
  --text-line: 1.35;

  /* ===== 1.7 Spacing Scale ===== */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* ===== 1.8 Radii ===== */
  --radius-1: 2px;
  --radius-2: 4px;

  /* ===== 1.9 Base Defaults ===== */
  color: var(--ink-newsprint-black);
  font-size: var(--text-size);
  line-height: var(--text-line);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}

::selection {
  background: var(--overlay-paper);
}

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

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

.u-nowrap {
  white-space: nowrap;
}

.u-muted {
  color: var(--ink-newsprint-faded);
}

.u-faint {
  color: var(--ink-newsprint-faded);
  opacity: 0.85;
}

.u-rule-top {
  border-top: 1px solid var(--rule);
}

.u-rule-bottom {
  border-bottom: 1px solid var(--rule);
}

.marker,
.ReferenceMark {
  font-family: var(--font-symbols);
  font-weight: 400;
  color: var(--ink-newsprint-black);
  flex-shrink: 0;
  line-height: 1;
}

.name {
  /* intentionally empty */
}

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

::-webkit-scrollbar-track {
  background: var(--paper);
}

::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: var(--radius-1);
}

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

* {
  scrollbar-color: var(--rule) var(--paper);
  scrollbar-width: thin;
}
