:root {
  /* Palette — dark, warm, desaturated. Red is an accent only. */
  --c-black: #0a0a0a; /* washed black — matches favicon/manifest theme color */
  --c-charcoal: #1b1917; /* deep charcoal */
  --c-olive: #2a2d21; /* dark olive */
  --c-cream: #cfc4aa; /* dirty cream */
  --c-offwhite: #efe9db; /* off-white */
  --c-red: #8c1d1d; /* muted / blood red — use sparingly */

  --c-bg: var(--c-black);
  --c-surface: var(--c-charcoal);
  --c-text: var(--c-offwhite);
  --c-text-muted: color-mix(in srgb, var(--c-cream) 72%, transparent);
  --c-line: color-mix(in srgb, var(--c-cream) 18%, transparent);

  /* Type */
  --font-display: 'Anton', 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-small: 0.8125rem;
  --fs-h3: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  --fs-h2: clamp(2.25rem, 1.6rem + 3.2vw, 4.5rem);
  --fs-h1: clamp(2.75rem, 1.4rem + 6.5vw, 8rem);

  /* Space */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(3.5rem, 2.25rem + 5vw, 6.5rem);

  --gutter: clamp(1.25rem, 0.8rem + 2vw, 3rem);
  --max-w: 90rem;
  --header-h: 4.5rem;

  /* Motion — restrained */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --t-fast: 160ms;
  --t-slow: 700ms;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

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

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 0.01em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-2); }

:focus-visible {
  outline: 2px solid var(--c-cream);
  outline-offset: 3px;
}

::selection {
  background: var(--c-red);
  color: var(--c-offwhite);
}

/* Film grain overlay — DISABLED while diagnosing scroll lag.
   Re-enable later as a small pre-rendered PNG tile instead of live SVG noise. */

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-6);
}

.eyebrow {
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

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

/* Buttons — simple, high contrast */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1rem 1.75rem;
  border: 1px solid var(--c-offwhite);
  background: var(--c-offwhite);
  color: var(--c-black);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover {
  background: transparent;
  color: var(--c-offwhite);
}
.btn--ghost {
  background: transparent;
  color: var(--c-offwhite);
}
.btn--ghost:hover {
  background: var(--c-offwhite);
  color: var(--c-black);
}

/* Scroll reveal — progressive enhancement.
   Content is only hidden once js/main.js has run (it adds .reveal-on), so it stays visible if the script fails. */
.reveal-on .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(14px);
}
.reveal-on .reveal {
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

/* Anchor targets land below the sticky header */
[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-on .reveal:not(.is-in) { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Serbian: capitals with diacritics (Š Ć Č Ž Đ) collide in tight display type.
   The generator adds .dia only to text that contains them, so English display lines on /sr/ match /en/. */
html[lang="sr"] .dia,
html[lang="sr"] .story__text p {
  line-height: 1.15;
}
