/* Karabína — base: reset, typografia, layout primitives */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: var(--lh-snug);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
  font-weight: 800;
  font-stretch: 112%;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-3xl);
  font-weight: 800;
  font-variation-settings: "wdth" 108;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

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

h4 {
  font-size: var(--fs-lg);
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--signal);
}

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

button {
  cursor: pointer;
}

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

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

::selection {
  background: var(--signal);
  color: var(--on-signal);
}

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

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  top: var(--s-4);
}

[hidden] {
  display: none !important;
}

/* --- Layout primitives --- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

.stack > * + * {
  margin-top: var(--stack, var(--s-4));
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cluster, var(--s-3));
  align-items: center;
}

.section {
  padding-block: clamp(48px, 7vw, 96px);
}

.section--tight {
  padding-block: clamp(32px, 4vw, 56px);
}

.section--sunk {
  background: var(--paper-2);
}

.section--ink {
  --signal-ink: var(--signal-ink-inverse);
  background: var(--inverse-bg);
  color: var(--inverse-fg);
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--ink-2);
}

.subtle {
  color: var(--ink-3);
}

.lead {
  font-size: var(--fs-lg);
  color: var(--ink-2);
  max-width: 60ch;
}

.prose {
  max-width: 68ch;
}

.prose > * + * {
  margin-top: var(--s-4);
}

.prose h2 {
  font-size: var(--fs-2xl);
  margin-top: var(--s-7);
}

.prose h3 {
  margin-top: var(--s-6);
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: var(--s-2);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
