/* Self-hosted fonts: the exact Google Fonts files (Anton v27, Inter v20 variable), SIL Open Font License,
   licenses in /fonts. latin-ext covers Serbian č ć š ž đ. File names carry the version, so a font update
   gets a new URL (the /fonts folder is cached for a year). */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/anton-v27-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/anton-v27-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-v20-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-v20-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

/* <picture> only chooses the file (AVIF or JPEG, by screen size); the <img> inside is laid out as if it were
   the direct child, so existing image rules keep working through `> picture > img`. */
picture {
  display: contents;
}
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);
}

/* An eyebrow used as a section heading (h2) keeps the eyebrow look, not the display-heading style */
h2.eyebrow {
  margin: 0 0 var(--space-2);
  font-family: var(--font-body);
  line-height: inherit;
}
.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;
}
