/* === Reset & Layout === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Base palette */
  --bg-base: #0a0a14;
  --bg-surface: #111122;
  --bg-elevated: #1a1a2e;
  --bg-overlay: rgba(10, 10, 20, 0.85);

  --text-primary: #e8e6e3;
  --text-secondary: #9a9a9a;
  --text-muted: #5a5a6a;

  /* Red thread accent */
  --red-thread: #c9302c;
  --red-thread-bright: #ff4444;
  --red-thread-dim: rgba(180, 40, 40, 0.12);

  /* AINA brand blues */
  --aina-ai: #8aa4ff;
  --aina-na: #ced8fa;

  /* Category colors */
  --cat-person: #c9302c;
  --cat-organisation: #d4a017;
  --cat-händelse: #2ea043;
  --cat-plats: #5b8fa8;
  --cat-objekt: #b08d57;
  --cat-fordon: #8b7355;
  --cat-lista: #7a6fa0;
  --cat-övrigt: #666;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 8rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 600ms ease;

  /* Z-index layers */
  --z-graph: 1;
  --z-vignette: 2;
  --z-narrative: 10;
  --z-controls: 20;
  --z-panel: 30;
  --z-narrator: 40;
  --z-overlay: 50;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Lexend', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--aina-ai);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--aina-na);
}

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

/* Screen-reader only (visually hidden, accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Utility classes */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Main layout */
#app {
  position: relative;
  min-height: 100vh;
}

/* Section defaults */
section {
  position: relative;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

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