/* assets/base.css
   Purpose: zmienne, reset, typografia — fundament wizualny webkrasnik.pl
   NOT for: układ sekcji (→ site.css), zachowanie skanera (→ scan.js) */

:root {
  /* Ciepła czerń zamiast czystej — czysta #000 na ekranie wygląda jak dziura.
     Odcień w stronę brązu daje wrażenie druku, nie interfejsu. */
  --ink:        #17140f;
  --ink-soft:   #3a342b;
  --ink-faint:  #6b6255;

  --paper:      #f6f2ea;
  --paper-warm: #efe9dd;
  --paper-pure: #fbf9f5;

  --amber:      #b8620a;
  --amber-lit:  #e08b1e;
  --amber-wash: rgba(184, 98, 10, .09);

  --alarm:      #a32a1f;
  --ok:         #2f6b3d;

  --rule:       rgba(23, 20, 15, .14);
  --rule-hard:  rgba(23, 20, 15, .28);

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans:  'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Skala oparta na proporcji, nie na okrągłych liczbach — okrągłe wyglądają
     jak wybrane przez maszynę. */
  --t-hero: clamp(2.65rem, 1.5rem + 5.1vw, 5.5rem);
  --t-h2:   clamp(1.8rem, 1.2rem + 2.1vw, 3.1rem);
  --t-h3:   clamp(1.18rem, 1rem + .6vw, 1.5rem);
  --t-body: clamp(1.02rem, .97rem + .22vw, 1.14rem);
  --t-fine: .845rem;

  --gut:    clamp(1.35rem, 4.5vw, 5.5rem);
  --band:   clamp(4rem, 3rem + 5.5vw, 9rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.62;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
}

/* Ziarno papieru. Inline SVG — zero dodatkowych zapytań, ~700 B.
   WHY: gładkie tło to najczęstszy sygnał „wygenerowane szablonem”. */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.022em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--t-hero); font-weight: 700; letter-spacing: -.035em; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.2; letter-spacing: -.012em; }

p { margin: 0 0 1.05em; max-width: 62ch; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-color: var(--amber); }

strong { font-weight: 600; }

/* Liczby ZAWSZE monospace i tabularne — inaczej kolumna cyfr się rozjeżdża
   i przestaje wyglądać na pomiar. */
.num, td.num, .tick {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.lead { font-size: clamp(1.1rem, 1rem + .55vw, 1.42rem); line-height: 1.5; color: var(--ink-soft); }

/* Notatka na marginesie — jak dopisek ołówkiem w zeszycie. */
.margin-note {
  font-family: var(--mono);
  font-size: var(--t-fine);
  line-height: 1.5;
  color: var(--ink-faint);
  border-left: 2px solid var(--amber);
  padding-left: .85rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .765rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1rem;
  display: flex; align-items: center; gap: .7rem;
}
.eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--rule); }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gut); }

:focus-visible { outline: 2.5px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
